package com.farriver.bwf.web.controller.admin.system; import com.farriver.bwf.common.model.ApiData; import com.farriver.bwf.common.model.ApiPageData; import com.farriver.bwf.common.statics.LangConstants; import com.farriver.bwf.data.transferobject.queryobject.system.SystemNotificationQueryObject; import com.farriver.bwf.data.transferobject.viewmodel.system.SystemNotificationViewModel; import com.farriver.bwf.service.system.SystemNotificationService; import com.farriver.bwf.web.controller.admin.AdminControllerBase; import jakarta.annotation.Resource; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/api/admin/system/notification") public class SystemNotificationController extends AdminControllerBase { @Resource SystemNotificationService systemNotificationService; @PostMapping("/create") public ApiData Create(@RequestBody SystemNotificationViewModel model) { if (model == null) { return ApiData.error(LangConstants.MSG_ERROR_PARAMETERS); } return systemNotificationService.Create(model); } @PostMapping("/list") public ApiPageData GetList(@RequestBody SystemNotificationQueryObject queryObject) { if (queryObject == null) { return ApiPageData.error(LangConstants.MSG_ERROR_PARAMETERS); } return systemNotificationService.GetViewPageList(queryObject); } @GetMapping("/delete") public ApiData Delete(@RequestParam(defaultValue = "") String id) { if (id == null || id.isEmpty()) return ApiData.error(LangConstants.MSG_ERROR_PARAMETERS); return systemNotificationService.Delete(id); } @PostMapping("/update") public ApiData Update(@RequestBody SystemNotificationViewModel model) { if (model == null) { return ApiData.error(LangConstants.MSG_ERROR_PARAMETERS); } return systemNotificationService.Update(model); } }