|
@@ -0,0 +1,69 @@
|
|
|
+package com.chelvc.cloud.admin.controller;
|
|
|
+
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.NoticeDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.NoticeModifyParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.NoticePagingParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.service.NoticeService;
|
|
|
+import com.chelvc.framework.base.annotation.ResponseWrapping;
|
|
|
+import com.chelvc.framework.common.model.Pagination;
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.Min;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 通知配置接口
|
|
|
+ *
|
|
|
+ * @author liude
|
|
|
+ * @date 2023/12/13
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@RestController
|
|
|
+@ResponseWrapping
|
|
|
+@PreAuthorize("isScope('EMPLOYEE')")
|
|
|
+public class NoticeController {
|
|
|
+ @DubboReference
|
|
|
+ private NoticeService noticeService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增通知配置
|
|
|
+ *
|
|
|
+ * @param param 新增参数
|
|
|
+ * @return 通知配置主键
|
|
|
+ */
|
|
|
+ @PostMapping("/notice")
|
|
|
+ public Long addNotice(@RequestBody @Valid NoticeModifyParam param) {
|
|
|
+ return this.noticeService.addNotice(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改通知配置
|
|
|
+ *
|
|
|
+ * @param id 通知配置主键
|
|
|
+ * @param param 修改参数
|
|
|
+ */
|
|
|
+ @PutMapping("/notice/{id}")
|
|
|
+ public void updateNotice(@PathVariable("id") @Min(value = 1, message = "通知配置主键不能小于1") Long id,
|
|
|
+ @RequestBody @Valid NoticeModifyParam param) {
|
|
|
+ this.noticeService.updateNotice(id, param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询通知配置分页
|
|
|
+ *
|
|
|
+ * @param param 查询参数
|
|
|
+ * @return 通知配置分页信息
|
|
|
+ */
|
|
|
+ @GetMapping("/notice/paging")
|
|
|
+ public Pagination<NoticeDTO> getNoticePaging(@Valid NoticePagingParam param) {
|
|
|
+ return this.noticeService.getNoticePaging(param);
|
|
|
+ }
|
|
|
+}
|