1.添加admin 批量查询接口

main
Gary 10 months ago
parent 4f968fe3d3
commit eb1ea9b5fe

@ -1,15 +1,22 @@
package com.luoo.user.controller;
import java.util.*;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
import com.luoo.user.annotation.GlobalInterceptor;
import com.luoo.user.annotation.VerifyParam;
import com.luoo.user.pojo.Admin;
import com.luoo.user.service.AdminService;
import api.PageResult;
import api.Result;
import api.StatusCode;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import util.JwtUtil;
@ -82,6 +89,21 @@ public class AdminController {
return Result.success(adminService.findById(id));
}
/**
* AdminidsAdmin
* @param ids
* @return
*/
@ApiOperation(value = "通过Admin用户ids批量查询Admin用户名称")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "多个id以','分隔", required = true) })
@GetMapping("/ids/{id}")
@GlobalInterceptor
public Result<List<Admin>> findAllById(@PathVariable @VerifyParam(required=true) String ids){
List<String> idList=Arrays.stream(ids.split(",")).map(String::trim).collect(Collectors.toList());
return Result.success(adminService.findAllById(idList));
}
/**
* +

@ -158,5 +158,9 @@ public class AdminService {
};
}
public List<Admin> findAllById(List<String> idList) {
return adminDao.findAllById(idList);
}
}

Loading…
Cancel
Save