| | |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.collaborativeApproval.pojo.NoticeType; |
| | | import com.ruoyi.collaborativeApproval.service.NoticeTypeService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @RestController |
| | | @RequestMapping("/noticeType") |
| | | @AllArgsConstructor |
| | | public class NoticeTypeController { |
| | | public class NoticeTypeController extends BaseController { |
| | | |
| | | private NoticeTypeService noticeTypeService; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody NoticeType noticeType) { |
| | | return AjaxResult.success(noticeTypeService.saveOrUpdate(noticeType)); |
| | | public R<?> add(@RequestBody NoticeType noticeType) { |
| | | return R.ok(noticeTypeService.saveOrUpdate(noticeType)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delNoticeType(@RequestBody List<Integer> ids) { |
| | | public R<?> delNoticeType(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("请选择至少一条数据"); |
| | | return R.fail("请选择至少一条数据"); |
| | | } |
| | | return AjaxResult.success(noticeTypeService.removeBatchByIds(ids)); |
| | | return R.ok(noticeTypeService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult noticeTypeList() { |
| | | return AjaxResult.success(noticeTypeService.list()); |
| | | public R<?> noticeTypeList() { |
| | | return R.ok(noticeTypeService.list()); |
| | | } |
| | | |
| | | } |