diff --git a/src/main/java/com/gitlink/softbot/service/user/impl/UserService.java b/src/main/java/com/gitlink/softbot/service/user/impl/UserService.java index 53a4876..d130353 100644 --- a/src/main/java/com/gitlink/softbot/service/user/impl/UserService.java +++ b/src/main/java/com/gitlink/softbot/service/user/impl/UserService.java @@ -196,6 +196,10 @@ public class UserService extends AbstractUserBot implements IUserService { marketBotMapper.updateById(marketBot); } botMapper.updateById(updateBot); + //同步更新回调地址 + Response response = api.updateCallbackUrl(botInputVO.getUserId(), updateBot.getId()); + //校验异常 + checkException(response); }catch (DuplicateKeyException e){ throw new BotException("Bot更新失败!"); } diff --git a/src/main/java/com/gitlink/softbot/utils/GitLinkApi.java b/src/main/java/com/gitlink/softbot/utils/GitLinkApi.java index 05677c0..afb1877 100644 --- a/src/main/java/com/gitlink/softbot/utils/GitLinkApi.java +++ b/src/main/java/com/gitlink/softbot/utils/GitLinkApi.java @@ -121,6 +121,14 @@ public class GitLinkApi { return response; } + public Response updateCallbackUrl(Integer uid, Integer botId) { + Map inputParams = new HashMap<>(); + inputParams.put("uid", uid.toString()); + Object[] params = new Object[]{botId.toString()}; + Response response = RestTemplateUtil.httpRequest(restTemplate, HttpMethod.POST, URL+"/app", params, "/update_callback_url" , inputParams, null ,getHeader()); + return response; + } + // public Response activeBotAuth(Integer uid, Integer botId){ // Map inputParams = new HashMap<>(); // inputParams.put("uid", uid.toString());