Blame view

service-common/src/main/java/com/java110/common/api/HcGovTranslateApi.java 5.73 KB
88e030b7   王彪总   init project
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
  package com.java110.common.api;
  
  import com.alibaba.fastjson.JSONObject;
  import com.java110.common.bmo.hcGovTranslate.IDeleteHcGovTranslateBMO;
  import com.java110.common.bmo.hcGovTranslate.IGetHcGovTranslateBMO;
  import com.java110.common.bmo.hcGovTranslate.ISaveHcGovTranslateBMO;
  import com.java110.common.bmo.hcGovTranslate.IUpdateHcGovTranslateBMO;
  import com.java110.dto.hcGovTranslate.HcGovTranslateDto;
  import com.java110.po.hcGovTranslate.HcGovTranslatePo;
  import com.java110.utils.util.Assert;
  import com.java110.utils.util.BeanConvertUtil;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.http.ResponseEntity;
  import org.springframework.web.bind.annotation.*;
  
  @RestController
  @RequestMapping(value = "/hcGovTranslate")
  public class HcGovTranslateApi {
  
      @Autowired
      private ISaveHcGovTranslateBMO saveHcGovTranslateBMOImpl;
      @Autowired
      private IUpdateHcGovTranslateBMO updateHcGovTranslateBMOImpl;
      @Autowired
      private IDeleteHcGovTranslateBMO deleteHcGovTranslateBMOImpl;
  
      @Autowired
      private IGetHcGovTranslateBMO getHcGovTranslateBMOImpl;
  
      /**
       * 微信保存消息模板
       * @serviceCode /hcGovTranslate/saveHcGovTranslate
       * @path /app/hcGovTranslate/saveHcGovTranslate
       * @param reqJson
       * @return
       */
      @RequestMapping(value = "/saveHcGovTranslate", method = RequestMethod.POST)
      public ResponseEntity<String> saveHcGovTranslate(@RequestBody JSONObject reqJson) {
  
          Assert.hasKeyAndValue(reqJson, "serviceCode", "请求报文中未包含serviceCode");
          Assert.hasKeyAndValue(reqJson, "reqTime", "请求报文中未包含reqTime");
          Assert.hasKeyAndValue(reqJson, "sign", "请求报文中未包含sign");
          Assert.hasKeyAndValue(reqJson, "extCommunityId", "请求报文中未包含extCommunityId");
          Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
          Assert.hasKeyAndValue(reqJson, "code", "请求报文中未包含code");
          Assert.hasKeyAndValue(reqJson, "govTopic", "请求报文中未包含govTopic");
          Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含state");
          Assert.hasKeyAndValue(reqJson, "sendCount", "请求报文中未包含sendCount");
          Assert.hasKeyAndValue(reqJson, "updateTime", "请求报文中未包含updateTime");
          Assert.hasKeyAndValue(reqJson, "objId", "请求报文中未包含objId");
  
  
          HcGovTranslatePo hcGovTranslatePo = BeanConvertUtil.covertBean(reqJson, HcGovTranslatePo.class);
          return saveHcGovTranslateBMOImpl.save(hcGovTranslatePo);
      }
  
      /**
       * 微信修改消息模板
       * @serviceCode /hcGovTranslate/updateHcGovTranslate
       * @path /app/hcGovTranslate/updateHcGovTranslate
       * @param reqJson
       * @return
       */
      @RequestMapping(value = "/updateHcGovTranslate", method = RequestMethod.POST)
      public ResponseEntity<String> updateHcGovTranslate(@RequestBody JSONObject reqJson) {
  
          Assert.hasKeyAndValue(reqJson, "tranId", "请求报文中未包含tranId");
          Assert.hasKeyAndValue(reqJson, "serviceCode", "请求报文中未包含serviceCode");
          Assert.hasKeyAndValue(reqJson, "reqTime", "请求报文中未包含reqTime");
          Assert.hasKeyAndValue(reqJson, "sign", "请求报文中未包含sign");
          Assert.hasKeyAndValue(reqJson, "extCommunityId", "请求报文中未包含extCommunityId");
          Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
          Assert.hasKeyAndValue(reqJson, "code", "请求报文中未包含code");
          Assert.hasKeyAndValue(reqJson, "govTopic", "请求报文中未包含govTopic");
          Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含state");
          Assert.hasKeyAndValue(reqJson, "sendCount", "请求报文中未包含sendCount");
          Assert.hasKeyAndValue(reqJson, "updateTime", "请求报文中未包含updateTime");
          Assert.hasKeyAndValue(reqJson, "objId", "请求报文中未包含objId");
          Assert.hasKeyAndValue(reqJson, "tranId", "tranId不能为空");
  
  
          HcGovTranslatePo hcGovTranslatePo = BeanConvertUtil.covertBean(reqJson, HcGovTranslatePo.class);
          return updateHcGovTranslateBMOImpl.update(hcGovTranslatePo);
      }
  
      /**
       * 微信删除消息模板
       * @serviceCode /hcGovTranslate/deleteHcGovTranslate
       * @path /app/hcGovTranslate/deleteHcGovTranslate
       * @param reqJson
       * @return
       */
      @RequestMapping(value = "/deleteHcGovTranslate", method = RequestMethod.POST)
      public ResponseEntity<String> deleteHcGovTranslate(@RequestBody JSONObject reqJson) {
9750b443   王彪总   fix(config): 更新配置...
95
          Assert.hasKeyAndValue(reqJson, "communityId", "项目ID不能为空");
88e030b7   王彪总   init project
96
97
98
99
100
101
102
103
104
105
106
107
  
          Assert.hasKeyAndValue(reqJson, "tranId", "tranId不能为空");
  
  
          HcGovTranslatePo hcGovTranslatePo = BeanConvertUtil.covertBean(reqJson, HcGovTranslatePo.class);
          return deleteHcGovTranslateBMOImpl.delete(hcGovTranslatePo);
      }
  
      /**
       * 微信删除消息模板
       * @serviceCode /hcGovTranslate/queryHcGovTranslate
       * @path /app/hcGovTranslate/queryHcGovTranslate
9750b443   王彪总   fix(config): 更新配置...
108
       * @param communityId 项目ID
88e030b7   王彪总   init project
109
110
111
112
113
114
115
116
117
118
119
120
121
       * @return
       */
      @RequestMapping(value = "/queryHcGovTranslate", method = RequestMethod.GET)
      public ResponseEntity<String> queryHcGovTranslate(@RequestParam(value = "communityId") String communityId,
                                                        @RequestParam(value = "page") int page,
                                                        @RequestParam(value = "row") int row) {
          HcGovTranslateDto hcGovTranslateDto = new HcGovTranslateDto();
          hcGovTranslateDto.setPage(page);
          hcGovTranslateDto.setRow(row);
          hcGovTranslateDto.setCommunityId(communityId);
          return getHcGovTranslateBMOImpl.get(hcGovTranslateDto);
      }
  }