ExposureController.java 982 B

1234567891011121314151617181920212223242526272829303132333435
  1. package com.ruoyi.demo.controller;
  2. import cn.dev33.satoken.annotation.SaIgnore;
  3. import com.ruoyi.common.core.domain.R;
  4. import com.ruoyi.demo.entity.Exposure;
  5. import com.ruoyi.demo.service.ExposureService;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.RequestBody;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. /**
  12. * 曝光统计
  13. */
  14. @RestController
  15. @RequestMapping("/exposure")
  16. public class ExposureController {
  17. @Autowired
  18. ExposureService exposureService;
  19. /**
  20. * 添加曝光记录
  21. * @param bo 请求体
  22. * @return
  23. */
  24. @SaIgnore
  25. @PostMapping()
  26. public R add(@RequestBody Exposure bo){
  27. int i = exposureService.add(bo);
  28. if (i == 1)
  29. return R.ok("添加成功");
  30. return R.fail("添加失败");
  31. }
  32. }