ShareParamValueController.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package com.imed.costaccount.web;
  2. import com.imed.costaccount.common.util.Result;
  3. import com.imed.costaccount.model.ShareParamValue;
  4. import com.imed.costaccount.model.User;
  5. import com.imed.costaccount.service.ShareParamValueService;
  6. import io.swagger.annotations.Api;
  7. import org.apache.shiro.SecurityUtils;
  8. import org.springframework.web.bind.annotation.*;
  9. import java.util.Arrays;
  10. /**
  11. * 成本分摊参数值设置
  12. *
  13. * @author huangrui
  14. * @date 2021-08-17 10:03:48
  15. */
  16. @Api(tags = "成本分摊参数值管理")
  17. @RestController
  18. @RequestMapping("/costAccount/shareParamValue")
  19. public class ShareParamValueController {
  20. private final ShareParamValueService shareParamValueService;
  21. public ShareParamValueController(ShareParamValueService shareParamValueService) {
  22. this.shareParamValueService = shareParamValueService;
  23. }
  24. /**
  25. * 分页查询列表
  26. */
  27. @RequestMapping("/list")
  28. public Result list(@RequestParam(value = "current", defaultValue = "1") Integer current,
  29. @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
  30. User user = (User) SecurityUtils.getSubject().getPrincipal();
  31. return Result.ok();
  32. }
  33. /**
  34. * 信息
  35. */
  36. @RequestMapping("/info/{id}")
  37. public Result info(@PathVariable("id") Long id){
  38. ShareParamValue shareParamValue = shareParamValueService.getById(id);
  39. return Result.ok(shareParamValue);
  40. }
  41. /**
  42. * 保存
  43. */
  44. @RequestMapping("/save")
  45. public Result save(@RequestBody ShareParamValue shareParamValue){
  46. shareParamValueService.save(shareParamValue);
  47. return Result.ok();
  48. }
  49. /**
  50. * 修改
  51. */
  52. @RequestMapping("/update")
  53. public Result update(@RequestBody ShareParamValue shareParamValue){
  54. shareParamValueService.updateById(shareParamValue);
  55. return Result.ok();
  56. }
  57. /**
  58. * 删除
  59. */
  60. @RequestMapping("/delete")
  61. public Result delete(@RequestBody Long[] ids){
  62. shareParamValueService.removeByIds(Arrays.asList(ids));
  63. return Result.ok();
  64. }
  65. }