From 9a56c5710eb281afc06e2f3a211b8b595f24bbe1 Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期三, 16 八月 2023 09:39:34 +0800
Subject: [PATCH] update
---
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCommercialController.java | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCommercialController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCommercialController.java
index 85fa9f5..684eb4a 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCommercialController.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCommercialController.java
@@ -1,6 +1,8 @@
package com.stylefeng.guns.modular.system.controller.general;
import com.stylefeng.guns.core.base.controller.BaseController;
+import com.stylefeng.guns.core.base.tips.SuccessTip;
+import com.stylefeng.guns.modular.system.controller.util.LabelReplaceUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -11,6 +13,8 @@
import org.springframework.web.bind.annotation.RequestParam;
import com.stylefeng.guns.modular.system.model.TCommercial;
import com.stylefeng.guns.modular.system.service.ITCommercialService;
+
+import java.util.Date;
/**
* 控制器
@@ -69,6 +73,8 @@
@RequestMapping(value = "/add")
@ResponseBody
public Object add(TCommercial tCommercial) {
+ tCommercial.setHtml(LabelReplaceUtil.replace(tCommercial.getHtml()));
+ tCommercial.setCreateTime(new Date());
tCommercialService.insert(tCommercial);
return SUCCESS_TIP;
}
@@ -84,11 +90,44 @@
}
/**
+ * 上线
+ */
+ @RequestMapping(value = "/onLine")
+ @ResponseBody
+ public Object onLine(@RequestParam Integer tCommercialId) {
+ TCommercial tCommercial = tCommercialService.selectById(tCommercialId);
+ Boolean exit = tCommercialService.isExit(tCommercialId, 1);
+ if(exit){
+ return new SuccessTip(500,"最多可上架4个弹窗广告!");
+ }
+ tCommercial.setOnOffLine(1);
+ tCommercialService.updateById(tCommercial);
+ return SUCCESS_TIP;
+ }
+
+ /**
+ * 下线
+ */
+ @RequestMapping(value = "/offLine")
+ @ResponseBody
+ public Object offLine(@RequestParam Integer tCommercialId) {
+ TCommercial tCommercial = tCommercialService.selectById(tCommercialId);
+ tCommercial.setOnOffLine(2);
+ tCommercialService.updateById(tCommercial);
+ return SUCCESS_TIP;
+ }
+
+ /**
* 修改
*/
@RequestMapping(value = "/update")
@ResponseBody
public Object update(TCommercial tCommercial) {
+ if(0 == tCommercial.getIsJump()){
+ tCommercial.setJumpType(0);
+ tCommercial.setJumpUrl("");
+ }
+ tCommercial.setHtml(LabelReplaceUtil.replace(tCommercial.getHtml()));
tCommercialService.updateById(tCommercial);
return SUCCESS_TIP;
}
--
Gitblit v1.7.1