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