更新注册bot时,同步调用gitlink api 更新回调地址

This commit is contained in:
wanjia 2023-03-29 18:07:04 +08:00
parent 065f82d46f
commit a7998050ae
2 changed files with 12 additions and 0 deletions

View File

@ -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更新失败");
}

View File

@ -121,6 +121,14 @@ public class GitLinkApi {
return response;
}
public Response updateCallbackUrl(Integer uid, Integer botId) {
Map<String, String> 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<String, String> inputParams = new HashMap<>();
// inputParams.put("uid", uid.toString());