package com.ruoyi.demo.controller; import com.ruoyi.common.core.domain.R; import com.ruoyi.demo.entity.Exposure; import com.ruoyi.demo.service.ExposureService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/exposure") public class ExposureController { @Autowired ExposureService exposureService; @PostMapping() public R add(@RequestBody Exposure bo){ int i = exposureService.add(bo); if (i == 1) return R.ok("添加成功"); return R.fail("添加失败"); } }