diff --git a/shapelight-admin/src/main/java/net/shapelight/common/config/GlobalValue.java b/shapelight-admin/src/main/java/net/shapelight/common/config/GlobalValue.java index 0a7e8f0..43fe6ea 100644 --- a/shapelight-admin/src/main/java/net/shapelight/common/config/GlobalValue.java +++ b/shapelight-admin/src/main/java/net/shapelight/common/config/GlobalValue.java @@ -92,6 +92,8 @@ public class GlobalValue { private String wxAppid; @Value("${global.wx.secret}") private String wxSecret; + @Value("${global.wx.url}") + private String wxUrl; @Value("${global.app.key}") private String appKey; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/app/controller/AppApiController.java b/shapelight-admin/src/main/java/net/shapelight/modules/app/controller/AppApiController.java index 0c22742..05bbddb 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/app/controller/AppApiController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/app/controller/AppApiController.java @@ -3,7 +3,6 @@ package net.shapelight.modules.app.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.minio.MinioClient; @@ -20,7 +19,6 @@ import net.shapelight.modules.app.entity.AppUserScopeEntity; import net.shapelight.modules.app.service.AppUserScopeService; import net.shapelight.modules.app.service.AppUserService; //import net.shapelight.modules.dev.mqtt.CmdProcess; -import net.shapelight.modules.job.entity.KeysEntity; import net.shapelight.modules.nettyapi.service.ServerApiService; import net.shapelight.modules.sys.entity.*; import net.shapelight.modules.sys.service.*; @@ -28,8 +26,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import net.shapelight.modules.ten.entity.*; import net.shapelight.modules.ten.service.*; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; -import net.shapelight.modules.vo.TenCelldeptSelectVo; +import net.shapelight.modules.fegin.OpFeignClient; import net.shapelight.modules.vo.TenCelldeptWeVo; import net.shapelight.modules.vo.TenDeviceVo; import org.apache.commons.codec.digest.DigestUtils; @@ -96,7 +93,6 @@ public class AppApiController { private TenParentService tenParentService; @Autowired private TenRelationService relationService; - @Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient") @Autowired private OpFeignClient opFeignClient; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppParentApiController.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppParentApiController.java index 93e94ec..6887dac 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppParentApiController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppParentApiController.java @@ -21,7 +21,7 @@ import net.shapelight.modules.sys.service.SysDeviceAppService; import net.shapelight.modules.sys.service.SysUserService; import net.shapelight.modules.ten.entity.*; import net.shapelight.modules.ten.service.*; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; +import net.shapelight.modules.fegin.OpFeignClient; import net.shapelight.modules.vo.SchoolNameVo; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.FilenameUtils; @@ -83,7 +83,6 @@ public class AppParentApiController { private TenParentService tenParentService; @Autowired private TenRelationService relationService; - @Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient") @Autowired private OpFeignClient opFeignClient; @Autowired diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/DataSync.java b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/DataSync.java similarity index 94% rename from shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/DataSync.java rename to shapelight-admin/src/main/java/net/shapelight/modules/fegin/DataSync.java index b309ee2..c55dad2 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/DataSync.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/DataSync.java @@ -1,4 +1,4 @@ -package net.shapelight.modules.tripartitePlatform.operatorPlatform; +package net.shapelight.modules.fegin; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/fegin/OpFeignClient.java b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/OpFeignClient.java new file mode 100644 index 0000000..0d7cba8 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/OpFeignClient.java @@ -0,0 +1,80 @@ +package net.shapelight.modules.fegin; + +import com.alibaba.fastjson.JSONObject; +import net.shapelight.modules.fegin.config.OpFeignConfig; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.annotation.PostConstruct; +import java.util.Map; + +/* + * name 指定调用rest接口对应服务名 + * path 指定调用接口所在Controller的@RequestMapping对应路径,没有则不填 + * 青桔话务平台 + */ +@FeignClient(name = "operator-service", url = "${global.wx.url}",configuration = OpFeignConfig.class) +@Component +public interface OpFeignClient { + + /** + * 获取密钥 1800s + * @return + */ + @PostConstruct + @PostMapping("/empower") + JSONObject empower(@RequestBody Map params); + + @PostMapping("/submitData") + JSONObject submitData(@RequestBody Map params); + + /* + 获取token + */ + @GetMapping("cgi-bin/token") + JSONObject getToken(@RequestParam Map params); + + /* + 创建设备组 + */ + @PostMapping("wxa/business/group/createid") + JSONObject createIotGroupId(@RequestBody Map params); + + /* + 删除设备组设备 + */ + @PostMapping("wxa/business/group/removedevice") + JSONObject removeIotGroupDevice(@RequestBody Map params); + + /* + 新增设备组设备 + */ + @PostMapping("wxa/business/group/adddevice") + JSONObject addIotGroupDevice(@RequestBody Map params); + + /* + 获取设备组信息 + */ + @PostMapping("wxa/business/group/getinfo") + JSONObject getIotGroupInfo(@RequestBody Map params); + + /* + 激活licence + */ + @PostMapping("wxa/business/license/activedevice") + JSONObject activeLicenseDevice(@RequestBody Map params); + + /* + 查询license资源包列表 + */ + @PostMapping("wxa/business/license/getdeviceinfo") + JSONObject getLicenseDeviceInfo(@RequestBody Map params); + + + + +} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/fegin/OpFeignInterceptor.java b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/OpFeignInterceptor.java new file mode 100644 index 0000000..f02714d --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/OpFeignInterceptor.java @@ -0,0 +1,21 @@ +package net.shapelight.modules.fegin; + +import feign.RequestInterceptor; +import feign.RequestTemplate; +import lombok.extern.slf4j.Slf4j; +import net.shapelight.common.utils.RedisUtils; +import net.shapelight.modules.job.entity.KeysEntity; +import org.springframework.beans.factory.annotation.Autowired; + +@Slf4j +public class OpFeignInterceptor implements RequestInterceptor { + @Autowired + RedisUtils redisUtils; + + @Override + public void apply(RequestTemplate requestTemplate) { + requestTemplate.header("access_token", redisUtils.get("wxToken").toString()); + //requestTemplate.header("empowerText", KeysEntity.empowerText); + log.info("feign拦截器"); + } +} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/fegin/OpHystrix.java b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/OpHystrix.java new file mode 100644 index 0000000..552f761 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/OpHystrix.java @@ -0,0 +1,67 @@ +package net.shapelight.modules.fegin; + +import com.alibaba.fastjson.JSONObject; +import feign.hystrix.FallbackFactory; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +public class OpHystrix implements FallbackFactory { + + @Override + public OpFeignClient create(Throwable throwable) { + return new OpFeignClient() { + @Override + public JSONObject empower(Map params) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("errormsg","获取密钥失败"); + return jsonObject; + } + + @Override + public JSONObject submitData(Map params) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("errormsg",params.get("operation")+"失败"); + return jsonObject; + } + + @Override + public JSONObject getToken(Map params) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("errorMessage","token获取失败"); + return jsonObject; + } + + @Override + public JSONObject createIotGroupId(Map params) { + return null; + } + + @Override + public JSONObject removeIotGroupDevice(Map params) { + return null; + } + + @Override + public JSONObject addIotGroupDevice(Map params) { + return null; + } + + @Override + public JSONObject getIotGroupInfo(Map params) { + return null; + } + + @Override + public JSONObject activeLicenseDevice(Map params) { + return null; + } + + @Override + public JSONObject getLicenseDeviceInfo(Map params) { + return null; + } + }; + } +} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/config/OpFeignConfig.java b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/config/OpFeignConfig.java similarity index 77% rename from shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/config/OpFeignConfig.java rename to shapelight-admin/src/main/java/net/shapelight/modules/fegin/config/OpFeignConfig.java index ed534fb..f119fba 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/config/OpFeignConfig.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/fegin/config/OpFeignConfig.java @@ -1,8 +1,8 @@ -package net.shapelight.modules.tripartitePlatform.operatorPlatform.config; +package net.shapelight.modules.fegin.config; import feign.Logger; import feign.Request; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignInterceptor; +import net.shapelight.modules.fegin.OpFeignInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/job/entity/KeysEntity.java b/shapelight-admin/src/main/java/net/shapelight/modules/job/entity/KeysEntity.java new file mode 100644 index 0000000..ce073b7 --- /dev/null +++ b/shapelight-admin/src/main/java/net/shapelight/modules/job/entity/KeysEntity.java @@ -0,0 +1,10 @@ +package net.shapelight.modules.job.entity; + +import lombok.Data; + +@Data +public class KeysEntity { + public static String passKey; + + public static String empowerText; +} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/job/task/EmpowerTask.java b/shapelight-admin/src/main/java/net/shapelight/modules/job/task/EmpowerTask.java index ea89891..6db4138 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/job/task/EmpowerTask.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/job/task/EmpowerTask.java @@ -3,7 +3,7 @@ package net.shapelight.modules.job.task; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import net.shapelight.modules.job.entity.KeysEntity; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; +import net.shapelight.modules.fegin.OpFeignClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenBuildController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenBuildController.java index 6d3699c..35b1882 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenBuildController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenBuildController.java @@ -2,8 +2,6 @@ package net.shapelight.modules.ten.controller; import java.util.*; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -11,16 +9,14 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import net.shapelight.common.utils.Constant; import net.shapelight.common.utils.SnowflakeIdWorker; -import net.shapelight.modules.job.entity.KeysEntity; import net.shapelight.modules.sys.controller.AbstractController; import net.shapelight.modules.sys.entity.SysUserEntity; import net.shapelight.modules.sys.service.SysUserRoleService; -import net.shapelight.modules.ten.entity.TenCellEntity; import net.shapelight.modules.ten.entity.TenUserScopeEntity; import net.shapelight.modules.ten.service.TenCellService; import net.shapelight.modules.ten.service.TenPersonService; import net.shapelight.modules.ten.service.TenUserScopeService; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; +import net.shapelight.modules.fegin.OpFeignClient; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -55,7 +51,6 @@ public class TenBuildController extends AbstractController { private TenPersonService tenPersonService; @Value("${global.qingju.accountNumber}") private String accountNumber; - @Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient") @Autowired private OpFeignClient opFeignClient; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenParentController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenParentController.java index 59d5af3..3d0d5b1 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenParentController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenParentController.java @@ -1,7 +1,6 @@ package net.shapelight.modules.ten.controller; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -11,16 +10,14 @@ import net.shapelight.common.config.GlobalValue; import net.shapelight.common.utils.PageUtils; import net.shapelight.common.utils.R; import net.shapelight.modules.app.entity.AppUserEntity; -import net.shapelight.modules.app.entity.AppUserScopeEntity; import net.shapelight.modules.app.service.impl.AppUserScopeServiceImpl; import net.shapelight.modules.app.service.impl.AppUserServiceImpl; -import net.shapelight.modules.job.entity.KeysEntity; import net.shapelight.modules.sys.controller.AbstractController; import net.shapelight.modules.ten.entity.TenParent; import net.shapelight.modules.ten.entity.TenRelation; import net.shapelight.modules.ten.service.TenParentService; import net.shapelight.modules.ten.service.TenRelationService; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; +import net.shapelight.modules.fegin.OpFeignClient; import net.shapelight.modules.vo.ParentVo; import org.apache.commons.codec.digest.DigestUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -28,11 +25,8 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; @RestController @RequestMapping("ten/parent") @@ -49,7 +43,6 @@ public class TenParentController extends AbstractController { private TenRelationService relationService; @Autowired private GlobalValue globalValue; - @Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient") @Autowired private OpFeignClient opFeignClient; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java index 99ce537..ce4bbb3 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenPersonController.java @@ -6,9 +6,6 @@ import java.util.*; import java.util.stream.Collectors; import java.util.zip.ZipOutputStream; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.minio.MinioClient; @@ -22,7 +19,6 @@ import net.shapelight.common.config.GlobalValue; import net.shapelight.common.config.MinioConfig; import net.shapelight.common.utils.*; import net.shapelight.commons.engine.sdk.PalmSDK; -import net.shapelight.commons.engine.sdk.PicSDK; import net.shapelight.commons.engine.sdk.SdkImageUtils; import net.shapelight.commons.engine.sdk.palm.FaceFeatureBase; import net.shapelight.commons.engine.sdk.palm.OutArg; @@ -31,20 +27,17 @@ import net.shapelight.modules.app.entity.AppUserScopeEntity; import net.shapelight.modules.app.service.AppUserService; import net.shapelight.modules.app.service.impl.AppUserScopeServiceImpl; import net.shapelight.modules.excel.model.PersonModel; -import net.shapelight.modules.job.entity.KeysEntity; import net.shapelight.modules.nettyapi.service.ServerApiService; import net.shapelight.modules.sys.controller.AbstractController; -import net.shapelight.modules.sys.entity.SysDictEntity; import net.shapelight.modules.sys.entity.SysUserEntity; import net.shapelight.modules.sys.service.SysUserRoleService; import net.shapelight.modules.sys.service.SysUserService; import net.shapelight.modules.sys.service.impl.SysDictServiceImpl; import net.shapelight.modules.ten.entity.*; import net.shapelight.modules.ten.service.*; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; +import net.shapelight.modules.fegin.OpFeignClient; import net.shapelight.modules.vo.TenDeviceVo; import net.shapelight.modules.vo.TenPersonOperationVo; -import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -106,7 +99,6 @@ public class TenPersonController extends AbstractController { private String imagBaseUrl; @Value("${global.minio.bucketName}") private String bucketName; - @Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient") @Autowired private OpFeignClient opFeignClient; @Autowired diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenRelationController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenRelationController.java index 1f285f3..20eaaf6 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenRelationController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenRelationController.java @@ -1,13 +1,10 @@ package net.shapelight.modules.ten.controller; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import net.shapelight.common.config.GlobalValue; import net.shapelight.common.utils.Constant; import net.shapelight.common.utils.R; -import net.shapelight.modules.app.entity.AppUserEntity; import net.shapelight.modules.app.service.impl.AppUserServiceImpl; -import net.shapelight.modules.job.entity.KeysEntity; import net.shapelight.modules.sys.controller.AbstractController; import net.shapelight.modules.sys.entity.SysUserEntity; import net.shapelight.modules.sys.service.SysUserRoleService; @@ -16,7 +13,7 @@ import net.shapelight.modules.ten.entity.TenUserScopeEntity; import net.shapelight.modules.ten.service.TenParentService; import net.shapelight.modules.ten.service.TenRelationService; import net.shapelight.modules.ten.service.TenUserScopeService; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; +import net.shapelight.modules.fegin.OpFeignClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.*; @@ -39,7 +36,6 @@ public class TenRelationController extends AbstractController { private TenParentService parentService; @Autowired private AppUserServiceImpl appUserService; - @Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient") @Autowired private OpFeignClient opFeignClient; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenRoomController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenRoomController.java index 3936153..14cdce9 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenRoomController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenRoomController.java @@ -3,7 +3,6 @@ package net.shapelight.modules.ten.controller; import java.util.*; import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -11,14 +10,13 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import net.shapelight.common.config.GlobalValue; import net.shapelight.common.utils.*; -import net.shapelight.modules.job.entity.KeysEntity; import net.shapelight.modules.nettyapi.service.ServerApiService; import net.shapelight.modules.sys.controller.AbstractController; import net.shapelight.modules.sys.entity.SysUserEntity; import net.shapelight.modules.sys.service.SysUserRoleService; import net.shapelight.modules.ten.entity.*; import net.shapelight.modules.ten.service.*; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; +import net.shapelight.modules.fegin.OpFeignClient; import net.shapelight.modules.vo.TenPersonOperationVo; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -53,7 +51,6 @@ public class TenRoomController extends AbstractController { private TenPersonSyncService tenPersonSyncService; @Autowired private ServerApiService serverApiService; - @Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient") @Autowired private OpFeignClient opFeignClient; @Autowired diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java index 26dc681..11ffb36 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java @@ -32,7 +32,7 @@ import net.shapelight.modules.sys.service.impl.SysDictServiceImpl; import net.shapelight.modules.ten.dao.TenRelationMapper; import net.shapelight.modules.ten.entity.*; import net.shapelight.modules.ten.service.*; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; +import net.shapelight.modules.fegin.OpFeignClient; import net.shapelight.modules.vo.*; import org.apache.commons.codec.digest.DigestUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -95,7 +95,6 @@ public class TenPersonServiceImpl implements TenPersonService { private TenCellDeptService tenCellDeptService; @Autowired private TenRelationService relationService; - @Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient") @Autowired private OpFeignClient opFeignClient; @Autowired diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRoomServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRoomServiceImpl.java index 4149429..5727dae 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRoomServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRoomServiceImpl.java @@ -5,22 +5,18 @@ import net.shapelight.modules.ten.entity.TenAddressEntity; import net.shapelight.modules.ten.entity.TenBuildEntity; import net.shapelight.modules.ten.entity.TenCellEntity; import net.shapelight.modules.ten.service.*; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient; +import net.shapelight.modules.fegin.OpFeignClient; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import net.shapelight.common.utils.PageUtils; -import net.shapelight.common.utils.Query; import net.shapelight.modules.ten.dao.TenRoomDao; import net.shapelight.modules.ten.entity.TenRoomEntity; diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/OpFeignClient.java b/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/OpFeignClient.java deleted file mode 100644 index ea5fea9..0000000 --- a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/OpFeignClient.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.shapelight.modules.tripartitePlatform.operatorPlatform; - -import com.alibaba.fastjson.JSONObject; -import net.shapelight.modules.tripartitePlatform.operatorPlatform.config.OpFeignConfig; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import javax.annotation.PostConstruct; -import java.util.Map; - -/* - * name 指定调用rest接口对应服务名 - * path 指定调用接口所在Controller的@RequestMapping对应路径,没有则不填 - * 青桔话务平台 - */ -@FeignClient(name = "operator-service", url = "${global.qingju.url}",configuration = OpFeignConfig.class) -@Component -public interface OpFeignClient { - - /** - * 获取密钥 1800s - * @return - */ - @PostConstruct - @PostMapping("/empower") - JSONObject empower(@RequestBody Map params); - - @PostMapping("/submitData") - JSONObject submitData(@RequestBody Map params); - - -} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/OpFeignInterceptor.java b/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/OpFeignInterceptor.java deleted file mode 100644 index f414e98..0000000 --- a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/OpFeignInterceptor.java +++ /dev/null @@ -1,17 +0,0 @@ -package net.shapelight.modules.tripartitePlatform.operatorPlatform; - -import feign.RequestInterceptor; -import feign.RequestTemplate; -import lombok.extern.slf4j.Slf4j; -import net.shapelight.modules.job.entity.KeysEntity; - -@Slf4j -public class OpFeignInterceptor implements RequestInterceptor { - - @Override - public void apply(RequestTemplate requestTemplate) { - requestTemplate.header("passKey", KeysEntity.passKey); - requestTemplate.header("empowerText", KeysEntity.empowerText); - log.info("feign拦截器"); - } -} diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/OpHystrix.java b/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/OpHystrix.java deleted file mode 100644 index d0c7227..0000000 --- a/shapelight-admin/src/main/java/net/shapelight/modules/tripartitePlatform/operatorPlatform/OpHystrix.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.shapelight.modules.tripartitePlatform.operatorPlatform; - -import com.alibaba.fastjson.JSONObject; -import feign.hystrix.FallbackFactory; -import org.springframework.stereotype.Component; - -import java.util.Map; - -@Component -public class OpHystrix implements FallbackFactory { - - @Override - public OpFeignClient create(Throwable throwable) { - return new OpFeignClient() { - @Override - public JSONObject empower(Map params) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("errormsg","获取密钥失败"); - return jsonObject; - } - - @Override - public JSONObject submitData(Map params) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("errormsg",params.get("operation")+"失败"); - return jsonObject; - } - }; - } -} diff --git a/shapelight-admin/src/main/resources/application.yml b/shapelight-admin/src/main/resources/application.yml index 7738766..1d65e06 100644 --- a/shapelight-admin/src/main/resources/application.yml +++ b/shapelight-admin/src/main/resources/application.yml @@ -107,7 +107,8 @@ global: # bucketName: cell wx: appid: wx313273bb23519704 - secret: 30b523b2bdd7b0739b7f06e9dc1519f8 + secret: a9162ffebee8e9892418bb78d86d7a80 + url: https://api.weixin.qq.com/ tcp_server: port: 8086 app: