|
@@ -0,0 +1,81 @@
|
|
|
+package com.chelvc.cloud.admin.controller;
|
|
|
+
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.HelpCategoryDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.HelpCategoryModifyParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.HelpCategoryPagingParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.HelpPagingParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.service.IHelpCategoryService;
|
|
|
+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 2024/3/4
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@RestController
|
|
|
+@ResponseWrapping
|
|
|
+@PreAuthorize("isScope('EMPLOYEE')")
|
|
|
+public class HelpCategoryController {
|
|
|
+ @DubboReference
|
|
|
+ private IHelpCategoryService helpCategoryService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增问题分类配置
|
|
|
+ *
|
|
|
+ * @param param 新增参数
|
|
|
+ * @return 问题分类配置主键
|
|
|
+ */
|
|
|
+ @PostMapping("/helpCategory")
|
|
|
+ public void addHelpCategory(@RequestBody @Valid HelpCategoryModifyParam param) {
|
|
|
+ this.helpCategoryService.insertHelpCategory(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改问题分类配置
|
|
|
+ *
|
|
|
+ * @param id 问题分类配置主键
|
|
|
+ * @param param 修改参数
|
|
|
+ */
|
|
|
+ @PutMapping("/helpCategory/{id}")
|
|
|
+ public void updateHelpCategory(@PathVariable("id") @Min(value = 1, message = "问题分类配置主键不能小于1") Long id,
|
|
|
+ @RequestBody @Valid HelpCategoryModifyParam param) {
|
|
|
+ this.helpCategoryService.updateHelpCategory(id,param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询问题分类配置分页
|
|
|
+ *
|
|
|
+ * @param param 查询参数
|
|
|
+ * @return 问题分类配置分页信息
|
|
|
+ */
|
|
|
+ @GetMapping("/helpCategory/paging")
|
|
|
+ public Pagination<HelpCategoryDTO> getHelpCategoryPaging(@Valid HelpCategoryPagingParam param) {
|
|
|
+ return this.helpCategoryService.getHelpCategoryPaging(param);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改问题分类配置
|
|
|
+ *
|
|
|
+ * @param id 问题分类配置主键
|
|
|
+ */
|
|
|
+ @PutMapping("/helpCategory/delete/{id}")
|
|
|
+ public void deleteHelpCategory(@PathVariable("id") @Min(value = 1, message = "问题分类配置主键不能小于1") Long id) {
|
|
|
+ this.helpCategoryService.deleteHelpCategoryById(id);
|
|
|
+ }
|
|
|
+}
|