getInstallBot新加repos参数

This commit is contained in:
wanjia 2023-03-31 11:56:17 +08:00
parent f7575b8cde
commit 6c9e0d260b
3 changed files with 5 additions and 3 deletions

View File

@ -205,8 +205,8 @@ public class UserController {
* @return
*/
@GetMapping("/getInstallBot")
public Result<?> getInstallBot(@RequestParam("user_id") Integer userId, @RequestParam("bot_id") Integer botId,@RequestParam("login") String login) throws BotException{
GetInstallBotRequest getInstallBotRequest = new GetInstallBotRequest(userId, login,botId);
public Result<?> getInstallBot(@RequestParam("user_id") Integer userId, @RequestParam("bot_id") Integer botId,@RequestParam("login") String login, @RequestParam("repos") String repos ) throws BotException{
GetInstallBotRequest getInstallBotRequest = new GetInstallBotRequest(userId, login, botId ,repos);
Result<?> result = new Result<>();
GetInstallBotResponse getInstallBotResponse = userService.getInstallBot(getInstallBotRequest);
return result.build(200).build(getInstallBotResponse).build("get installBot success!");

View File

@ -894,7 +894,7 @@ public class UserService extends AbstractUserBot implements IUserService {
//2.到install_bot表中查看state
List<InstallBot> installBots = installMapper.selectList(new QueryWrapper<InstallBot>()
.eq("bot_id",getInstallBotRequest.getBotId())
.eq("installer_id",getInstallBotRequest.getUserId()));
.in("store_repo", Arrays.asList(getInstallBotRequest.getRepos().split(","))));
assert installBots.size()>0;
getInstallBotResponse.setCreateTime(installBots.get(0).getCreateTime());
getInstallBotResponse.setState(installBots.get(0).getState());

View File

@ -23,4 +23,6 @@ public class GetInstallBotRequest implements Serializable {
private String login;
@NotNull(message = "botId is required")
private Integer botId;
private String repos;
}