ExposureController.java 815 B

12345678910111213141516171819202122232425
  1. package com.ruoyi.demo.controller;
  2. import com.ruoyi.common.core.domain.R;
  3. import com.ruoyi.demo.entity.Exposure;
  4. import com.ruoyi.demo.service.ExposureService;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.RequestBody;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. @RestController
  11. @RequestMapping("/exposure")
  12. public class ExposureController {
  13. @Autowired
  14. ExposureService exposureService;
  15. @PostMapping()
  16. public R add(@RequestBody Exposure bo){
  17. int i = exposureService.add(bo);
  18. if (i == 1)
  19. return R.ok("添加成功");
  20. return R.fail("添加失败");
  21. }
  22. }