Browse Source

添加后门方法

dev_shibei_match
jianjun 5 years ago
parent
commit
0b66202320
  1. 29
      epmet-auth/src/main/java/com/epmet/controller/BackDoorController.java
  2. 11
      epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java

29
epmet-auth/src/main/java/com/epmet/controller/BackDoorController.java

@ -0,0 +1,29 @@
package com.epmet.controller;
import com.epmet.redis.CustomerAppWxServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Set;
/**
* @author jianjun liu
* @date 2020-06-04 20:39
**/
@RestController
@RequestMapping("opback")
public class BackDoorController {
@Autowired
private CustomerAppWxServiceUtil customerAppWxServiceUtil;
/**
* 数据库添加新客户app后
*
* @return
*/
@RequestMapping("reloadcustomerapp")
public Set<String> initWxMaService() {
return customerAppWxServiceUtil.initWxMaService();
}
}

11
epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java

@ -65,6 +65,10 @@ public class CustomerAppWxServiceUtil implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) {
initWxMaService();
}
public Set<String> initWxMaService() {
Map<String, WxMaService> maServicesNew = Maps.newConcurrentMap();
SetOperations appSet = null;
List<CustomerAppDTO> result = null;
@ -91,7 +95,7 @@ public class CustomerAppWxServiceUtil implements ApplicationRunner {
logger.info("wxMaService operCrmOpenFeignClient.getConfigAllApp result:{}", JSON.toJSONString(configAllAppResult));
if (configAllAppResult == null || !configAllAppResult.success()) {
logger.info("wxMaService operCrmOpenFeignClient.getConfigAllApp fail");
return;
return maServicesNew.keySet();
}
result = configAllAppResult.getData();
result.forEach(app -> {
@ -110,8 +114,11 @@ public class CustomerAppWxServiceUtil implements ApplicationRunner {
if (maServicesNew.size() > 0) {
maServices = maServicesNew;
if (appSet != null && result != null) {
appSet.add(appKey, result);
for (CustomerAppDTO app : result) {
appSet.add(appKey, app);
}
}
}
return maServicesNew.keySet();
}
}

Loading…
Cancel
Save