BreedParentsController.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package com.huimv.management.controller;
  2. import java.util.Arrays;
  3. import java.util.Map;
  4. import io.swagger.annotations.Api;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.PathVariable;
  7. import org.springframework.web.bind.annotation.RequestBody;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RequestParam;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import com.huimv.management.entity.BreedParentsEntity;
  12. import com.huimv.management.service.BreedParentsService;
  13. import com.huimv.common.utils.PageUtils;
  14. import com.huimv.common.utils.R;
  15. /**
  16. *
  17. *
  18. * @author yinhao
  19. * @email yinhao@163.com
  20. * @date 2021-06-17 13:44:45
  21. */
  22. @Api("种猪信息表")
  23. @RestController
  24. @RequestMapping("management/breedparents")
  25. public class BreedParentsController {
  26. @Autowired
  27. private BreedParentsService breedParentsService;
  28. /**
  29. * 列表
  30. */
  31. @RequestMapping("/list")
  32. public R list(@RequestParam Map<String, Object> params){
  33. PageUtils page = breedParentsService.queryPage(params);
  34. return R.ok().put("page", page);
  35. }
  36. /**
  37. * 信息
  38. */
  39. @RequestMapping("/info/{id}")
  40. public R info(@PathVariable("id") Integer id){
  41. BreedParentsEntity breedParents = breedParentsService.getById(id);
  42. return R.ok().put("breedParents", breedParents);
  43. }
  44. /**
  45. * 保存
  46. */
  47. @RequestMapping("/save")
  48. public R save(@RequestBody BreedParentsEntity breedParents){
  49. breedParentsService.save(breedParents);
  50. return R.ok();
  51. }
  52. /**
  53. * 修改
  54. */
  55. @RequestMapping("/update")
  56. public R update(@RequestBody BreedParentsEntity breedParents){
  57. breedParentsService.updateById(breedParents);
  58. return R.ok();
  59. }
  60. /**
  61. * 删除
  62. */
  63. @RequestMapping("/delete")
  64. public R delete(@RequestBody Integer[] ids){
  65. breedParentsService.removeByIds(Arrays.asList(ids));
  66. return R.ok();
  67. }
  68. }