Browse Source

我的客服中心问题查询

liude 1 year ago
parent
commit
2ab99cbb0a

+ 81 - 0
src/main/java/com/chelvc/cloud/admin/controller/HelpCategoryController.java

@@ -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);
+    }
+}

+ 80 - 0
src/main/java/com/chelvc/cloud/admin/controller/HelpController.java

@@ -0,0 +1,80 @@
+package com.chelvc.cloud.admin.controller;
+
+import com.chelvc.cloud.vehicle.api.dto.HelpDTO;
+import com.chelvc.cloud.vehicle.api.param.HelpModifyParam;
+import com.chelvc.cloud.vehicle.api.param.HelpPagingParam;
+import com.chelvc.cloud.vehicle.api.service.IHelpService;
+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 HelpController {
+    @DubboReference
+    private IHelpService helpService;
+
+    /**
+     * 新增问题配置
+     *
+     * @param param 新增参数
+     * @return 问题配置主键
+     */
+    @PostMapping("/help")
+    public void addHelp(@RequestBody @Valid HelpModifyParam param) {
+         this.helpService.insertHelp(param);
+    }
+
+    /**
+     * 修改问题配置
+     *
+     * @param id    问题配置主键
+     * @param param 修改参数
+     */
+    @PutMapping("/help/{id}")
+    public void updateHelp(@PathVariable("id") @Min(value = 1, message = "问题配置主键不能小于1") Long id,
+                               @RequestBody @Valid HelpModifyParam param) {
+        this.helpService.updateHelp(id,param);
+    }
+
+    /**
+     * 查询问题配置分页
+     *
+     * @param param 查询参数
+     * @return 问题配置分页信息
+     */
+    @GetMapping("/help/paging")
+    public Pagination<HelpDTO> getHelpPaging(@Valid HelpPagingParam param) {
+        return this.helpService.getHelpPaging(param);
+    }
+
+
+    /**
+     * 修改问题配置
+     *
+     * @param id    问题配置主键
+     */
+    @PutMapping("/help/delete/{id}")
+    public void deleteHelp(@PathVariable("id") @Min(value = 1, message = "问题配置主键不能小于1") Long id) {
+        this.helpService.deleteHelpById(id);
+    }
+}