Parcourir la source

修复thymeleaf报错问题

pengshaojie il y a 6 ans
Parent
commit
0cf372575f

+ 1 - 1
wsm-admin-dao/src/main/java/com/wsm/admin/model/Device.java

@@ -28,7 +28,7 @@ public class Device extends BaseModel implements Serializable {
     /**
      * 设备类型
      */
-    @Column(columnDefinition = "enum('YG')")
+    @Column(columnDefinition = "enum('YG','JG')")
     private String deviceType;
     /**
      * 经度

+ 5 - 5
wsm-admin-dao/src/main/java/com/wsm/admin/model/DeviceStatus.java

@@ -22,7 +22,7 @@ public class DeviceStatus extends BaseModel implements Serializable {
      * 状态类型:0:当前状态/1:实时报警
      */
     @Column(length = 2)
-    private Byte deviceType;
+    private Byte status;
 
     public Device getDevice() {
         return device;
@@ -40,11 +40,11 @@ public class DeviceStatus extends BaseModel implements Serializable {
         this.content = content;
     }
 
-    public Byte getDeviceType() {
-        return deviceType;
+    public Byte getStatus() {
+        return status;
     }
 
-    public void setDeviceType(Byte deviceType) {
-        this.deviceType = deviceType;
+    public void setStatus(Byte status) {
+        this.status = status;
     }
 }

+ 14 - 5
wsm-application/pom.xml

@@ -51,17 +51,26 @@
                 </exclusion>
             </exclusions>
         </dependency>
-
+        <!-- 打war包需要把以下注释掉 -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
+            <artifactId>spring-boot-starter-tomcat</artifactId>
+            <scope>provided</scope>
         </dependency>
+
+        <!--<dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>3.1.0</version>
+            <scope>provided</scope>
+        </dependency>-->
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-tomcat</artifactId>
-            <scope>provided</scope>
+            <artifactId>spring-boot-starter-test</artifactId>
         </dependency>
 
+
         <dependency>
             <groupId>com.github.theborakompanioni</groupId>
             <artifactId>thymeleaf-extras-shiro</artifactId>
@@ -91,7 +100,7 @@
     </dependencies>
 
     <build>
-        <finalName>mood-wall</finalName>
+        <finalName>jm-smart-city</finalName>
         <plugins>
             <plugin>
                 <groupId>org.springframework.boot</groupId>

+ 10 - 0
wsm-application/src/main/resources/application.properties

@@ -12,6 +12,16 @@ spring.jpa.properties.jadira.usertype.autoRegisterUserTypes=true
 spring.jpa.hibernate.ddl-auto=update
 spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
 # THYMELEAF
+spring.thymeleaf.prefix=classpath:/templates/
+spring.thymeleaf.suffix=.html
+spring.thymeleaf.mode=LEGACYHTML5
+spring.thymeleaf.encoding=UTF-8
+spring.thymeleaf.cache=false
+spring.thymeleaf.content-type=text/html
+#log
+logging.config=classpath:logback.xml
+spring.http.multipart.maxFileSize=10Mb
+spring.http.multipart.maxRequestSize=1000Mb
 
 web.upload.file.path=/usr/local/jm-smart-city/upload/