CouponUseController.java 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. package com.dk.oauth.controller.integral;
  2. import com.dk.common.model.pojo.PageList;
  3. import com.dk.common.response.ResponseResultUtil;
  4. import com.dk.common.response.ResponseResultVO;
  5. import com.dk.oauth.model.VO.integral.CouponReceiveVO;
  6. import com.dk.oauth.model.VO.integral.CouponUseVO;
  7. import com.dk.oauth.model.pojo.integral.CouponUse;
  8. import com.dk.common.controller.BaseController;
  9. import com.dk.common.service.BaseService;
  10. import com.dk.oauth.model.query.integral.CouponReceiveQuery;
  11. import com.dk.oauth.model.query.integral.CouponUseQuery;
  12. import com.dk.oauth.model.response.integral.CouponReceiveResponse;
  13. import com.dk.oauth.model.response.integral.CouponUseResponse;
  14. import io.swagger.annotations.ApiOperation;
  15. import org.springframework.web.bind.annotation.*;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import io.swagger.annotations.Api;
  18. import com.dk.oauth.service.integral.CouponUseService;
  19. import javax.validation.Valid;
  20. @Api(tags = "优惠券使用API接口")
  21. @RestController
  22. @RequestMapping("/oauth/couponUse")
  23. public class CouponUseController{
  24. public BaseService<CouponUse> getService() {
  25. return couponUseService;
  26. }
  27. @Autowired
  28. private CouponUseService couponUseService;
  29. /**
  30. * @desc : 条件查询
  31. * @date : 2024/7/26 11:06
  32. * @author : 寇珊珊
  33. */
  34. @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
  35. @PostMapping({"list_by"})
  36. public ResponseResultVO<PageList<CouponUseResponse>> selectByCond(@RequestBody CouponUseQuery couponReceiveQuery) {
  37. return couponUseService.selectByCond(couponReceiveQuery);
  38. }
  39. /**
  40. * @desc : 通过ID查询
  41. * @date : 2024/7/26 11:06
  42. * @author : 寇珊珊
  43. */
  44. @PostMapping({"{id}"})
  45. public ResponseResultVO<?> selectById(@PathVariable String id) {
  46. return couponUseService.selectById(id);
  47. }
  48. /**
  49. * @desc : 更新
  50. * @date : 2024/7/26 16:08
  51. * @author : 寇珊珊
  52. */
  53. @ApiOperation(
  54. value = "更新",
  55. notes = "更新"
  56. )
  57. @PostMapping({"update"})
  58. public ResponseResultVO<?> update(@Valid @RequestBody CouponUseVO couponUseVO) {
  59. return couponUseService.update(couponUseVO);
  60. }
  61. /**
  62. * @desc : 获取优惠劵条数
  63. * @date : 2024/7/29 16:28
  64. * @author : 刘尧
  65. */
  66. @ApiOperation(
  67. value = "获取优惠劵条数",
  68. notes = "获取优惠劵条数"
  69. )
  70. @PostMapping({"count_by"})
  71. public ResponseResultVO<?> countByCond(@RequestBody CouponUseQuery couponUseQuery){
  72. return ResponseResultUtil.success(couponUseService.countByCond(couponUseQuery));
  73. }
  74. }