瀏覽代碼

后台管理优化

liude 1 年之前
父節點
當前提交
a7c1e7eb78

+ 22 - 0
src/main/java/com/chelvc/cloud/admin/controller/CategoryController.java

@@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * 分类接口
  *
@@ -77,4 +79,24 @@ public class CategoryController {
     public void deleteCategory(@PathVariable("id") @Min(value = 1, message = "分类主键不能小于1") Long id) {
         this.categoryService.deleteCategory(id);
     }
+
+    /**
+     * 获取分类列表
+     *
+     * @return 分类信息列表
+     */
+    @GetMapping("/categories")
+    public List<CategoryDTO> listCategories() {
+        return this.categoryService.listActiveCategories();
+    }
+
+    /**
+     * 获取一级分类列表
+     *
+     * @return 分类信息列表
+     */
+    @GetMapping("/getRootCategories")
+    public List<CategoryDTO> getRootCategories() {
+        return this.categoryService.getRootCategories();
+    }
 }

+ 1 - 1
src/main/java/com/chelvc/cloud/admin/controller/DynamicCommentController.java

@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
 @Validated
 @RequiredArgsConstructor
 @RestController
-@RequestMapping("/admin/comment")
+@RequestMapping("/comment")
 public class DynamicCommentController {
 
   @DubboReference

+ 1 - 1
src/main/java/com/chelvc/cloud/admin/controller/DynamicContentController.java

@@ -23,7 +23,7 @@ import javax.validation.constraints.NotNull;
 @Validated
 @RequiredArgsConstructor
 @RestController
-@RequestMapping("/admin/content")
+@RequestMapping("/content")
 public class DynamicContentController {
 
     @DubboReference

+ 40 - 0
src/main/java/com/chelvc/cloud/admin/controller/ReservationController.java

@@ -0,0 +1,40 @@
+package com.chelvc.cloud.admin.controller;
+
+import com.chelvc.cloud.vehicle.api.dto.ReservationDTO;
+import com.chelvc.cloud.vehicle.api.param.ReservationPagingParam;
+import com.chelvc.cloud.vehicle.api.service.ReservationService;
+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.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * 预约管理接口
+ *
+ * @author liude
+ * @Date 2023/1/19
+ **/
+@Validated
+@RestController
+@ResponseWrapping
+@PreAuthorize("isScope('EMPLOYEE')")
+public class ReservationController {
+    @DubboReference
+    private ReservationService reservationService;
+
+    /**
+     * 查询预约管理分页
+     *
+     * @param param 查询参数
+     * @return 预约管理分页信息
+     */
+    @GetMapping("/reservation/paging")
+    public Pagination<ReservationDTO> getReservationPaging(@Valid ReservationPagingParam param) {
+        return this.reservationService.getReservationPaging(param);
+    }
+}

+ 12 - 0
src/main/java/com/chelvc/cloud/admin/controller/RoleController.java

@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * 角色接口
  *
@@ -103,4 +105,14 @@ public class RoleController {
     public Pagination<RoleDTO> getRolePaging(@Valid RolePagingParam param) {
         return this.roleService.getRolePaging(param);
     }
+
+    /**
+     * 查询角色列表
+     *
+     * @return 角色列表信息
+     */
+    @GetMapping("/role/list")
+    public List<RoleDTO> listRoles() {
+        return this.roleService.listRoles();
+    }
 }