Commit 4885c3054e4cde92f795429799c88730da0e148d

Authored by 王言钊
1 parent a7e75e69

修复活动api接口等已知问题、添加日志打印

src/main/java/com/cnlive/shenhe/api/ShyActivityControllerApi.java
@@ -14,8 +14,6 @@ import org.springframework.web.bind.annotation.PostMapping; @@ -14,8 +14,6 @@ import org.springframework.web.bind.annotation.PostMapping;
14 import org.springframework.web.bind.annotation.RequestMapping; 14 import org.springframework.web.bind.annotation.RequestMapping;
15 import org.springframework.web.bind.annotation.ResponseBody; 15 import org.springframework.web.bind.annotation.ResponseBody;
16 16
17 -import java.util.Date;  
18 -  
19 /** 17 /**
20 * @Author: yan-zhao-wang 18 * @Author: yan-zhao-wang
21 * @DateTime: 2022-06-14 9:18 19 * @DateTime: 2022-06-14 9:18
@@ -33,7 +31,7 @@ public class ShyActivityControllerApi { @@ -33,7 +31,7 @@ public class ShyActivityControllerApi {
33 @PostMapping("/import") 31 @PostMapping("/import")
34 @ResponseBody 32 @ResponseBody
35 public ResponseBean insterShyActivity(String param) { 33 public ResponseBean insterShyActivity(String param) {
36 - logger.info("活动添加,param====={}", param); 34 + logger.info("活动添加接受参数为:param====={}", param);
37 // 转换JSON对象 35 // 转换JSON对象
38 JSONObject json = JSONObject.parseObject(param); 36 JSONObject json = JSONObject.parseObject(param);
39 Integer id = json.getInteger("id"); 37 Integer id = json.getInteger("id");
@@ -42,10 +40,7 @@ public class ShyActivityControllerApi { @@ -42,10 +40,7 @@ public class ShyActivityControllerApi {
42 ShyActivity shyActivity = new ShyActivity(); 40 ShyActivity shyActivity = new ShyActivity();
43 shyActivity.setId(id); 41 shyActivity.setId(id);
44 shyActivity.setActivity(activity); 42 shyActivity.setActivity(activity);
45 - shyActivity.setCreate_time(new Date());  
46 - shyActivity.setUpdate_time(new Date());  
47 - shyActivity.setExempt_from_trial(0);  
48 - logger.info("封装对象为,{}", JSON.toJSON(shyActivity)); 43 + logger.info("封装对象为:{}", JSON.toJSON(shyActivity));
49 // 根据id查询是否存在 44 // 根据id查询是否存在
50 Boolean shyActivityObj = shyActivityImpl.selectById(id); 45 Boolean shyActivityObj = shyActivityImpl.selectById(id);
51 // 如果对象不存在,就直接添加 46 // 如果对象不存在,就直接添加
src/main/java/com/cnlive/shenhe/dto/LiveDTO.java
@@ -45,7 +45,7 @@ public class LiveDTO extends ShyLive implements Serializable { @@ -45,7 +45,7 @@ public class LiveDTO extends ShyLive implements Serializable {
45 } 45 }
46 46
47 public Integer getPageSize() { 47 public Integer getPageSize() {
48 - return pageSize == null ? 10 : pageSize; 48 + return pageSize == null ? 20 : pageSize;
49 } 49 }
50 50
51 public void setPageSize(Integer pageSize) { 51 public void setPageSize(Integer pageSize) {
src/main/java/com/cnlive/shenhe/serviceImpl/ShyActivityImpl.java
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
5 import com.cnlive.shenhe.dto.ShyActivityDTO; 5 import com.cnlive.shenhe.dto.ShyActivityDTO;
6 import com.cnlive.shenhe.entity.ShyActivity; 6 import com.cnlive.shenhe.entity.ShyActivity;
7 import com.cnlive.shenhe.mapper.ShyActivityMapper; 7 import com.cnlive.shenhe.mapper.ShyActivityMapper;
  8 +import com.cnlive.shenhe.utils.CommonConst;
8 import com.cnlive.shenhe.utils.CommonUtils; 9 import com.cnlive.shenhe.utils.CommonUtils;
9 import com.github.pagehelper.PageHelper; 10 import com.github.pagehelper.PageHelper;
10 import com.github.pagehelper.PageInfo; 11 import com.github.pagehelper.PageInfo;
@@ -40,7 +41,8 @@ public class ShyActivityImpl { @@ -40,7 +41,8 @@ public class ShyActivityImpl {
40 Date date = new Date(); 41 Date date = new Date();
41 shyActivity.setCreate_time(date); 42 shyActivity.setCreate_time(date);
42 shyActivity.setUpdate_time(date); 43 shyActivity.setUpdate_time(date);
43 - shyActivity.setExempt_from_trial(3); 44 + shyActivity.setExempt_from_trial(CommonConst.AUDIT_TYPE_USER);
  45 + logger.info("添加对象为:{}", JSON.toJSON(shyActivity));
44 int result = shyActivityMapper.insertSelective(shyActivity); 46 int result = shyActivityMapper.insertSelective(shyActivity);
45 if (result > 0) { 47 if (result > 0) {
46 return true; 48 return true;
@@ -72,6 +74,7 @@ public class ShyActivityImpl { @@ -72,6 +74,7 @@ public class ShyActivityImpl {
72 Date date = new Date(); 74 Date date = new Date();
73 shyActivity.setCreate_time(date); 75 shyActivity.setCreate_time(date);
74 shyActivity.setUpdate_time(date); 76 shyActivity.setUpdate_time(date);
  77 + logger.info("修改对象为:{}", JSON.toJSON(shyActivity));
75 int result = shyActivityMapper.updateByPrimaryKeySelective(shyActivity); 78 int result = shyActivityMapper.updateByPrimaryKeySelective(shyActivity);
76 if (result > 0) { 79 if (result > 0) {
77 return true; 80 return true;
@@ -144,7 +147,6 @@ public class ShyActivityImpl { @@ -144,7 +147,6 @@ public class ShyActivityImpl {
144 return true; 147 return true;
145 } 148 }
146 return false; 149 return false;
147 -  
148 } 150 }
149 151
150 152