李天标 3 years ago
parent
commit
57f0ed7934

+ 1 - 1
src/main/java/com/szwl/Application.java

@@ -12,7 +12,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
 @EnableEurekaClient
 @EnableFeignClients
 @MapperScan("com.szwl.mapper")
-@SpringBootApplication(scanBasePackages = {"com.szwl", "cn.com.crbank.ommo.exception","cn.com.crbank.ommo.esclient"})
+@SpringBootApplication(scanBasePackages = {"com.szwl", "cn.com.crbank.ommo.exception","cn.com.crbank.ommo.esclient","org.springframework.amqp.core"})
 public class Application{
     public static void main(String[] args) {
         SpringApplication.run(Application.class, args);

+ 16 - 16
src/main/java/com/szwl/controller/IndexController.java

@@ -50,7 +50,7 @@ public class IndexController { ;
     @Autowired
     TParametersService parametersService;
     @ApiOperation(value = "心跳")
-    @PostMapping("/heart")
+    @PostMapping("/heart.htm")
     public JsonMessage heart(@RequestBody EquipmentVo equipmentVo) {
 
         String clientId = equipmentVo.getClientId();
@@ -504,7 +504,7 @@ public class IndexController { ;
      * @param
      * @return
      */
-    @RequestMapping(value = "/updateFlowers", method = RequestMethod.POST)
+    @RequestMapping(value = "/updateFlowers.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage updateFlowers(String clientId,String number){
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -559,7 +559,7 @@ public class IndexController { ;
 
      * @return
      */
-    @RequestMapping(value = "/equimentType", method = RequestMethod.POST)
+    @RequestMapping(value = "/equimentType.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage equimentType(String clientId, String equimentType){
         if(!StringUtils.isEmpty(equimentType)){
@@ -784,7 +784,7 @@ public class IndexController { ;
      * @param clientId
      * @return
      */
-    @RequestMapping(value = "/separate", method = RequestMethod.POST)
+    @RequestMapping(value = "/separate.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage separate(String clientId) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -809,7 +809,7 @@ public class IndexController { ;
     /**
      * 修改设备联系人名称以及电话
      */
-    @RequestMapping(value = "/updateContractPN", method = RequestMethod.POST)
+    @RequestMapping(value = "/updateContractPN.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage updateContractPN(String clientId, String contactName, String contactPhone) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -828,7 +828,7 @@ public class IndexController { ;
     /**
      * 设备上传公司电话
      */
-    @RequestMapping(value = "/sentCompanyPhone", method = RequestMethod.POST)
+    @RequestMapping(value = "/sentCompanyPhone.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage sentCompanyPhone(String clientId, String companyPhone) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -845,7 +845,7 @@ public class IndexController { ;
     /**
      * 获取二维码图片
      */
-    @RequestMapping(value = "/getQrCodeImgUrl", method = RequestMethod.GET)
+    @RequestMapping(value = "/getQrCodeImgUrl.htm", method = RequestMethod.GET)
     @ResponseBody
     public String getQrCodeImgUrl(String clientId) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -868,7 +868,7 @@ public class IndexController { ;
     /**
      * 上传4G卡号
      */
-    @RequestMapping(value = "/sentSimNo", method = RequestMethod.POST)
+    @RequestMapping(value = "/sentSimNo.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage sentSimNo(String clientId, String simNo) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -890,7 +890,7 @@ public class IndexController { ;
      * @param eqeStatus 设备状态1开 0关
      * @return
      */
-    @RequestMapping(value = "/updateEqeStatus", method = RequestMethod.POST)
+    @RequestMapping(value = "/updateEqeStatus.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage updateEqeStatus(String clientId, Integer eqeStatus) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -914,7 +914,7 @@ public class IndexController { ;
      * @param eqeStatus 设备状态1开 0关
      * @return
      */
-    @RequestMapping(value = "/updateEqeStatusNew", method = RequestMethod.POST)
+    @RequestMapping(value = "/updateEqeStatusNew.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage updateEqeStatusNew(String clientId, Integer eqeStatus,String netTime) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -938,7 +938,7 @@ public class IndexController { ;
      * @param block
      * @return
      */
-    @RequestMapping(value = "/updateBlock", method = RequestMethod.POST)
+    @RequestMapping(value = "/updateBlock.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage updateBlock(String clientId, Boolean block) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -960,7 +960,7 @@ public class IndexController { ;
      * @param is_sleep
      * @return
      */
-    @RequestMapping(value = "/updateSleep", method = RequestMethod.POST)
+    @RequestMapping(value = "/updateSleep.htm", method = RequestMethod.POST)
     @ResponseBody
     public JsonMessage updateSleep(String clientId, Boolean is_sleep) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -1032,7 +1032,7 @@ public class IndexController { ;
      * @param
      * @return
      */
-    @PostMapping(value = "/updateParamNew/{code}/{clientId}", produces = "application/json;charset=UTF-8")
+    @PostMapping(value = "/updateParamNew.htm/{code}/{clientId}", produces = "application/json;charset=UTF-8")
     @ResponseBody
     public JsonMessage updateParamNew(@PathVariable Integer code, @PathVariable String clientId, @RequestBody List<CommonParamVo> commonParamVos) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -1082,7 +1082,7 @@ public class IndexController { ;
      * @param
      * @return
      */
-    @PostMapping(value = "/updateAloneParam", produces = "application/json;charset=UTF-8")
+    @PostMapping(value = "/updateAloneParam.htm", produces = "application/json;charset=UTF-8")
     @ResponseBody
     public JsonMessage updateAloneParam(String code, String clientId,String name,String val) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
@@ -1116,7 +1116,7 @@ public class IndexController { ;
     /**
      * 获取机器列表
      */
-    @RequestMapping(value = "/getEquipmentList", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+    @RequestMapping(value = "/getEquipmentList.htm", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
     @ResponseBody
     public Object getByAdminAndProduct(String adminId,String name) {
         JSONObject jsonObject = new JSONObject();
@@ -1164,7 +1164,7 @@ public class IndexController { ;
     /**
      * 获取商品信息
      */
-    @RequestMapping(value = "/getProductions", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+    @RequestMapping(value = "/getProductions.htm", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
     @ResponseBody
     public Object getProductions(String adminId,String clientId) {
         JSONObject jsonObject = new JSONObject();

+ 3 - 2
src/main/java/com/szwl/controller/RabbitMqController.java

@@ -6,6 +6,7 @@ import com.szwl.model.bo.JsonMessage;
 import com.szwl.model.entity.TEquipment;
 import com.szwl.service.TAdminService;
 import com.szwl.service.TEquipmentService;
+import io.swagger.annotations.Api;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.amqp.core.*;
 import org.springframework.amqp.rabbit.core.RabbitAdmin;
@@ -21,7 +22,7 @@ import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
+@Api(value = "/api/app_mq/rabbitMq", tags = {"MQ"})
 @RestController
 @RequestMapping("/api/app_mq/rabbitMq")
 public class RabbitMqController {
@@ -69,7 +70,7 @@ public class RabbitMqController {
     public Object addQueue(String exchange,String queue,String routingKey,Boolean durable){
         Map<String,Object> arg = new HashMap<>();
         arg.put("x-message-ttl",1800000);
-        amqpAdmin.declareQueue(new Queue(queue, durable,false,false,arg));
+        String queue1 = amqpAdmin.declareQueue(new Queue(queue, durable, false, false, arg));
         HashMap<String, Object> objectObjectHashMap = new HashMap<>();
         amqpAdmin.declareBinding(new Binding(queue,
                 Binding.DestinationType.QUEUE,

+ 3 - 0
src/main/java/com/szwl/controller/TAlarmRecordController.java

@@ -1,6 +1,7 @@
 package com.szwl.controller;
 
 
+import io.swagger.annotations.Api;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
@@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.RestController;
  * @author wuhs
  * @since 2022-04-27
  */
+@Api(value = "/tAlarmRecord", tags = {"报警信息"})
+
 @RestController
 @RequestMapping("/tAlarmRecord")
 public class TAlarmRecordController {

+ 2 - 0
src/main/java/com/szwl/controller/TEquipmentController.java

@@ -16,6 +16,7 @@ import com.szwl.model.query.StatisticsParam;
 import com.szwl.model.utils.DateUtils;
 import com.szwl.model.utils.PushUtils;
 import com.szwl.service.*;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.amqp.core.MessageProperties;
@@ -39,6 +40,7 @@ import java.util.stream.Collectors;
  * @author wuhs
  * @since 2022-04-19
  */
+@Api(value = "/tEquipment", tags = {"设备控制器"})
 @RestController
 @RequestMapping("/tEquipment")
 public class TEquipmentController {

+ 44 - 29
src/main/resources/bootstrap.yml

@@ -13,37 +13,52 @@ spring:
     username: root
     password: sunzee@020
     driver-class-name: com.mysql.jdbc.Driver
-  stream:
-      # 如果你项目里只对接一个中间件,那么不用定义binders
-      # 当系统要定义多个不同消息中间件的时候,使用binders定义
-      binders:
-        my-rabbit:
-          type: rabbit
-          environment:
-            spring:
-              rabbitmq:
-                addresses: 112.74.63.148:5672,120.78.140.173:5672,47.112.127.131:5672
-                username: zwlzwlzwl
-                password: 123456
-                virtual-host: /
-                publisher-confirms: true
-                connection-timeout: 5s
-                mandatory: true
-                template.mandatory: true
-                publisher-returns: true
-                cache.channel.size: 1000
-                concurrency: 500
-                max-concurrency: 2000
-                listener.simple.concurrency: 1000
-                listener.simple.max-concurrency: 2000
+#  stream:
+#      # 如果你项目里只对接一个中间件,那么不用定义binders
+#      # 当系统要定义多个不同消息中间件的时候,使用binders定义
+#      binders:
+#        my-rabbit:
+#          type: rabbit
+#          environment:
+#            spring:
+#              rabbitmq:
+#                addresses: 112.74.63.148:5672,120.78.140.173:5672,47.112.127.131:5672
+#                username: zwlzwlzwl
+#                password: 123456
+#                virtual-host: /
+#                publisher-confirms: true
+#                connection-timeout: 5s
+#                mandatory: true
+#                template.mandatory: true
+#                publisher-returns: true
+#                cache.channel.size: 1000
+#                concurrency: 500
+#                max-concurrency: 2000
+#                listener.simple.concurrency: 1000
+#                listener.simple.max-concurrency: 2000
+rabbitmq:
+  addresses: 112.74.63.148:5672
+  username: zwlzwlzwl
+  password: 123456
+  virtual-host: /
+  publisher-confirms: true
+  connection-timeout: 5s
+  mandatory: true
+  template.mandatory: true
+  publisher-returns: true
+  cache.channel.size: 1000
+  concurrency: 500
+  max-concurrency: 2000
+  listener.simple.concurrency: 1000
+  listener.simple.max-concurrency: 2000
 elasticSearch:
-            host: 120.78.140.173
+  host: 120.78.140.173
 #elasticSearch.host: 10.0.0.155
-            port: 9200
-            client.connectNum: 1000
-            connectPerRoute: 50
-            client.esUserName: elastic
-            client.esPassword: sunzee@020
+  port: 9200
+  client.connectNum: 1000
+  connectPerRoute: 50
+  client.esUserName: elastic
+  client.esPassword: sunzee@020
 server:
   port: 49011