packagecom.lele.Controller;importcom.baomidou.mybatisplus.core.metadata.IPage;importcom.lele.Controller.utils.R;importcom.lele.Service.IUserService;importcom.lele.domain.User;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.web.bind.annotation.*;importjava.util.List;@RestController@RequestMapping("/collects")publicclassUserController2{@AutowiredprivateIUserService userService;@GetMappingpublicRgetAll(){returnnewR(true,userService.list());}@PostMappingpublicRsave(@RequestBodyUser user){// R r = new R();// boolean save = userService.save(user);// r.setFlag(save);// return r;returnnewR(userService.save(user));}@PutMappingpublicRupdate(@RequestBodyUser user){returnnewR(userService.updateById(user));}@DeleteMapping({"id"})publicRdelete(@PathVariableInteger id){returnnewR(userService.removeById(id));}@GetMapping("{id}")publicRgetById(@PathVariableInteger id){returnnewR(true,userService.getById(id));}@GetMapping("{currentPage}/{pageSize}")publicRgetPage(@PathVariableint currentPage,@PathVariableint pageSize){returnnewR(true,userService.getPage(currentPage,pageSize));}}