AppRedemptionCodeController.java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package com.ym.mec.web.controller;
  2. import com.ym.mec.biz.dal.entity.AppRedemptionCode;
  3. import com.ym.mec.biz.service.AppRedemptionCodeService;
  4. import com.ym.mec.common.controller.BaseController;
  5. import com.ym.mec.common.entity.HttpResponseResult;
  6. import io.swagger.annotations.ApiOperation;
  7. import org.springframework.web.bind.annotation.GetMapping;
  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 javax.annotation.Resource;
  12. /**
  13. * 兑换码分配表(RedemptionCode)表控制层
  14. *
  15. * @author makejava
  16. * @since 2021-12-27 14:27:56
  17. */
  18. @RestController
  19. @RequestMapping("appRedemptionCode")
  20. public class AppRedemptionCodeController extends BaseController {
  21. /**
  22. * 服务对象
  23. */
  24. @Resource
  25. private AppRedemptionCodeService appRedemptionCodeService;
  26. @ApiOperation(value = "分配url")
  27. @GetMapping(value = "allocation")
  28. public HttpResponseResult<AppRedemptionCode> allocation(@RequestParam("userId")Integer userId) throws Exception {
  29. if (userId == null) {
  30. throw new Exception("用户Id必须填写");
  31. }
  32. return succeed(appRedemptionCodeService.allocation(userId));
  33. }
  34. @ApiOperation(value = "使用量检测")
  35. @GetMapping(value = "checkLowVolume")
  36. // @PreAuthorize("@pcs.hasPermissions('appRedemptionCode/checkLowVolume')")
  37. public Object checkLowVolume() {
  38. appRedemptionCodeService.checkLowVolume();
  39. return null;
  40. }
  41. }