lyhzzz 2 роки тому
батько
коміт
db95a1498f

+ 5 - 0
src/main/java/com/fdkankan/manage/controller/ServiceUpTipController.java

@@ -41,6 +41,11 @@ public class ServiceUpTipController {
 
     @PostMapping("/saveOrUpdate")
     public ResultData saveOrUpdate(@RequestBody ServiceUpTip param){
+
+        if(param.getId() != null){
+            ServiceUpTip entity = serviceUpTipService.getById(param.getId());
+            param.setType(entity.getType());
+        }
         param.setCreateTime(null);
         param.setUpdateTime(null);
         if(param.getBanStatus() !=null && param.getBanStatus() == 0){

+ 29 - 6
src/main/java/com/fdkankan/manage/entity/ServiceUpTip.java

@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
+
 import lombok.Getter;
 import lombok.Setter;
 
@@ -51,12 +53,11 @@ public class ServiceUpTip implements Serializable {
      */
     @TableField("title")
     private String title;
-
     /**
-     * zh 中文,en英文
+     * 标题
      */
-    @TableField("lang")
-    private String lang;
+    @TableField("title_en")
+    private String titleEn;
 
     /**
      * 图片,视频url
@@ -69,12 +70,17 @@ public class ServiceUpTip implements Serializable {
      */
     @TableField("description")
     private String description;
+    /**
+     * 说明
+     */
+    @TableField("description_en")
+    private String descriptionEn;
 
     /**
      * 详情链接
      */
-    @TableField("info_url")
-    private String infoUrl;
+    @TableField("info_url_en")
+    private String infoUrlEn;
 
     /**
      * 0启用,1禁用
@@ -93,4 +99,21 @@ public class ServiceUpTip implements Serializable {
     private Date updateTime;
 
 
+    @TableField(exist = false)
+    private List<String> timeList;
+
+    public String getTipStartTime() {
+        if(timeList != null && timeList.size() >0){
+            return timeList.get(0) + " 00:00:00";
+        }
+        return tipStartTime;
+    }
+
+    public String getTipEndTime() {
+        if(timeList != null && timeList.size() >1){
+            return timeList.get(1) + " 23:59:59";
+        }
+        return tipEndTime;
+    }
+
 }