Selaa lähdekoodia

1、设备代码更新
2、队列代码更新

guq 6 vuotta sitten
vanhempi
commit
23217f4b23
34 muutettua tiedostoa jossa 569 lisäystä ja 281 poistoa
  1. 18 5
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/controller/DeviceController.java
  2. 12 8
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/listener/AccessControlListener.java
  3. 11 1
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/DeviceMapper.java
  4. 9 9
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/po/Device.java
  5. 6 0
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/DeviceService.java
  6. 58 1
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/DeviceServiceImpl.java
  7. 5 2
      applications/device/device-server/src/main/resources/application.yml
  8. 93 1
      applications/device/device-server/src/main/resources/mapper/DeviceMapper.xml
  9. 14 0
      applications/school/school-api/pom.xml
  10. 14 0
      applications/school/school-api/src/main/java/com/usoftchina/smartschool/school/api/SchoolApi.java
  11. 110 0
      applications/school/school-dto/src/main/java/com/usoftchina/smartschool/school/dto/SysSchoolDTO.java
  12. 9 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/controller/SchoolController.java
  13. 2 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/SchoolService.java
  14. 9 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/SchoolServiceImpl.java
  15. 2 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysSchoolMapper.java
  16. 10 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysSchool.java
  17. 5 0
      applications/school/school-server/src/main/resources/mapper/SysSchoolMapper.xml
  18. 5 0
      applications/wechat/wechat-auth/pom.xml
  19. 0 15
      applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/EnableApiAuthClient.java
  20. 18 0
      applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/EnableOpenApiAuthClient.java
  21. 1 1
      applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/configuration/OpenApiConfig.java
  22. 19 1
      applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/configuration/OpenApiConfiguration.java
  23. 13 10
      applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/interceptor/OpenApiAuthInterceptor.java
  24. 4 1
      applications/wechat/wechat-server/pom.xml
  25. 3 9
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/WechatApplication.java
  26. 52 52
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/config/RabbitConfig.java
  27. 2 1
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/TransfersController.java
  28. 2 0
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/WxPushController.java
  29. 3 3
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/ReceiveService.java
  30. 28 20
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/SendService.java
  31. 10 9
      applications/wechat/wechat-server/src/main/resources/application.yml
  32. 6 0
      base-servers/gateway-server/src/main/resources/application.yml
  33. 0 131
      base-servers/gateway-server/src/main/resources/logback-spring.xml
  34. 16 1
      pom.xml

+ 18 - 5
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/controller/DeviceController.java

@@ -6,11 +6,11 @@ import com.usoftchina.smartschool.device.po.Device;
 import com.usoftchina.smartschool.device.service.DeviceService;
 import com.usoftchina.smartschool.page.PageDefault;
 import com.usoftchina.smartschool.page.PageRequest;
+import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
+import com.usoftchina.smartschool.school.dto.DocBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author yingp
@@ -25,7 +25,20 @@ public class DeviceController {
 
     @GetMapping("/list")
     public Result getList(@PageDefault PageRequest page, ListReqDTO listReqDTO) {
-        PageInfo<Device> teacher = deviceService.getListData(page, listReqDTO);
-        return Result.success(teacher);
+        PageInfo<Device> data = deviceService.getListData(page, listReqDTO);
+        return Result.success(data);
     }
+
+    @PostMapping("/save")
+    public Result saveFormData(@RequestBody Device data) {
+        DocBaseDTO formData = deviceService.saveFormData(data);
+        return Result.success(formData);
+    }
+
+    @PostMapping("/batchDelete")
+    public Result batchDelete(@RequestBody BatchDealBaseDTO baseDTOs) {
+        deviceService.batchDelete(baseDTOs);
+        return Result.success();
+    }
+
 }

+ 12 - 8
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/listener/AccessControlListener.java

@@ -4,9 +4,13 @@ import com.usoftchina.smartschool.base.Result;
 import com.usoftchina.smartschool.device.api.DeviceApi;
 import com.usoftchina.smartschool.device.dto.DeviceInfo;
 import com.usoftchina.smartschool.device.event.AccessControlEvent;
+import com.usoftchina.smartschool.device.mapper.DeviceMapper;
+import com.usoftchina.smartschool.device.po.Device;
 import com.usoftchina.smartschool.device.po.ImageFile;
+import com.usoftchina.smartschool.device.service.DeviceService;
 import com.usoftchina.smartschool.file.api.FileApi;
 import com.usoftchina.smartschool.file.dto.FileInfoDTO;
+import com.usoftchina.smartschool.utils.StringUtils;
 import org.aspectj.util.FileUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -34,6 +38,8 @@ public class AccessControlListener implements InitializingBean{
     @Autowired
     private DeviceApi deviceApi;
 
+    @Autowired
+    private DeviceMapper deviceMapper;
 
     private Logger logger = LoggerFactory.getLogger(AccessControlListener.class);
 
@@ -69,13 +75,11 @@ public class AccessControlListener implements InitializingBean{
 
     @Override
     public void afterPropertiesSet() throws Exception {
-        DeviceInfo deviceInfo = new DeviceInfo();
-        deviceInfo.setIp("10.1.80.208");
-        deviceInfo.setPort(37777);
-        deviceInfo.setPassword("A12345678");
-        deviceInfo.setUsername("admin");
-        List<DeviceInfo> deviceInfos = new ArrayList<>();
-        deviceInfos.add(deviceInfo);
-        deviceInfos.forEach(deviceApi::add);
+        List<DeviceInfo> devices = deviceMapper.findAll();
+        devices.forEach(device -> {
+            if (!StringUtils.isEmpty(device.getUsername())) {
+                deviceApi.add(device);
+            }
+        });
     }
 }

+ 11 - 1
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/DeviceMapper.java

@@ -1,7 +1,9 @@
 package com.usoftchina.smartschool.device.mapper;
 
+import com.usoftchina.smartschool.device.dto.DeviceInfo;
 import com.usoftchina.smartschool.device.po.Device;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
@@ -12,5 +14,13 @@ import java.util.List;
  */
 @Mapper
 public interface DeviceMapper {
-    List<Device> findAll();
+    List<DeviceInfo> findAll();
+
+    List<Device> selectByConditon(@Param("con") String condition);
+
+    void insertSelective(Device formdata);
+
+    void updateByPrimaryKeySelective(Device formdata);
+
+    void deleteByPrimaryKey(Long id);
 }

+ 9 - 9
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/po/Device.java

@@ -1,5 +1,6 @@
 package com.usoftchina.smartschool.device.po;
 
+
 import java.io.Serializable;
 
 /**
@@ -14,7 +15,7 @@ public class Device implements Serializable{
 
     private String deviceIp;
 
-    private String devicePort;
+    private Integer devicePort;
 
     private String deviceUser;
 
@@ -22,6 +23,13 @@ public class Device implements Serializable{
 
     private String deviceRemark;
 
+    public Integer getDevicePort() {
+        return devicePort;
+    }
+
+    public void setDevicePort(Integer devicePort) {
+        this.devicePort = devicePort;
+    }
 
     public String getDeviceIp() {
         return deviceIp;
@@ -55,14 +63,6 @@ public class Device implements Serializable{
         this.deviceName = deviceName;
     }
 
-    public String getDevicePort() {
-        return devicePort;
-    }
-
-    public void setDevicePort(String devicePort) {
-        this.devicePort = devicePort;
-    }
-
     public String getDeviceUser() {
         return deviceUser;
     }

+ 6 - 0
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/DeviceService.java

@@ -3,8 +3,14 @@ package com.usoftchina.smartschool.device.service;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.smartschool.device.po.Device;
 import com.usoftchina.smartschool.page.PageRequest;
+import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
+import com.usoftchina.smartschool.school.dto.DocBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
 
 public interface DeviceService {
     PageInfo<Device> getListData(PageRequest page, ListReqDTO listReqDTO);
+
+    DocBaseDTO saveFormData(Device data);
+
+    void batchDelete(BatchDealBaseDTO baseDTOs);
 }

+ 58 - 1
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/DeviceServiceImpl.java

@@ -1,11 +1,23 @@
 package com.usoftchina.smartschool.device.service.impl;
 
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.smartschool.context.BaseContextHolder;
+import com.usoftchina.smartschool.device.mapper.DeviceMapper;
 import com.usoftchina.smartschool.device.po.Device;
 import com.usoftchina.smartschool.device.service.DeviceService;
+import com.usoftchina.smartschool.exception.BizException;
+import com.usoftchina.smartschool.exception.ExceptionCode;
 import com.usoftchina.smartschool.page.PageRequest;
+import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
+import com.usoftchina.smartschool.school.dto.DocBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import java.util.List;
 
 /**
  * @author: guq
@@ -14,9 +26,54 @@ import org.springframework.stereotype.Service;
 @Service
 public class DeviceServiceImpl implements DeviceService{
 
+    @Autowired
+    private DeviceMapper deviceMapper;
+
     @Override
     public PageInfo<Device> getListData(PageRequest page, ListReqDTO listReqDTO) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        List<Device> data = deviceMapper.selectByConditon(condition);
+        PageInfo<Device> list = new PageInfo<>(data);
+        return list;
+    }
+
+    @Override
+    public DocBaseDTO saveFormData(Device formdata) {
+        if (StringUtils.isEmpty(formdata)){
+            throw new BizException(ExceptionCode.ILLEGAL_ARGUMENTS);
+        }
+        Long id = formdata.getDeviceId();
+        if (StringUtils.isEmpty(id) || "0".equals(id.toString())) {
+            deviceMapper.insertSelective(formdata);
+            id = formdata.getDeviceId();
+        } else {
+            //更新
+            deviceMapper.updateByPrimaryKeySelective(formdata);
+        }
+        return new DocBaseDTO(formdata.getDeviceId());
+    }
+
+
+    @Override
+    public void batchDelete(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            delete(base.getId());
+        }
+    }
 
-        return null;
+    private void delete(Long id) {
+        if (null == id || "0".equals(id)) {
+            return;
+        }
+        deviceMapper.deleteByPrimaryKey(id);
     }
 }

+ 5 - 2
applications/device/device-server/src/main/resources/application.yml

@@ -48,7 +48,7 @@ management:
     health:
       show-details: always
 server:
-  port: 9680
+  port: 9620
   tomcat:
     uri-encoding: UTF-8
 info:
@@ -71,4 +71,7 @@ hystrix:
                 enabled: true
               isolation:
                     thread:
-                        timeoutInMilliseconds: 4000
+                        timeoutInMilliseconds: 4000
+mybatis:
+  type-aliases-package: com.usoftchina.smartschool.device.po
+  mapper-locations: classpath:mapper/*.xml

+ 93 - 1
applications/device/device-server/src/main/resources/mapper/DeviceMapper.xml

@@ -9,10 +9,102 @@
         <result column="deviceUser" property="deviceUser" jdbcType="VARCHAR" />
         <result column="devicePassword" property="devicePassword" jdbcType="VARCHAR"/>
     </resultMap>
-    <select id="findAll" resultType="com.usoftchina.smartschool.device.po.Device">
+    <select id="findAll" resultMap="deviceInfoMap">
         select * from device
     </select>
 
+    <resultMap id="deviceInfoMap" type="com.usoftchina.smartschool.device.dto.DeviceInfo">
+        <result column="deviceIp" property="ip" jdbcType="VARCHAR" />
+        <result column="devicePort" property="port" jdbcType="INTEGER" />
+        <result column="deviceUser" property="username" jdbcType="VARCHAR" />
+        <result column="devicePassword" property="password" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <select id="selectByConditon" resultType="com.usoftchina.smartschool.device.po.Device">
+        select * from device
+        <where>
+            <if test="con != null">
+                ${con}
+            </if>
+        </where>
+        ORDER BY deviceId DESC
+    </select>
+
+
+    <insert id="insertSelective" parameterType="com.usoftchina.smartschool.device.po.Device" >
+        <selectKey  resultType="java.lang.Long" keyProperty="deviceId">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
+        insert into device
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="deviceUser != null" >
+                deviceUser,
+            </if>
+            <if test="devicePassword != null" >
+                devicePassword,
+            </if>
+            <if test="deviceIp != null" >
+                deviceIp,
+            </if>
+            <if test="devicePort != null" >
+                devicePort,
+            </if>
+            <if test="deviceRemark != null" >
+                deviceRemark,
+            </if>
+            <if test="deviceName != null" >
+                deviceName,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="deviceUser != null" >
+                #{deviceUser,jdbcType=VARCHAR},
+            </if>
+            <if test="devicePassword != null" >
+                #{devicePassword,jdbcType=VARCHAR},
+            </if>
+            <if test="deviceIp != null" >
+                #{deviceIp,jdbcType=VARCHAR},
+            </if>
+            <if test="devicePort != null" >
+                #{devicePort,jdbcType=INTEGER},
+            </if>
+            <if test="deviceRemark != null" >
+                #{deviceRemark,jdbcType=VARCHAR},
+            </if>
+            <if test="deviceName != null" >
+                #{deviceName,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.device.po.Device" >
+        update device
+    <set >
+        <if test="deviceUser != null" >
+            deviceUser = #{deviceUser,jdbcType=VARCHAR},
+        </if>
+        <if test="devicePort != null" >
+            devicePort = #{devicePort,jdbcType=INTEGER},
+        </if>
+        <if test="devicePassword != null" >
+            devicePassword = #{devicePassword,jdbcType=VARCHAR},
+        </if>
+        <if ktest="deviceIp != null" >
+            deviceIp = #{deviceIp,jdbcType=VARCHAR},
+        </if>
+        <if test="deviceRemark != null" >k
+            deviceRemark = #{deviceRemark,jdbcType=VARCHAR},
+        </if>
+        <if test="deviceName != null" >
+            deviceName = #{deviceName,jdbcType=VARCHAR},
+        </if>
+    </set>
+        where deviceId = #{deviceId,jdbcType=BIGINT}
+    </update>
 
+    <delete id="deleteByPrimaryKey" parameterType="long">
+        delete from device where deviceId = #{id}
+    </delete>
 
 </mapper>

+ 14 - 0
applications/school/school-api/pom.xml

@@ -12,4 +12,18 @@
     <artifactId>school-api</artifactId>
 
 
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.smartschool</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.smartschool</groupId>
+            <artifactId>school-dto</artifactId>
+        </dependency>
+    </dependencies>
 </project>

+ 14 - 0
applications/school/school-api/src/main/java/com/usoftchina/smartschool/school/api/SchoolApi.java

@@ -0,0 +1,14 @@
+package com.usoftchina.smartschool.school.api;
+
+import com.usoftchina.smartschool.base.Result;
+import com.usoftchina.smartschool.school.dto.SysSchoolDTO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient("school-server")
+public interface SchoolApi {
+
+    @GetMapping("/find")
+    public Result<SysSchoolDTO> find(@RequestParam("schoolName") String schoolName);
+}

+ 110 - 0
applications/school/school-dto/src/main/java/com/usoftchina/smartschool/school/dto/SysSchoolDTO.java

@@ -0,0 +1,110 @@
+package com.usoftchina.smartschool.school.dto;
+
+import java.io.Serializable;
+
+/**
+ * @author: guq
+ * @create: 2019-03-09 16:08
+ **/
+public class SysSchoolDTO implements Serializable{
+    private Long school_id;
+
+    private String school_name;
+
+    private Integer school_status;
+
+    private String school_remarks;
+
+    private String school_address;
+
+    private String school_phone;
+
+    private String school_appid;
+
+    private String school_secret;
+
+    private String school_accesssecret;
+
+
+    public String getSchool_accesssecret() {
+        return school_accesssecret;
+    }
+
+    public void setSchool_accesssecret(String school_accesssecret) {
+        this.school_accesssecret = school_accesssecret;
+    }
+
+    private Boolean leaf = false;
+
+    public Boolean getLeaf() {
+        return leaf;
+    }
+
+    public void setLeaf(Boolean leaf) {
+        this.leaf = leaf;
+    }
+
+    public Long getSchool_id() {
+        return school_id;
+    }
+
+    public void setSchool_id(Long school_id) {
+        this.school_id = school_id;
+    }
+
+    public String getSchool_name() {
+        return school_name;
+    }
+
+    public void setSchool_name(String school_name) {
+        this.school_name = school_name == null ? null : school_name.trim();
+    }
+
+    public Integer getSchool_status() {
+        return school_status;
+    }
+
+    public void setSchool_status(Integer school_status) {
+        this.school_status = school_status;
+    }
+
+    public String getSchool_remarks() {
+        return school_remarks;
+    }
+
+    public void setSchool_remarks(String school_remarks) {
+        this.school_remarks = school_remarks == null ? null : school_remarks.trim();
+    }
+
+    public String getSchool_address() {
+        return school_address;
+    }
+
+    public void setSchool_address(String school_address) {
+        this.school_address = school_address == null ? null : school_address.trim();
+    }
+
+    public String getSchool_phone() {
+        return school_phone;
+    }
+
+    public void setSchool_phone(String school_phone) {
+        this.school_phone = school_phone == null ? null : school_phone.trim();
+    }
+
+    public String getSchool_appid() {
+        return school_appid;
+    }
+
+    public void setSchool_appid(String school_appid) {
+        this.school_appid = school_appid == null ? null : school_appid.trim();
+    }
+
+    public String getSchool_secret() {
+        return school_secret;
+    }
+
+    public void setSchool_secret(String school_secret) {
+        this.school_secret = school_secret == null ? null : school_secret.trim();
+    }
+}

+ 9 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/controller/SchoolController.java

@@ -2,7 +2,9 @@ package com.usoftchina.smartschool.school.basic.controller;
 
 import com.usoftchina.smartschool.base.Result;
 import com.usoftchina.smartschool.school.basic.service.SchoolService;
+import com.usoftchina.smartschool.school.dto.SysSchoolDTO;
 import com.usoftchina.smartschool.school.po.SysSchool;
+import com.usoftchina.smartschool.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -24,6 +26,13 @@ public class SchoolController {
         return Result.success(school);
     }
 
+    @GetMapping("/find")
+    public Result find(@RequestParam("schoolName") String schoolName) {
+        SysSchool school = schoolService.find(schoolName);
+        SysSchoolDTO schoolDTO = BeanMapper.map(school, SysSchoolDTO.class);
+        return Result.success(schoolDTO);
+    }
+
     @PostMapping("/save")
     public Result saveFormData(@RequestBody SysSchool school) {
         schoolService.saveFormData(school);

+ 2 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/SchoolService.java

@@ -10,4 +10,6 @@ public interface SchoolService {
     SysSchool getFormData(Long id);
 
     void saveFormData(SysSchool school);
+
+    SysSchool find(String schoolName);
 }

+ 9 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/SchoolServiceImpl.java

@@ -37,4 +37,13 @@ public class SchoolServiceImpl implements SchoolService {
         }
         sysSchoolMapper.updateByPrimaryKeySelective(school);
     }
+
+    @Override
+    public SysSchool find(String schoolName) {
+        if (StringUtils.isEmpty(schoolName)) {
+            throw new BizException(BizExceptionCode.USELESS_DATA);
+        }
+        SysSchool school = sysSchoolMapper.selectByName(schoolName);
+        return school;
+    }
 }

+ 2 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysSchoolMapper.java

@@ -16,4 +16,6 @@ public interface SysSchoolMapper {
     int updateByPrimaryKeySelective(SysSchool record);
 
     int updateByPrimaryKey(SysSchool record);
+
+    SysSchool selectByName(String schoolName);
 }

+ 10 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysSchool.java

@@ -25,10 +25,20 @@ public class SysSchool implements Serializable{
 
     private String school_secret;
 
+    private String school_accesssecret;
+
     private List<SysGrade> children;
 
     private Boolean leaf = false;
 
+    public String getSchool_accesssecret() {
+        return school_accesssecret;
+    }
+
+    public void setSchool_accesssecret(String school_accesssecret) {
+        this.school_accesssecret = school_accesssecret;
+    }
+
     public Boolean getLeaf() {
         return leaf;
     }

+ 5 - 0
applications/school/school-server/src/main/resources/mapper/SysSchoolMapper.xml

@@ -10,6 +10,7 @@
     <result column="school_phone" property="school_phone" jdbcType="VARCHAR" />
     <result column="school_appid" property="school_appid" jdbcType="VARCHAR" />
     <result column="school_secret" property="school_secret" jdbcType="VARCHAR" />
+    <result column="school_accesssecret" property="school_accesssecret" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     school_id, school_name, school_status, school_remarks, school_address, school_phone, 
@@ -126,4 +127,8 @@
       school_secret = #{school_secret,jdbcType=VARCHAR}
     where school_id = #{school_id,jdbcType=BIGINT}
   </update>
+
+  <select id="selectByName" parameterType="string" resultMap="BaseResultMap">
+    select * from sys_school where school_name = #{schoolName}
+  </select>
 </mapper>

+ 5 - 0
applications/wechat/wechat-auth/pom.xml

@@ -33,6 +33,11 @@
             <groupId>io.github.openfeign</groupId>
             <artifactId>feign-core</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.smartschool</groupId>
+            <artifactId>school-api</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 
 

+ 0 - 15
applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/EnableApiAuthClient.java

@@ -1,15 +0,0 @@
-package com.usoftchina.smartschool.wechat.auth;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @author: guq
- * @create: 2019-03-08 09:10
- **/
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface EnableOpenApiAuthClient {
-}

+ 18 - 0
applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/EnableOpenApiAuthClient.java

@@ -0,0 +1,18 @@
+package com.usoftchina.smartschool.wechat.auth;
+
+import com.usoftchina.smartschool.wechat.auth.configuration.OpenApiConfiguration;
+import org.springframework.context.annotation.Import;
+
+import java.lang.annotation.*;
+
+/**
+ * @author: guq
+ * @create: 2019-03-08 09:10
+ **/
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Import(OpenApiConfiguration.class)
+@Documented
+@Inherited
+public @interface EnableOpenApiAuthClient{
+}

+ 1 - 1
applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/configuration/OpenApiConfig.java

@@ -10,7 +10,7 @@ public class OpenApiConfig {
     private String signatureParam;
     @Value("${openapi.timestampParam:_timestamp}")
     private String timestampParam;
-    @Value("${openaip.school:access_id}")
+    @Value("${openaip.school:school}")
     private String school;
     @Value("${openapi.timeout:60000}")
     private int timeout;

+ 19 - 1
applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/configuration/OpenApiConfiguration.java

@@ -1,13 +1,31 @@
 package com.usoftchina.smartschool.wechat.auth.configuration;
 
+import com.usoftchina.smartschool.wechat.auth.interceptor.OpenApiAuthInterceptor;
+import io.netty.resolver.AddressResolver;
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 /**
  * @author: guq
  * @create: 2019-03-08 15:52
  **/
 @Configuration
-public class OpenApiConfiguration {
+public class OpenApiConfiguration implements WebMvcConfigurer {
 
+    @Bean
+    public OpenApiConfig openApiConfig() {
+        return new OpenApiConfig();
+    }
 
+    @Bean
+    public OpenApiAuthInterceptor openApiAuthInterceptor() {
+        return new OpenApiAuthInterceptor();
+    }
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(openApiAuthInterceptor());
+    }
 }

+ 13 - 10
applications/wechat/wechat-auth/src/main/java/com/usoftchina/smartschool/wechat/auth/interceptor/OpenApiAuthInterceptor.java

@@ -1,6 +1,10 @@
 package com.usoftchina.smartschool.wechat.auth.interceptor;
 
 
+import com.usoftchina.smartschool.base.Result;
+import com.usoftchina.smartschool.school.api.SchoolApi;
+import com.usoftchina.smartschool.school.dto.SysSchoolDTO;
+import com.usoftchina.smartschool.utils.http.HmacUtils;
 import com.usoftchina.smartschool.wechat.auth.annotation.IgnoreOpenApiAuth;
 import com.usoftchina.smartschool.wechat.auth.configuration.OpenApiConfig;
 import org.slf4j.Logger;
@@ -8,6 +12,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.util.StringUtils;
 import org.springframework.web.method.HandlerMethod;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 
@@ -26,7 +31,7 @@ public class OpenApiAuthInterceptor extends HandlerInterceptorAdapter{
     private OpenApiConfig openApiConfig;
 
     @Autowired
-    private CompanyApi companyApi;
+    private SchoolApi schoolApi;
 
     // 已使用签名
     private Map<String, Long> signatureCache = new ConcurrentHashMap<>();
@@ -47,8 +52,8 @@ public class OpenApiAuthInterceptor extends HandlerInterceptorAdapter{
             }
 
             String sign = request.getParameter(openApiConfig.getSignatureParam());
-            String companyuu = request.getParameter(openApiConfig.getSchool());
-            if (!StringUtils.isEmpty(sign) && !StringUtils.isEmpty(companyuu)) {
+            String schoolName = request.getParameter(openApiConfig.getSchool());
+            if (!StringUtils.isEmpty(sign) && !StringUtils.isEmpty(schoolName)) {
                 String urlMessage = request.getRequestURI() + "?"
                         + request.getQueryString().substring(0, request.getQueryString().indexOf(openApiConfig.getSignatureParam()) - 1);
 
@@ -58,14 +63,12 @@ public class OpenApiAuthInterceptor extends HandlerInterceptorAdapter{
 
                 boolean check = false;
                 //获取密钥
-                Result<CompanyDTO> companyResult = companyApi.getCompanyByUu(Long.valueOf(companyuu));
-                if (companyResult.isSuccess()) {
+                Result<SysSchoolDTO> result = schoolApi.find(schoolName);
+                if (result.isSuccess()) {
                     String localSign = null;
-
-                    TransfersContextHodler.setB2bCompanyId(companyResult.getData().getId());
-
-                    localSign = companyResult.getData().getAccessKey() == null ? HmacUtils.encode(urlMessage) :
-                                HmacUtils.encode(urlMessage, companyResult.getData().getAccessKey());
+                    //TransfersContextHodler.setB2bCompanyId(companyResult.getData().getId());
+                    localSign = result.getData().getSchool_accesssecret() == null ? HmacUtils.encode(urlMessage) :
+                                HmacUtils.encode(urlMessage, result.getData().getSchool_accesssecret());
 
                     if (servletPath.indexOf("b2b") > -1) {
                         logger.info("自己生产的sign:{}-----传入的sign:{}", localSign, sign);

+ 4 - 1
applications/wechat/wechat-server/pom.xml

@@ -90,7 +90,10 @@
         <dependency>
             <groupId>com.usoftchina.smartschool</groupId>
             <artifactId>wechat-dto</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.smartschool</groupId>
+            <artifactId>wechat-auth</artifactId>
         </dependency>
     </dependencies>
 

+ 3 - 9
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/WechatApplication.java

@@ -1,19 +1,12 @@
 package com.usoftchina.smartschool.wechat;
 
 
-import org.mybatis.spring.annotation.MapperScan;
+import com.usoftchina.smartschool.wechat.auth.EnableOpenApiAuthClient;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.web.servlet.ServletComponentScan;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
-import org.springframework.web.client.RestTemplate;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
 /**
  * @author: guq
@@ -22,7 +15,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 @SpringBootApplication
 @EnableTransactionManagement
 @EnableEurekaClient
-@EnableFeignClients("com.usoftchina.smartschool.wechat")
+@EnableFeignClients({"com.usoftchina.smartschool.wechat","com.usoftchina.smartschool.school"})
+@EnableOpenApiAuthClient
 public class WechatApplication {
     public static void main(String[] args) {
         SpringApplication.run(WechatApplication.class, args);

+ 52 - 52
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/config/RabbitConfig.java

@@ -1,73 +1,73 @@
 package com.usoftchina.smartschool.wechat.config;
 
 
-import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.amqp.core.*;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
 /**
  * @author: guq
  * @create: 2019-03-07 09:31
  **/
-@ConfigurationProperties(prefix = "rabbit.config")
+@Configuration
 public class RabbitConfig {
 
-    private String exchange;
-
-    private String dlexchange;
-
-    private String queue;
-
-    private String dlqueue;
-
-    private String routingkey;
 
-    private Long expired;
-
-    public String getExchange() {
-        return exchange;
-    }
-
-    public void setExchange(String exchange) {
-        this.exchange = exchange;
-    }
-
-    public String getDlexchange() {
-        return dlexchange;
-    }
-
-    public void setDlexchange(String dlexchange) {
-        this.dlexchange = dlexchange;
-    }
-
-    public String getQueue() {
-        return queue;
-    }
-
-    public void setQueue(String queue) {
-        this.queue = queue;
-    }
+    @Value("${school.rabbitmq.exchange}")
+    private String exchange;
 
-    public Long getExpired() {
-        return expired;
+    /**
+     * 消费队列
+     */
+    @Value("${school.rabbitmq.activeQueue}")
+    private String activeQueue;
+    /**
+     * 延迟队列
+     */
+    @Value("${school.rabbitmq.delayQueue}")
+    private String delayQueue;
+
+    /**
+     * 转发规则
+     */
+    @Value("${school.rabbitmq.activeKey}")
+    private String activeKey;
+
+    /**
+     * 延迟规则
+     */
+    @Value("${school.rabbitmq.delayKey}")
+    private String delayKey;
+
+    final static String DEAD_EXCHANGE_PARAM = "x-dead-letter-exchange";
+
+    final static String DEAD_KEY_PARAM = "x-dead-letter-routing-key";
+
+
+    @Bean
+    TopicExchange createExchange() {
+        return new TopicExchange(exchange);
     }
 
-    public void setExpired(Long expired) {
-        this.expired = expired;
+    @Bean
+    Queue createActiveQueue() {
+        return QueueBuilder.durable(activeQueue).build();
     }
 
-    public String getDlqueue() {
-
-        return dlqueue;
+    @Bean
+    Queue createDelayQueue() {
+        return QueueBuilder.durable(delayQueue).withArgument(DEAD_EXCHANGE_PARAM, exchange)
+                .withArgument(DEAD_KEY_PARAM, activeKey).build();
     }
 
-    public void setDlqueue(String dlqueue) {
-        this.dlqueue = dlqueue;
+    @Bean
+    Binding activeBind(Queue createActiveQueue, TopicExchange createExchange) {
+        return BindingBuilder.bind(createActiveQueue).to(createExchange).with(activeKey);
     }
 
-    public String getRoutingkey() {
-        return routingkey;
+    @Bean
+    Binding delayBind(Queue createDelayQueue, TopicExchange createExchange) {
+        return BindingBuilder.bind(createDelayQueue).to(createExchange).with(delayKey);
     }
-
-    public void setRoutingkey(String routingkey) {
-        this.routingkey = routingkey;
-    }
-
 }

+ 2 - 1
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/TransfersController.java

@@ -3,6 +3,7 @@ package com.usoftchina.smartschool.wechat.controller;
 
 import com.usoftchina.smartschool.base.Result;
 import com.usoftchina.smartschool.utils.JsonUtils;
+import com.usoftchina.smartschool.wechat.auth.annotation.IgnoreOpenApiAuth;
 import com.usoftchina.smartschool.wechat.dto.MessageInfoDTO;
 import com.usoftchina.smartschool.wechat.service.SendService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,7 +20,6 @@ import java.util.List;
  **/
 @RestController
 @RequestMapping("/send")
-//@IgnoreOpenApiAuth
 public class TransfersController {
 
     @Autowired
@@ -33,6 +33,7 @@ public class TransfersController {
     * @Date: 2019/3/7
     */
     @PostMapping("/Message")
+    @IgnoreOpenApiAuth
     public Result sendMsg(@RequestBody MessageInfoDTO info) {
         if (StringUtils.isEmpty(info)) {
             return Result.error("信息为空");

+ 2 - 0
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/WxPushController.java

@@ -1,5 +1,6 @@
 package com.usoftchina.smartschool.wechat.controller;
 
+import com.usoftchina.smartschool.wechat.auth.annotation.IgnoreOpenApiAuth;
 import com.usoftchina.smartschool.wechat.service.WxPushService;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
  * @create: 2019-01-27 12:41
  **/
 @RestController
+@IgnoreOpenApiAuth
 public class WxPushController {
 
     @Autowired

+ 3 - 3
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/ReceiveService.java

@@ -39,9 +39,9 @@ public class ReceiveService {
 
     private Logger logger = LoggerFactory.getLogger(ReceiveService.class);
 
-    private final static String DLEXCHANGE = "saas_trade_dev_dlexchange";
-    private final static String QUEUE = "saas_trade_dev_queue";
-    private final static String ROUTINGKEY = "saas_trade_dev_dl.*";
+    private final static String DLEXCHANGE = "school-exchange";
+    private final static String QUEUE = "school-active-queue";
+    private final static String ROUTINGKEY = "school-active-key.*";
 
 
     //配置监听的哪一个队列,同时在没有queue和exchange的情况下会去创建并建立绑定关系

+ 28 - 20
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/SendService.java

@@ -33,20 +33,37 @@ import java.util.UUID;
  * @create: 2019-01-06 22:04
  **/
 @Service
-@EnableConfigurationProperties(RabbitConfig.class)
 public class SendService {
 
     @Autowired
     private RabbitTemplate rabbitTemplate;
 
-    @Autowired
-    private RabbitConfig rabbitConfig;
-
     @Autowired
     private BrokerMessageLogMapper brokerMessageLogMapper;
 
-   /* @Value("${smartschool.rabbitmq.retry:1000}")
-    private int retry;*/
+    @Value("${school.rabbitmq.exchange}")
+    private String exchange;
+
+    /**
+     * 延迟时间
+     */
+    @Value("${school.rabbitmq.delayTime}")
+    private Long delayTime;
+
+    /**
+     * 转发规则
+     */
+    @Value("${school.rabbitmq.activeKey}")
+    private String activeKey;
+
+    /**
+     * 延迟规则
+     */
+    @Value("${school.rabbitmq.delayKey}")
+    private String delayKey;
+
+    @Value("${school.rabbitmq.retry}")
+    private int retry;
 
     private Logger logger = LoggerFactory.getLogger(getClass());
 
@@ -67,7 +84,7 @@ public class SendService {
         rabbitTemplate.setConfirmCallback(confirmCallback);
         //消息唯一ID
         CorrelationData correlationData = new CorrelationData(messageId);
-        rabbitTemplate.convertAndSend(rabbitConfig.getDlexchange(), rabbitConfig.getRoutingkey(), msgPackage, correlationData);
+        rabbitTemplate.convertAndSend(exchange, activeKey, msgPackage, correlationData);
         logger.info("msgId={}, 消息发送", messageId);
     }
 
@@ -92,15 +109,15 @@ public class SendService {
         String messageId = info.getPackageId();
         int count = info.getRetry();
         //循环次数大于设置值
-        if (count > 12) {
+        if (count > retry) {
             saveErrorMessage(info);
         } else {
         //未到设置值,继续投放发送至延迟队列
         rabbitTemplate.setConfirmCallback(confirmCallback);
         //消息唯一ID
         CorrelationData correlationData = new CorrelationData(info.getPackageId());
-        rabbitTemplate.convertAndSend(rabbitConfig.getExchange(), rabbitConfig.getRoutingkey(), info,
-                new ExpirationMessagePostProcessor(rabbitConfig.getExpired()), correlationData);
+        rabbitTemplate.convertAndSend(exchange, delayKey, info,
+                new ExpirationMessagePostProcessor(delayTime), correlationData);
         }
     }
 
@@ -114,7 +131,7 @@ public class SendService {
         rabbitTemplate.setConfirmCallback(confirmCallback);
         //消息唯一ID
         CorrelationData correlationData = new CorrelationData(messageId);
-        rabbitTemplate.convertAndSend(rabbitConfig.getDlexchange(), rabbitConfig.getRoutingkey(), msgPackage, correlationData);
+        rabbitTemplate.convertAndSend(exchange, activeKey, msgPackage, correlationData);
         logger.info("msgId={}, 消息发送", messageId);
     }
 
@@ -128,13 +145,4 @@ public class SendService {
         messagelog.setStatus(Status.FAILURE.getDisplay());
         brokerMessageLogMapper.insertSelective(messagelog);
     }
-
- /*   private void updateErrorMessage(MessagePackage info, String error) {
-        //更新状态且失败次数加1
-        BrokerMessagelog messagelog = new BrokerMessagelog();
-        messagelog.setMsgId(info.getPackageId());
-        messagelog.setStatus(Status.RETRY.getDisplay());
-        messagelog.setReason(error);
-        brokerMessageLogMapper.updateMessageLogandAddRetry(messagelog);
-    }*/
 }

+ 10 - 9
applications/wechat/wechat-server/src/main/resources/application.yml

@@ -24,7 +24,7 @@ spring:
   rabbitmq:
     host: 10.10.100.103
     port: 5672
-    virtual-host: docker
+    virtual-host: school
     username: saas
     password: select123***
     publisher-returns: true
@@ -92,11 +92,12 @@ hystrix:
               isolation:
                     thread:
                         timeoutInMilliseconds: 4000
-rabbit:
-  config:
-    exchange: saas_trade_dev_exchange
-    dlexchange: saas_trade_dev_dlexchange
-    queue: saas_trade_dev_queue
-    dlqueue: saas_trade_dev_dlqueue
-    routingkey: saas_trade_dev_dl.*
-    expired: 60000
+school:
+  rabbitmq:
+    exchange: school-exchange
+    activeQueue: school-active-queue
+    delayQueue: school-delay-queue
+    activeKey: school-active-key.*
+    delayKey: school-delay-key.*
+    delayTime: 20000
+    retry: 2

+ 6 - 0
base-servers/gateway-server/src/main/resources/application.yml

@@ -62,6 +62,12 @@ spring:
         - Path=/api/auth/**
         filters:
         - RewritePath=/api/auth/(?<segment>.*), /$\{segment}
+      - id: DEVICE-SERVER
+        uri: lb://DEVICE-SERVER
+        predicates:
+        - Path=/api/device/**
+        filters:
+        - RewritePath=/api/device/(?<segment>.*), /$\{segment}
   redis:
     host: 10.10.100.166
     port: 6379

+ 0 - 131
base-servers/gateway-server/src/main/resources/logback-spring.xml

@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-    <include resource="org/springframework/boot/logging/logback/base.xml" />
-    <jmxConfigurator/>
-
-    <!--
-    %m
-    输出代码中指定的消息
-    %p
-    输出优先级,即DEBUG,INFO,WARN,ERROR,FATAL
-    %r
-    输出自应用启动到输出该log信息耗费的毫秒数
-    %c
-    输出所属的类目,通常就是所在类的全名
-    %t
-    输出产生该日志事件的线程名
-    %n
-    输出一个回车换行符,Windows平台为“\r\n”,Unix平台为“\n”
-    %d
-    输出日志时间点的日期或时间,默认格式为ISO8601,也可以在其后指定格式,比如:%d{yyy MMM dd HH:mm:ss,SSS},
-    输出类似:2002年10月18日 22:10:28,921
-    %l
-    输出日志事件的发生位置,包括类目名、发生的线程,以及在代码中的行数。举例:Testlog4.main(TestLog4.java:10)
-    -->
-
-    <springProperty scope="context" name="log.path" source="logging.path" defaultValue="/var/log/saas/gateway-server"/>
-    <springProperty scope="context" name="spring.application.name" source="spring.application.name" defaultValue="gateway-server"/>
-    <springProperty scope="context" name="spring.profiles.active" source="spring.profiles.active" defaultValue="dev"/>
-    <springProperty scope="context" name="common-pattern" source="logging.common-pattern" defaultValue="%d{yyyy-MM-dd HH:mm:ss.SSS}:[%5p] [%t:%r] [%C{1}:%M:%L] --> %m%n"/>
-    <springProperty scope="context" name="log.level.console" source="logging.level.console" defaultValue="INFO"/>
-    <springProperty scope="context" name="log.destination" source="logging.destination" defaultValue="10.1.81.1:5000"/>
-
-    <contextName>${spring.application.name}-${spring.profiles.active}-logback</contextName>
-
-    <appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>${log.level.console}</level>
-        </filter>
-        <encoder>
-            <pattern>${common-pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <appender name="ROOT_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.path}/root.log</file>
-        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/%d{yyyy-MM}/root-%d{yyyy-MM-dd}-%i.log.gz</fileNamePattern>
-            <maxFileSize>128MB</maxFileSize>
-            <maxHistory>7</maxHistory>
-            <totalSizeCap>20GB</totalSizeCap>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${common-pattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- Appender to log in a JSON format -->
-    <appender name="JSON_APPENDER" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
-        <destination>${log.destination}</destination>
-        <encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
-            <providers>
-                <pattern>
-                    <pattern>
-                        {
-                        "severity": "%level",
-                        "service": "${spring.application.name:-}",
-                        "trace": "%X{X-B3-TraceId:-}",
-                        "span": "%X{X-B3-SpanId:-}",
-                        "parent": "%X{X-B3-ParentSpanId:-}",
-                        "exportable": "%X{X-Span-Export:-}",
-                        "pid": "${PID:-}",
-                        "thread": "%thread",
-                        "class": "%logger{40}",
-                        "rest": "%message"
-                        }
-                    </pattern>
-                </pattern>
-            </providers>
-        </encoder>
-    </appender>
-
-    <logger name="org.springframework" level="INFO"/>
-    <logger name="com.usoftchina.saas" level="INFO"/>
-
-    <springProfile name="dev">
-        <root level="INFO">
-            <appender-ref ref="CONSOLE_APPENDER"/>
-        </root>
-    </springProfile>
-
-    <springProfile name="test">
-        <root level="INFO">
-            <appender-ref ref="CONSOLE_APPENDER"/>
-            <appender-ref ref="ROOT_APPENDER"/>
-        </root>
-    </springProfile>
-
-    <springProfile name="docker">
-        <logger name="org.springframework" level="WARN"/>
-        <logger name="com.usoftchina.saas" level="WARN"/>
-        <root level="WARN">
-            <appender-ref ref="CONSOLE_APPENDER"/>
-            <appender-ref ref="JSON_APPENDER"/>
-        </root>
-    </springProfile>
-
-    <springProfile name="docker-dev">
-        <root level="INFO">
-            <appender-ref ref="CONSOLE_APPENDER"/>
-        </root>
-    </springProfile>
-
-    <springProfile name="docker-test">
-        <logger name="org.springframework" level="WARN"/>
-        <logger name="com.usoftchina.saas" level="WARN"/>
-        <root level="WARN">
-            <appender-ref ref="CONSOLE_APPENDER"/>
-            <appender-ref ref="JSON_APPENDER"/>
-        </root>
-    </springProfile>
-
-    <springProfile name="docker-prod">
-        <logger name="org.springframework" level="WARN"/>
-        <logger name="com.usoftchina.saas" level="WARN"/>
-        <root level="WARN">
-            <appender-ref ref="CONSOLE_APPENDER"/>
-            <appender-ref ref="JSON_APPENDER"/>
-        </root>
-    </springProfile>
-
-</configuration>

+ 16 - 1
pom.xml

@@ -230,7 +230,12 @@
             </dependency>
             <dependency>
                 <groupId>com.usoftchina.smartschool</groupId>
-                <artifactId> school-dto</artifactId>
+                <artifactId>school-dto</artifactId>
+                <version>${project.release.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.usoftchina.smartschool</groupId>
+                <artifactId>school-api</artifactId>
                 <version>${project.release.version}</version>
             </dependency>
             <dependency>
@@ -238,6 +243,16 @@
                 <artifactId>wechat-api</artifactId>
                 <version>${project.release.version}</version>
             </dependency>
+            <dependency>
+                <groupId>com.usoftchina.smartschool</groupId>
+                <artifactId>wechat-dto</artifactId>
+                <version>${project.release.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.usoftchina.smartschool</groupId>
+                <artifactId>wechat-auth</artifactId>
+                <version>${project.release.version}</version>
+            </dependency>
             <dependency>
                 <groupId>com.usoftchina.smartschool</groupId>
                 <artifactId>wechat-server</artifactId>