@RestController
@RequestMapping("/admin")
public class AdminController {
@Reference
private AdminService adminService;
@GetMapping("/findAll")
public List<Admin> findAll(){
return adminService.findAll();
}
@GetMapping("/findPage")
public PageResult<Admin> findPage(int page, int size){
return adminService.findPage(page, size);
}
@PostMapping("/findList")
public List<Admin> findList(@RequestBody Map<String,Object> searchMap){
return adminService.findList(searchMap);
}
@PostMapping("/findPage")
public PageResult<Admin> findPage(@RequestBody Map<String,Object> searchMap,int page, int size){
return adminService.findPage(searchMap,page,size);
}
@GetMapping("/findById")
public Admin findById(Integer id){
return adminService.findById(id);
}
@PostMapping("/add")
public Result add(@RequestBody Admin admin){
adminService.add(admin);
return new Result();
}
@PostMapping("/update")
public Result update(@RequestBody Admin admin){
adminService.update(admin);
return new Result();
}
@GetMapping("/delete")
public Result delete(Integer id){
adminService.delete(id);
return new Result();
}
}
|
|