|
@@ -0,0 +1,56 @@
|
|
|
+package com.chelvc.cloud.admin.controller;
|
|
|
+
|
|
|
+import com.chelvc.cloud.uc.api.dto.DictEntryDTO;
|
|
|
+import com.chelvc.cloud.uc.api.param.DictEntryModifyParam;
|
|
|
+import com.chelvc.cloud.uc.api.param.DictPagingParam;
|
|
|
+import com.chelvc.cloud.uc.api.service.DictEntryService;
|
|
|
+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.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.Min;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author valley
|
|
|
+ * @date 2024/01/11 22:20
|
|
|
+ **/
|
|
|
+
|
|
|
+@Validated
|
|
|
+@RestController
|
|
|
+@ResponseWrapping
|
|
|
+@PreAuthorize("isScope('EMPLOYEE')")
|
|
|
+public class DictEntryController {
|
|
|
+
|
|
|
+ @DubboReference
|
|
|
+ private DictEntryService dictEntryService;
|
|
|
+
|
|
|
+ @PostMapping("dict/entry/add")
|
|
|
+ public Long addDictEntry(@RequestBody @Valid DictEntryModifyParam param) {
|
|
|
+ return this.dictEntryService.addDictEntry(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("dict/entry/update/{id}")
|
|
|
+ public void updateDictEntry(@PathVariable("id") @Min(value = 1, message = "id不能小于1") Long id, @RequestBody @Valid DictEntryModifyParam param) {
|
|
|
+ this.dictEntryService.updateDictEntry(id, param);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("dict/entry/remove/{id}")
|
|
|
+ public void removeDictItem(@PathVariable @Min(value = 1, message = "id不能小于1") Long id) {
|
|
|
+ this.dictEntryService.removeDictEntry(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("dict/entry/page")
|
|
|
+ public Pagination<DictEntryDTO> dictEntryPaging(@RequestBody @Valid DictPagingParam param) {
|
|
|
+ return this.dictEntryService.dictEntryPaging(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("dict/entry/all")
|
|
|
+ public List<List<DictEntryDTO>> dictEntryAll() {
|
|
|
+ return this.dictEntryService.dictEntryGetAll();
|
|
|
+ }
|
|
|
+}
|