forked from wanjia9506/soft_bot
更新注册bot时,同步调用gitlink api 更新回调地址
This commit is contained in:
parent
065f82d46f
commit
a7998050ae
|
|
@ -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更新失败!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue