Commit 70503703 authored by luzhuang's avatar luzhuang

权限验证接口 参数类型变化Long-String

parent bb9d21d7
......@@ -28,7 +28,7 @@ public class MicroappFeignClientFallBack implements MicroappFeignClient {
}
@Override
public Ret<List<Long>> haveJurisdictionUserFast(HaveJurisdictionReqDTO haveJurisdictionReqDTO, String zxClientType, Long zxAccountId) {
public Ret<List<String>> haveJurisdictionUserFast(HaveJurisdictionReqDTO haveJurisdictionReqDTO, String zxClientType, Long zxAccountId) {
log.error("---------------调智信接口 /micro_app/haveJurisdictionUserFast(筛选有通知权限的人-优化) 失败-------------------");
......
......@@ -49,7 +49,7 @@ public interface MicroappFeignClient {
* @return
*/
@RequestMapping(value = "/micro_app/haveJurisdictionUserFast",method = RequestMethod.POST)
Ret<List<Long>> haveJurisdictionUserFast(@RequestBody HaveJurisdictionReqDTO haveJurisdictionReqDTO,
Ret<List<String>> haveJurisdictionUserFast(@RequestBody HaveJurisdictionReqDTO haveJurisdictionReqDTO,
@RequestParam("zxClientType") String zxClientType,
@RequestParam("zxAccountId") Long zxAccountId);
......
......@@ -13,15 +13,15 @@ import java.util.List;
public class HaveJurisdictionReqDTO {
@NotNull
private Long corpId;
private String corpId;
@NotNull
private List<Long> userIds;
private List<String> userIds;
@NotNull
private Long appId;
private String appId;
public HaveJurisdictionReqDTO(Long corpId,List<Long> userIds){
public HaveJurisdictionReqDTO(String corpId,List<String> userIds){
this.corpId = corpId;
this.userIds = userIds;
}
......
......@@ -13,6 +13,6 @@ public class MTUserGetsAccountReqDTO {
private String corpId;
private List<Long> userIds;
private List<String> userIds;
}
......@@ -27,28 +27,28 @@ public class MTMicroappApiRequestClient {
public static Long zxAccountId = (long)1;
@Value("${appId.noticeAppId}")
private Long appId;
private String appId;
@Autowired
private MicroappFeignClient microappFeignClient;
public boolean isHaveApps(long userId, long corpId) {
Ret ret = microappFeignClient.isHaveApps(userId,corpId,appId,zxClientType,zxAccountId);
if(ret != null && "M0000".equals(ret.getCode())){
return (boolean) ret.getData();
}
return false;
}
public Ret haveJurisdictionUser(HaveJurisdictionReqDTO haveJurisdictionReqDTO) {
haveJurisdictionReqDTO.setAppId(appId);
Ret ret = microappFeignClient.haveJurisdictionUser(haveJurisdictionReqDTO,zxClientType,zxAccountId);
return ret;
}
public Ret<List<Long>> haveJurisdictionUserFast(HaveJurisdictionReqDTO haveJurisdictionReqDTO) {
//
// public boolean isHaveApps(long userId, long corpId) {
// Ret ret = microappFeignClient.isHaveApps(userId,corpId,appId,zxClientType,zxAccountId);
// if(ret != null && "M0000".equals(ret.getCode())){
// return (boolean) ret.getData();
// }
// return false;
// }
//
// public Ret haveJurisdictionUser(HaveJurisdictionReqDTO haveJurisdictionReqDTO) {
// haveJurisdictionReqDTO.setAppId(appId);
// Ret ret = microappFeignClient.haveJurisdictionUser(haveJurisdictionReqDTO,zxClientType,zxAccountId);
// return ret;
// }
public Ret<List<String>> haveJurisdictionUserFast(HaveJurisdictionReqDTO haveJurisdictionReqDTO) {
haveJurisdictionReqDTO.setAppId(appId);
Ret<List<Long>> ret = microappFeignClient.haveJurisdictionUserFast(haveJurisdictionReqDTO,zxClientType,zxAccountId);
Ret<List<String>> ret = microappFeignClient.haveJurisdictionUserFast(haveJurisdictionReqDTO,zxClientType,zxAccountId);
return ret;
}
......
......@@ -126,20 +126,20 @@ public class MTNotificationApiRequestClient {
if (null != message.getRecipientIds() && message.getRecipientIds().size() > 0 && message.getRecipientIds().get(0) != null) {
List<Long> recipientIdLongList = new ArrayList<>();
List<String> recipientIdList = new ArrayList<>();
message.getRecipientIds().forEach(recipientId -> {
recipientIdLongList.add(Long.parseLong(recipientId));
recipientIdList.add(recipientId);
});
HaveJurisdictionReqDTO haveJurisdictionReqDTO = new HaveJurisdictionReqDTO(Long.parseLong(message.getCorpId()),recipientIdLongList);
log.debug("----------------------通知-权限验证---------------------");
Ret<List<Long>> haveJurisList = microappApiRequestClient.haveJurisdictionUserFast(haveJurisdictionReqDTO);
HaveJurisdictionReqDTO haveJurisdictionReqDTO = new HaveJurisdictionReqDTO(message.getCorpId(),recipientIdList);
log.debug("----------------------通知-权限验证---------------------"+haveJurisdictionReqDTO);
Ret<List<String>> haveJurisList = microappApiRequestClient.haveJurisdictionUserFast(haveJurisdictionReqDTO);
log.debug("----------------------通知-权限验证返回结果----------------------"+haveJurisList.getData());
if (haveJurisList.getData() == null || haveJurisList.getData().size() < 1){
return false;
}
List<String> haveJurisAccountIds = new ArrayList<>();
// List<String> getUserAccountList = new ArrayList<>();
List<Long> getUserAccountLongList = haveJurisList.getData();
List<String> getUserAccountLongList = haveJurisList.getData();
// getUserAccountLongList.forEach(getUserAccount ->{
// getUserAccountList.add(String.valueOf(getUserAccount));
// });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment