mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 04:29:21 +08:00
refactor(api): 统一后端接口响应消息,改为具体操作描述而非泛化'操作成功'
This commit is contained in:
+4
@@ -24,6 +24,10 @@ public class ApiResponse<T> {
|
||||
return new ApiResponse<>(0, "操作成功", null);
|
||||
}
|
||||
|
||||
public static ApiResponse<Void> success(String message) {
|
||||
return new ApiResponse<>(0, message, null);
|
||||
}
|
||||
|
||||
public static <T> ApiResponse<T> fail(String message) {
|
||||
return new ApiResponse<>(1, message, null);
|
||||
}
|
||||
|
||||
+5
-5
@@ -34,7 +34,7 @@ public class BrushOrderController {
|
||||
@RequirePermission(value = "ecom:order:create", description = "创建刷单记录", allowSuper = true)
|
||||
public ApiResponse<BrushOrderVO> createBrushOrder(@Valid @RequestBody CreateBrushOrderDTO createBrushOrderDTO) {
|
||||
BrushOrderVO brushOrderVO = brushOrderService.createBrushOrder(createBrushOrderDTO);
|
||||
return ApiResponse.success(brushOrderVO);
|
||||
return ApiResponse.success("刷单记录创建成功", brushOrderVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新刷单记录", description = "更新现有刷单记录信息")
|
||||
@@ -43,7 +43,7 @@ public class BrushOrderController {
|
||||
public ApiResponse<BrushOrderVO> updateBrushOrder(@Valid @RequestBody UpdateBrushOrderDTO updateBrushOrderDTO,
|
||||
@Parameter(description = "刷单记录ID") @PathVariable Long id) {
|
||||
BrushOrderVO brushOrderVO = brushOrderService.updateBrushOrder(updateBrushOrderDTO, id);
|
||||
return ApiResponse.success(brushOrderVO);
|
||||
return ApiResponse.success("刷单记录更新成功", brushOrderVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除刷单记录", description = "删除指定刷单记录")
|
||||
@@ -52,7 +52,7 @@ public class BrushOrderController {
|
||||
public ApiResponse<Void> deleteBrushOrder(
|
||||
@Parameter(description = "刷单记录ID") @PathVariable Long id) {
|
||||
brushOrderService.deleteBrushOrder(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("刷单记录删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取刷单记录列表", description = "分页获取刷单记录列表,支持条件过滤")
|
||||
@@ -61,7 +61,7 @@ public class BrushOrderController {
|
||||
public ApiResponse<PageResultVO<BrushOrderVO>> getBrushOrderPage(
|
||||
@Valid @RequestBody PageQueryDTO<BrushOrderFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<BrushOrderVO> result = brushOrderService.getBrushOrderPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取刷单记录列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取刷单记录详情", description = "根据ID获取刷单记录详情")
|
||||
@@ -70,6 +70,6 @@ public class BrushOrderController {
|
||||
public ApiResponse<BrushOrderVO> getBrushOrderById(
|
||||
@Parameter(description = "刷单记录ID") @PathVariable Long id) {
|
||||
BrushOrderVO brushOrderVO = brushOrderService.getBrushOrderById(id);
|
||||
return ApiResponse.success(brushOrderVO);
|
||||
return ApiResponse.success("获取刷单记录详情成功", brushOrderVO);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -54,7 +54,7 @@ public class CategoryController {
|
||||
public ApiResponse<Void> deleteCategory(
|
||||
@Parameter(description = "类目ID") @PathVariable Long id) {
|
||||
categoryService.deleteCategory(id);
|
||||
return ApiResponse.success("类目删除成功", null);
|
||||
return ApiResponse.<Void>success("类目删除成功", null);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取类目列表", description = "分页获取类目列表,支持条件过滤")
|
||||
@@ -63,7 +63,7 @@ public class CategoryController {
|
||||
public ApiResponse<PageResultVO<CategoryVO>> getCategoryPage(
|
||||
@Valid @RequestBody PageQueryDTO<CategoryFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<CategoryVO> result = categoryService.getCategoryPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取类目列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取类目树形结构", description = "获取当前公司的所有类目,以树形结构返回")
|
||||
@@ -71,7 +71,7 @@ public class CategoryController {
|
||||
@RequirePermission(value = "ecom:category:read", description = "查询类目树", allowSuper = true)
|
||||
public ApiResponse<List<CategoryVO>> getCategoryTree() {
|
||||
List<CategoryVO> tree = categoryService.getCategoryTree();
|
||||
return ApiResponse.success(tree);
|
||||
return ApiResponse.success("获取类目树成功", tree);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取类目扁平列表", description = "获取当前公司的所有类目,以扁平列表返回,用于下拉选择")
|
||||
@@ -79,6 +79,6 @@ public class CategoryController {
|
||||
@RequirePermission(value = "ecom:category:read", description = "查询类目列表", allowSuper = true)
|
||||
public ApiResponse<List<CategoryVO>> getCategoryList() {
|
||||
List<CategoryVO> list = categoryService.getCategoryList();
|
||||
return ApiResponse.success(list);
|
||||
return ApiResponse.success("获取类目列表成功", list);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -37,7 +37,7 @@ public class ImportFieldDefController {
|
||||
@RequirePermission(value = "data:import", description = "创建导入字段定义", allowSuper = true)
|
||||
public ApiResponse<ImportFieldDefVO> createImportFieldDef(@Valid @RequestBody CreateImportFieldDefDTO createImportFieldDefDTO) {
|
||||
ImportFieldDefVO importFieldDefVO = importFieldDefService.createImportFieldDef(createImportFieldDefDTO);
|
||||
return ApiResponse.success(importFieldDefVO);
|
||||
return ApiResponse.success("导入字段定义创建成功", importFieldDefVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新导入字段定义", description = "更新现有导入字段定义")
|
||||
@@ -47,7 +47,7 @@ public class ImportFieldDefController {
|
||||
@Valid @RequestBody UpdateImportFieldDefDTO updateImportFieldDefDTO,
|
||||
@Parameter(description = "字段定义ID") @PathVariable Long id) {
|
||||
ImportFieldDefVO importFieldDefVO = importFieldDefService.updateImportFieldDef(updateImportFieldDefDTO, id);
|
||||
return ApiResponse.success(importFieldDefVO);
|
||||
return ApiResponse.success("导入字段定义更新成功", importFieldDefVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除导入字段定义", description = "删除指定导入字段定义")
|
||||
@@ -56,7 +56,7 @@ public class ImportFieldDefController {
|
||||
public ApiResponse<Void> deleteImportFieldDef(
|
||||
@Parameter(description = "字段定义ID") @PathVariable Long id) {
|
||||
importFieldDefService.deleteImportFieldDef(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("导入字段定义删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取指定类型所有字段列表", description = "根据导入类型获取所有字段定义列表")
|
||||
@@ -65,7 +65,7 @@ public class ImportFieldDefController {
|
||||
public ApiResponse<List<ImportFieldDefVO>> getFieldDefsByType(
|
||||
@Parameter(description = "导入类型", example = "product") @PathVariable String type) {
|
||||
List<ImportFieldDefVO> fieldDefVOs = importFieldDefService.getFieldDefsByType(type);
|
||||
return ApiResponse.success(fieldDefVOs);
|
||||
return ApiResponse.success("获取字段定义列表成功", fieldDefVOs);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询导入字段定义", description = "分页查询导入字段定义,支持条件过滤")
|
||||
@@ -74,7 +74,7 @@ public class ImportFieldDefController {
|
||||
public ApiResponse<PageResultVO<ImportFieldDefVO>> getImportFieldDefPage(
|
||||
@Valid @RequestBody PageQueryDTO<ImportFieldDefFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<ImportFieldDefVO> result = importFieldDefService.getImportFieldDefPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取导入字段定义列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量排序导入字段定义", description = "批量更新导入字段定义的排序值")
|
||||
@@ -82,6 +82,6 @@ public class ImportFieldDefController {
|
||||
@RequirePermission(value = "data:import", description = "批量排序导入字段定义", allowSuper = true)
|
||||
public ApiResponse<Void> batchSortImportFieldDef(@Valid @RequestBody BatchSortImportFieldDefDTO batchSortDTO) {
|
||||
importFieldDefService.batchSortImportFieldDef(batchSortDTO);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("批量排序成功");
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -34,7 +34,7 @@ public class ImportMappingController {
|
||||
@RequirePermission(value = "data:import", description = "创建导入映射模板", allowSuper = true)
|
||||
public ApiResponse<ImportMappingVO> createImportMapping(@Valid @RequestBody CreateImportMappingDTO createImportMappingDTO) {
|
||||
ImportMappingVO importMappingVO = importMappingService.createImportMapping(createImportMappingDTO);
|
||||
return ApiResponse.success(importMappingVO);
|
||||
return ApiResponse.success("导入映射模板创建成功", importMappingVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新导入映射模板", description = "更新现有导入映射模板")
|
||||
@@ -44,7 +44,7 @@ public class ImportMappingController {
|
||||
@Valid @RequestBody UpdateImportMappingDTO updateImportMappingDTO,
|
||||
@Parameter(description = "模板ID") @PathVariable Long id) {
|
||||
ImportMappingVO importMappingVO = importMappingService.updateImportMapping(updateImportMappingDTO, id);
|
||||
return ApiResponse.success(importMappingVO);
|
||||
return ApiResponse.success("导入映射模板更新成功", importMappingVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除导入映射模板", description = "删除指定导入映射模板")
|
||||
@@ -53,7 +53,7 @@ public class ImportMappingController {
|
||||
public ApiResponse<Void> deleteImportMapping(
|
||||
@Parameter(description = "模板ID") @PathVariable Long id) {
|
||||
importMappingService.deleteImportMapping(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("导入映射模板删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取导入映射模板列表", description = "分页获取导入映射模板列表,支持条件过滤")
|
||||
@@ -62,6 +62,6 @@ public class ImportMappingController {
|
||||
public ApiResponse<PageResultVO<ImportMappingVO>> getImportMappingPage(
|
||||
@Valid @RequestBody PageQueryDTO<ImportMappingFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<ImportMappingVO> result = importMappingService.getImportMappingPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取导入映射模板列表成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ public class ImportTaskController {
|
||||
@RequirePermission(value = "data:import", description = "创建导入任务", allowSuper = true)
|
||||
public ApiResponse<ImportTaskVO> createImportTask(@Valid @RequestBody CreateImportTaskDTO createImportTaskDTO) {
|
||||
ImportTaskVO importTaskVO = importTaskService.createImportTask(createImportTaskDTO);
|
||||
return ApiResponse.success(importTaskVO);
|
||||
return ApiResponse.success("导入任务创建成功", importTaskVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取导入任务列表", description = "分页获取导入任务列表,支持条件过滤")
|
||||
@@ -41,6 +41,6 @@ public class ImportTaskController {
|
||||
public ApiResponse<PageResultVO<ImportTaskVO>> getImportTaskPage(
|
||||
@Valid @RequestBody PageQueryDTO<ImportTaskFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<ImportTaskVO> result = importTaskService.getImportTaskPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取导入任务列表成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -36,7 +36,7 @@ public class OrderController {
|
||||
@RequirePermission(value = "ecom:order:create", description = "创建订单", allowSuper = true)
|
||||
public ApiResponse<OrderVO> createOrder(@Valid @RequestBody CreateOrderDTO createOrderDTO) {
|
||||
OrderVO orderVO = orderService.createOrder(createOrderDTO);
|
||||
return ApiResponse.success(orderVO);
|
||||
return ApiResponse.success("订单创建成功", orderVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新订单", description = "更新现有订单信息")
|
||||
@@ -45,7 +45,7 @@ public class OrderController {
|
||||
public ApiResponse<OrderVO> updateOrder(@Valid @RequestBody UpdateOrderDTO updateOrderDTO,
|
||||
@Parameter(description = "订单ID") @PathVariable Long id) {
|
||||
OrderVO orderVO = orderService.updateOrder(updateOrderDTO, id);
|
||||
return ApiResponse.success(orderVO);
|
||||
return ApiResponse.success("订单更新成功", orderVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除订单", description = "删除指定订单")
|
||||
@@ -54,7 +54,7 @@ public class OrderController {
|
||||
public ApiResponse<Void> deleteOrder(
|
||||
@Parameter(description = "订单ID") @PathVariable Long id) {
|
||||
orderService.deleteOrder(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("订单删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取订单列表", description = "分页获取订单列表,支持条件过滤")
|
||||
@@ -63,7 +63,7 @@ public class OrderController {
|
||||
public ApiResponse<PageResultVO<OrderVO>> getOrderPage(
|
||||
@Valid @RequestBody PageQueryDTO<OrderFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<OrderVO> result = orderService.getOrderPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取订单列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取订单详情", description = "根据ID获取订单详情")
|
||||
@@ -72,7 +72,7 @@ public class OrderController {
|
||||
public ApiResponse<OrderVO> getOrderById(
|
||||
@Parameter(description = "订单ID") @PathVariable Long id) {
|
||||
OrderVO orderVO = orderService.getOrderById(id);
|
||||
return ApiResponse.success(orderVO);
|
||||
return ApiResponse.success("获取订单详情成功", orderVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量导入订单", description = "批量导入订单数据,支持部分成功部分失败")
|
||||
@@ -80,6 +80,6 @@ public class OrderController {
|
||||
@RequirePermission(value = "ecom:order:import", description = "批量导入订单", allowSuper = true)
|
||||
public ApiResponse<BatchImportResultVO> batchImportOrders(@Valid @RequestBody BatchImportOrderDTO batchImportOrderDTO) {
|
||||
BatchImportResultVO result = orderService.batchImportOrders(batchImportOrderDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("批量导入订单成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -33,7 +33,7 @@ public class OrderStatusController {
|
||||
@RequirePermission(value = "ecom:order:manage", description = "创建订单状态", allowSuper = true)
|
||||
public ApiResponse<OrderStatusVO> createOrderStatus(@Valid @RequestBody CreateOrderStatusDTO createOrderStatusDTO) {
|
||||
OrderStatusVO orderStatusVO = orderStatusService.createOrderStatus(createOrderStatusDTO);
|
||||
return ApiResponse.success(orderStatusVO);
|
||||
return ApiResponse.success("订单状态创建成功", orderStatusVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新订单状态", description = "更新现有订单状态信息")
|
||||
@@ -42,7 +42,7 @@ public class OrderStatusController {
|
||||
public ApiResponse<OrderStatusVO> updateOrderStatus(@Valid @RequestBody UpdateOrderStatusDTO updateOrderStatusDTO,
|
||||
@Parameter(description = "订单状态ID") @PathVariable Long id) {
|
||||
OrderStatusVO orderStatusVO = orderStatusService.updateOrderStatus(updateOrderStatusDTO, id);
|
||||
return ApiResponse.success(orderStatusVO);
|
||||
return ApiResponse.success("订单状态更新成功", orderStatusVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除订单状态", description = "删除指定订单状态")
|
||||
@@ -51,7 +51,7 @@ public class OrderStatusController {
|
||||
public ApiResponse<Void> deleteOrderStatus(
|
||||
@Parameter(description = "订单状态ID") @PathVariable Long id) {
|
||||
orderStatusService.deleteOrderStatus(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("订单状态删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取所有订单状态", description = "获取当前公司的所有订单状态列表")
|
||||
@@ -59,7 +59,7 @@ public class OrderStatusController {
|
||||
@RequirePermission(value = "ecom:order:read", description = "查询订单状态列表", allowSuper = true)
|
||||
public ApiResponse<List<OrderStatusVO>> getAllOrderStatuses() {
|
||||
List<OrderStatusVO> result = orderStatusService.getAllOrderStatuses();
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取订单状态列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取订单状态详情", description = "根据ID获取订单状态详情")
|
||||
@@ -68,6 +68,6 @@ public class OrderStatusController {
|
||||
public ApiResponse<OrderStatusVO> getOrderStatusById(
|
||||
@Parameter(description = "订单状态ID") @PathVariable Long id) {
|
||||
OrderStatusVO orderStatusVO = orderStatusService.getOrderStatusById(id);
|
||||
return ApiResponse.success(orderStatusVO);
|
||||
return ApiResponse.success("获取订单状态详情成功", orderStatusVO);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,6 +29,6 @@ public class CompanyOverviewController {
|
||||
@RequirePermission(value = "ecom:shop:read", description = "查询全店铺概览", allowSuper = true)
|
||||
public ApiResponse<CompanyOverviewVO> getCompanyOverview(@Valid @RequestBody CompanyOverviewQueryDTO queryDTO) {
|
||||
CompanyOverviewVO overviewVO = companyOverviewService.getCompanyOverview(queryDTO);
|
||||
return ApiResponse.success(overviewVO);
|
||||
return ApiResponse.success("获取全店铺概览成功", overviewVO);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -36,7 +36,7 @@ public class PlatformController {
|
||||
@RequirePermission(value = "ecom:platform:manage", description = "创建平台", allowSuper = true)
|
||||
public ApiResponse<PlatformVO> createPlatform(@Valid @RequestBody CreatePlatformDTO createPlatformDTO) {
|
||||
PlatformVO platformVO = platformService.createPlatform(createPlatformDTO);
|
||||
return ApiResponse.success(platformVO);
|
||||
return ApiResponse.success("平台创建成功", platformVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新平台", description = "更新现有平台信息")
|
||||
@@ -45,7 +45,7 @@ public class PlatformController {
|
||||
public ApiResponse<PlatformVO> updatePlatform(@Valid @RequestBody UpdatePlatformDTO updatePlatformDTO,
|
||||
@Parameter(description = "平台ID") @PathVariable Long id) {
|
||||
PlatformVO platformVO = platformService.updatePlatform(updatePlatformDTO, id);
|
||||
return ApiResponse.success(platformVO);
|
||||
return ApiResponse.success("平台更新成功", platformVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除平台", description = "删除指定平台")
|
||||
@@ -53,7 +53,7 @@ public class PlatformController {
|
||||
@RequirePermission(value = "ecom:platform:manage", description = "删除平台", allowSuper = true)
|
||||
public ApiResponse<Void> deletePlatform(@Parameter(description = "平台ID") @PathVariable Long id) {
|
||||
platformService.deletePlatform(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("平台删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取平台列表", description = "分页获取平台列表,支持条件过滤")
|
||||
@@ -62,7 +62,7 @@ public class PlatformController {
|
||||
public ApiResponse<PageResultVO<PlatformVO>> getPlatformPage(
|
||||
@Valid @RequestBody PageQueryDTO<PlatformFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<PlatformVO> result = platformService.getPlatformPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取平台列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取所有启用的平台", description = "获取所有已启用的平台列表,供下拉选择")
|
||||
@@ -70,6 +70,6 @@ public class PlatformController {
|
||||
@RequirePermission(value = "ecom:platform:read", description = "查询平台列表", allowSuper = true)
|
||||
public ApiResponse<List<PlatformVO>> getActivePlatforms() {
|
||||
List<PlatformVO> result = platformService.getActivePlatforms();
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取启用的平台列表成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -54,7 +54,7 @@ public class ProductController {
|
||||
public ApiResponse<Void> deleteProduct(
|
||||
@Parameter(description = "商品ID") @PathVariable Long id) {
|
||||
productService.deleteProduct(id);
|
||||
return ApiResponse.success("商品删除成功", null);
|
||||
return ApiResponse.<Void>success("商品删除成功", null);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取商品列表", description = "分页获取商品列表,支持条件过滤")
|
||||
@@ -63,7 +63,7 @@ public class ProductController {
|
||||
public ApiResponse<PageResultVO<ProductVO>> getProductPage(
|
||||
@Valid @RequestBody PageQueryDTO<ProductFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<ProductVO> result = productService.getProductPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取商品列表成功", result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -67,7 +67,7 @@ public class ProductSpecController {
|
||||
public ApiResponse<Void> deleteProductSpec(
|
||||
@Parameter(description = "商品规格ID") @PathVariable Long id) {
|
||||
productSpecService.deleteProductSpec(id);
|
||||
return ApiResponse.success("规格删除成功", null);
|
||||
return ApiResponse.<Void>success("规格删除成功", null);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取商品规格列表", description = "分页获取商品规格列表,支持条件过滤")
|
||||
@@ -76,7 +76,7 @@ public class ProductSpecController {
|
||||
public ApiResponse<PageResultVO<ProductSpecVO>> getProductSpecPage(
|
||||
@Valid @RequestBody PageQueryDTO<ProductSpecFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<ProductSpecVO> result = productSpecService.getProductSpecPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取商品规格列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据ID列表批量查询商品规格", description = "根据规格ID列表批量查询规格详情,用于同步确认")
|
||||
@@ -94,7 +94,7 @@ public class ProductSpecController {
|
||||
return vo;
|
||||
})
|
||||
.collect(java.util.stream.Collectors.toList());
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("批量获取商品规格成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据商品名称和规格编码精准查询商品规格", description = "根据商品名称和规格编码精准查询商品规格信息,用于数据导入")
|
||||
@@ -104,7 +104,7 @@ public class ProductSpecController {
|
||||
@Parameter(description = "商品名称") @PathVariable String productName,
|
||||
@Parameter(description = "规格编码") @PathVariable String specCode) {
|
||||
ProductSpecVO productSpecVO = productSpecService.getProductSpecByProductAndSpec(productName, specCode);
|
||||
return ApiResponse.success(productSpecVO);
|
||||
return ApiResponse.success("根据商品名称和规格编码查询规格成功", productSpecVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量根据商品名称和规格编码查询商品规格", description = "批量根据商品名称和规格编码精准查询商品规格信息,用于数据导入")
|
||||
@@ -112,7 +112,7 @@ public class ProductSpecController {
|
||||
@RequirePermission(value = "ecom:product:read", description = "批量根据商品名称和规格编码查询商品规格", allowSuper = true)
|
||||
public ApiResponse<List<ProductVO>> getProductSpecsByProductAndSpecs(@RequestBody List<ProductSpecQueryDTO> queries) {
|
||||
List<ProductVO> productVOs = productSpecService.getProductSpecsByProductAndSpecs(queries);
|
||||
return ApiResponse.success(productVOs);
|
||||
return ApiResponse.success("批量查询规格成功", productVOs);
|
||||
}
|
||||
|
||||
@Operation(summary = "同步规格成本到历史订单", description = "将指定规格的成本批量更新到符合时间范围的订单")
|
||||
|
||||
+1
-1
@@ -34,6 +34,6 @@ public class ProductOverviewController {
|
||||
public ApiResponse<ProductOverviewVO> getProductOverview(
|
||||
@Valid @RequestBody ProductOverviewQueryDTO queryDTO) {
|
||||
ProductOverviewVO overview = productOverviewService.getProductOverview(queryDTO);
|
||||
return ApiResponse.success(overview);
|
||||
return ApiResponse.success("获取商品总览成功", overview);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -32,7 +32,7 @@ public class PromotionFeeController {
|
||||
@RequirePermission(value = "ecom:order:create", description = "创建推广费记录", allowSuper = true)
|
||||
public ApiResponse<Long> createPromotionFee(@Valid @RequestBody CreatePromotionFeeDTO dto) {
|
||||
Long id = promotionFeeService.createPromotionFee(dto);
|
||||
return ApiResponse.success(id);
|
||||
return ApiResponse.success("推广费记录创建成功", id);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@@ -40,7 +40,7 @@ public class PromotionFeeController {
|
||||
@RequirePermission(value = "ecom:order:update", description = "更新推广费记录", allowSuper = true)
|
||||
public ApiResponse<Void> updatePromotionFee(@Valid @RequestBody UpdatePromotionFeeDTO dto) {
|
||||
promotionFeeService.updatePromotionFee(dto);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("推广费记录更新成功");
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@@ -49,7 +49,7 @@ public class PromotionFeeController {
|
||||
public ApiResponse<Void> deletePromotionFee(
|
||||
@Parameter(description = "记录ID", required = true) @PathVariable Long id) {
|
||||
promotionFeeService.deletePromotionFee(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("推广费记录删除成功");
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@@ -58,7 +58,7 @@ public class PromotionFeeController {
|
||||
public ApiResponse<PromotionFeeVO> getPromotionFeeById(
|
||||
@Parameter(description = "记录ID", required = true) @PathVariable Long id) {
|
||||
PromotionFeeVO vo = promotionFeeService.getPromotionFeeById(id);
|
||||
return ApiResponse.success(vo);
|
||||
return ApiResponse.success("获取推广费记录详情成功", vo);
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
@@ -67,6 +67,6 @@ public class PromotionFeeController {
|
||||
public ApiResponse<PageResultVO<PromotionFeeVO>> getPromotionFeePage(
|
||||
@Valid @RequestBody PageQueryDTO<PromotionFeeFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<PromotionFeeVO> result = promotionFeeService.getPromotionFeePage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取推广费记录列表成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -31,7 +31,7 @@ public class PromotionFeeTypeController {
|
||||
@RequirePermission(value = "ecom:order:create", description = "创建推广费类型", allowSuper = true)
|
||||
public ApiResponse<Long> createPromotionFeeType(@Valid @RequestBody CreatePromotionFeeTypeDTO dto) {
|
||||
Long id = promotionFeeTypeService.createPromotionFeeType(dto);
|
||||
return ApiResponse.success(id);
|
||||
return ApiResponse.success("推广费类型创建成功", id);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@@ -39,7 +39,7 @@ public class PromotionFeeTypeController {
|
||||
@RequirePermission(value = "ecom:order:update", description = "更新推广费类型", allowSuper = true)
|
||||
public ApiResponse<Void> updatePromotionFeeType(@Valid @RequestBody UpdatePromotionFeeTypeDTO dto) {
|
||||
promotionFeeTypeService.updatePromotionFeeType(dto);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("推广费类型更新成功");
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@@ -48,7 +48,7 @@ public class PromotionFeeTypeController {
|
||||
public ApiResponse<Void> deletePromotionFeeType(
|
||||
@Parameter(description = "类型ID", required = true) @PathVariable Long id) {
|
||||
promotionFeeTypeService.deletePromotionFeeType(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("推广费类型删除成功");
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@@ -57,7 +57,7 @@ public class PromotionFeeTypeController {
|
||||
public ApiResponse<PromotionFeeTypeVO> getPromotionFeeTypeById(
|
||||
@Parameter(description = "类型ID", required = true) @PathVariable Long id) {
|
||||
PromotionFeeTypeVO vo = promotionFeeTypeService.getPromotionFeeTypeById(id);
|
||||
return ApiResponse.success(vo);
|
||||
return ApiResponse.success("获取推广费类型详情成功", vo);
|
||||
}
|
||||
|
||||
@GetMapping("/active")
|
||||
@@ -65,7 +65,7 @@ public class PromotionFeeTypeController {
|
||||
@RequirePermission(value = "ecom:order:read", description = "查询启用的推广费类型", allowSuper = true)
|
||||
public ApiResponse<List<PromotionFeeTypeVO>> getActivePromotionFeeTypeList() {
|
||||
List<PromotionFeeTypeVO> list = promotionFeeTypeService.getActivePromotionFeeTypeList();
|
||||
return ApiResponse.success(list);
|
||||
return ApiResponse.success("获取启用的推广费类型列表成功", list);
|
||||
}
|
||||
|
||||
@GetMapping("/all")
|
||||
@@ -73,7 +73,7 @@ public class PromotionFeeTypeController {
|
||||
@RequirePermission(value = "ecom:order:read", description = "查询所有推广费类型", allowSuper = true)
|
||||
public ApiResponse<List<PromotionFeeTypeVO>> getAllPromotionFeeTypeList() {
|
||||
List<PromotionFeeTypeVO> list = promotionFeeTypeService.getAllPromotionFeeTypeList();
|
||||
return ApiResponse.success(list);
|
||||
return ApiResponse.success("获取所有推广费类型列表成功", list);
|
||||
}
|
||||
|
||||
@PostMapping("/init")
|
||||
@@ -81,6 +81,6 @@ public class PromotionFeeTypeController {
|
||||
@RequirePermission(value = "ecom:order:create", description = "初始化推广费类型", allowSuper = true)
|
||||
public ApiResponse<Void> initPromotionFeeType() {
|
||||
promotionFeeTypeService.initPromotionFeeTypeForCurrentCompany();
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("推广费类型初始化成功");
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -47,7 +47,7 @@ public class ShopController {
|
||||
@RequirePermission(value = "ecom:shop:manage", description = "创建店铺", allowSuper = true)
|
||||
public ApiResponse<ShopVO> createShop(@Valid @RequestBody CreateShopDTO createShopDTO) {
|
||||
ShopVO shopVO = shopService.createShop(createShopDTO);
|
||||
return ApiResponse.success(shopVO);
|
||||
return ApiResponse.success("店铺创建成功", shopVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新店铺", description = "更新现有店铺信息")
|
||||
@@ -56,7 +56,7 @@ public class ShopController {
|
||||
public ApiResponse<ShopVO> updateShop(@Valid @RequestBody UpdateShopDTO updateShopDTO,
|
||||
@Parameter(description = "店铺ID") @PathVariable Long id) {
|
||||
ShopVO shopVO = shopService.updateShop(updateShopDTO, id);
|
||||
return ApiResponse.success(shopVO);
|
||||
return ApiResponse.success("店铺更新成功", shopVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除店铺", description = "删除指定店铺")
|
||||
@@ -65,7 +65,7 @@ public class ShopController {
|
||||
public ApiResponse<Void> deleteShop(
|
||||
@Parameter(description = "店铺ID") @PathVariable Long id) {
|
||||
shopService.deleteShop(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("店铺删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取店铺列表", description = "分页获取店铺列表,支持条件过滤")
|
||||
@@ -74,7 +74,7 @@ public class ShopController {
|
||||
public ApiResponse<PageResultVO<ShopVO>> getShopPage(
|
||||
@Valid @RequestBody PageQueryDTO<ShopFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<ShopVO> result = shopService.getShopPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取店铺列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "上传店铺Logo", description = "上传店铺Logo图片,支持跨公司共享")
|
||||
@@ -87,7 +87,7 @@ public class ShopController {
|
||||
}
|
||||
|
||||
SysFileUploadVO fileVO = shopService.uploadLogo(file);
|
||||
return ApiResponse.success(fileVO);
|
||||
return ApiResponse.success("Logo上传成功", fileVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取店铺总览", description = "获取店铺总览,返回日期范围内每日的销售额、订单数、客单价、成本、退款金额、推广费、费比统计数据,包含时间范围的总值和每日数据数组")
|
||||
@@ -96,7 +96,7 @@ public class ShopController {
|
||||
public ApiResponse<ShopOverviewVO> getShopOverview(
|
||||
@Valid @RequestBody ShopStatisticsQueryDTO queryDTO) {
|
||||
ShopOverviewVO overview = shopService.getShopOverview(queryDTO);
|
||||
return ApiResponse.success(overview);
|
||||
return ApiResponse.success("获取店铺总览成功", overview);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取店铺商品信息", description = "通过中间表分页获取店铺商品信息,包含商品基本信息和规格列表")
|
||||
@@ -105,7 +105,7 @@ public class ShopController {
|
||||
public ApiResponse<PageResultVO<ProductVO>> getShopProductPage(
|
||||
@Valid @RequestBody PageQueryDTO<ShopProductPageFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<ProductVO> result = shopService.getShopProductPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取店铺商品列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取店铺概览统计数据", description = "获取指定店铺的概览统计数据,包括销售额、单量、推广费、利润、ROI等,以及多商品数据横向对比")
|
||||
@@ -113,6 +113,6 @@ public class ShopController {
|
||||
@RequirePermission(value = "ecom:shop:read", description = "查询店铺概览统计", allowSuper = true)
|
||||
public ApiResponse<ShopOverviewStatisticsVO> getShopOverviewStatistics(@Valid @RequestBody ShopOverviewQueryDTO queryDTO) {
|
||||
ShopOverviewStatisticsVO overviewVO = shopOverviewStatisticsService.getShopOverviewStatistics(queryDTO);
|
||||
return ApiResponse.success(overviewVO);
|
||||
return ApiResponse.success("获取店铺概览统计成功", overviewVO);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -34,7 +34,7 @@ public class ShopMonthlyTargetController {
|
||||
@RequirePermission(value = "ecom:shop:manage", description = "创建店铺月销量目标", allowSuper = true)
|
||||
public ApiResponse<ShopMonthlyTargetVO> createShopMonthlyTarget(@Valid @RequestBody CreateShopMonthlyTargetDTO createDTO) {
|
||||
ShopMonthlyTargetVO vo = shopMonthlyTargetService.createShopMonthlyTarget(createDTO);
|
||||
return ApiResponse.success(vo);
|
||||
return ApiResponse.success("店铺月销量目标创建成功", vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新店铺月销量目标", description = "更新现有店铺月销量目标信息")
|
||||
@@ -43,7 +43,7 @@ public class ShopMonthlyTargetController {
|
||||
public ApiResponse<ShopMonthlyTargetVO> updateShopMonthlyTarget(@Valid @RequestBody UpdateShopMonthlyTargetDTO updateDTO,
|
||||
@Parameter(description = "目标ID") @PathVariable Long id) {
|
||||
ShopMonthlyTargetVO vo = shopMonthlyTargetService.updateShopMonthlyTarget(updateDTO, id);
|
||||
return ApiResponse.success(vo);
|
||||
return ApiResponse.success("店铺月销量目标更新成功", vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除店铺月销量目标", description = "删除指定店铺月销量目标")
|
||||
@@ -52,7 +52,7 @@ public class ShopMonthlyTargetController {
|
||||
public ApiResponse<Void> deleteShopMonthlyTarget(
|
||||
@Parameter(description = "目标ID") @PathVariable Long id) {
|
||||
shopMonthlyTargetService.deleteShopMonthlyTarget(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("店铺月销量目标删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取店铺月销量目标列表", description = "分页获取店铺月销量目标列表,支持条件过滤")
|
||||
@@ -61,7 +61,7 @@ public class ShopMonthlyTargetController {
|
||||
public ApiResponse<PageResultVO<ShopMonthlyTargetVO>> getShopMonthlyTargetPage(
|
||||
@Valid @RequestBody PageQueryDTO<ShopMonthlyTargetFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<ShopMonthlyTargetVO> result = shopMonthlyTargetService.getShopMonthlyTargetPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取店铺月销量目标列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取店铺月销量目标详情", description = "根据ID获取店铺月销量目标详情")
|
||||
@@ -70,6 +70,6 @@ public class ShopMonthlyTargetController {
|
||||
public ApiResponse<ShopMonthlyTargetVO> getShopMonthlyTargetById(
|
||||
@Parameter(description = "目标ID") @PathVariable Long id) {
|
||||
ShopMonthlyTargetVO vo = shopMonthlyTargetService.getShopMonthlyTargetById(id);
|
||||
return ApiResponse.success(vo);
|
||||
return ApiResponse.success("获取店铺月销量目标详情成功", vo);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -34,7 +34,7 @@ public class AccountController {
|
||||
@RequirePermission(value = "org:company:manage", description = "创建账户", allowSuper = true)
|
||||
public ApiResponse<AccountVO> createAccountForCompany(@Valid @RequestBody CreateAccountDTO createAccountDTO) {
|
||||
AccountVO accountVO = accountService.createAccountForCompany(createAccountDTO);
|
||||
return ApiResponse.success(accountVO);
|
||||
return ApiResponse.success("账户创建成功", accountVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询账户(管理员)", description = "公司管理员分页查询本公司账户")
|
||||
@@ -42,7 +42,7 @@ public class AccountController {
|
||||
@RequirePermission(value = "org:company:manage", description = "查询账户列表", allowSuper = true)
|
||||
public ApiResponse<PageResultVO<AccountVO>> getAccountPageForCompany(@Valid @RequestBody PageQueryDTO<AccountFilterDTO> pageQuery) {
|
||||
PageResultVO<AccountVO> pageResult = accountService.getAccountPageForCompany(pageQuery);
|
||||
return ApiResponse.success(pageResult);
|
||||
return ApiResponse.success("获取账户列表成功", pageResult);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新账户信息", description = "公司管理员更新本公司账户信息")
|
||||
@@ -52,7 +52,7 @@ public class AccountController {
|
||||
@Parameter(description = "账户ID", example = "1") @PathVariable Long accountId,
|
||||
@Valid @RequestBody UpdateAccountDTO updateAccountDTO) {
|
||||
AccountVO accountVO = accountService.updateAccountForCompany(updateAccountDTO, accountId);
|
||||
return ApiResponse.success(accountVO);
|
||||
return ApiResponse.success("账户更新成功", accountVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除账户", description = "逻辑删除账户")
|
||||
@@ -61,7 +61,7 @@ public class AccountController {
|
||||
public ApiResponse<Void> deleteAccount(
|
||||
@Parameter(description = "账户ID", example = "1") @PathVariable Long accountId) {
|
||||
accountService.deleteAccount(accountId);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("账户删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取账户详情", description = "获取账户详细信息")
|
||||
@@ -70,6 +70,6 @@ public class AccountController {
|
||||
public ApiResponse<AccountVO> getAccountDetail(
|
||||
@Parameter(description = "账户ID", example = "1") @PathVariable Long accountId) {
|
||||
AccountVO accountVO = accountService.getAccountDetail(accountId);
|
||||
return ApiResponse.success(accountVO);
|
||||
return ApiResponse.success("获取账户详情成功", accountVO);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -34,7 +34,7 @@ public class SuperAccountController {
|
||||
@RequirePermission(value = "org:company:manage", description = "创建账户", allowSuper = true)
|
||||
public ApiResponse<AccountVO> createAccount(@Valid @RequestBody SuperCreateAccountDTO superCreateAccountDTO) {
|
||||
AccountVO accountVO = superAccountService.createAccount(superCreateAccountDTO);
|
||||
return ApiResponse.success(accountVO);
|
||||
return ApiResponse.success("账户创建成功", accountVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询账户", description = "超级管理员分页查询所有账户")
|
||||
@@ -42,7 +42,7 @@ public class SuperAccountController {
|
||||
@RequirePermission(value = "org:company:manage", description = "查询账户列表", allowSuper = true)
|
||||
public ApiResponse<PageResultVO<AccountVO>> getAccountPage(@Valid @RequestBody PageQueryDTO<AccountFilterDTO> pageQuery) {
|
||||
PageResultVO<AccountVO> pageResult = superAccountService.getAccountPage(pageQuery);
|
||||
return ApiResponse.success(pageResult);
|
||||
return ApiResponse.success("获取账户列表成功", pageResult);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新账户信息", description = "超级管理员更新账户信息")
|
||||
@@ -52,7 +52,7 @@ public class SuperAccountController {
|
||||
@Parameter(description = "账户ID", example = "1") @PathVariable Long accountId,
|
||||
@Valid @RequestBody SuperUpdateAccountDTO superUpdateAccountDTO) {
|
||||
AccountVO accountVO = superAccountService.updateAccount(superUpdateAccountDTO, accountId);
|
||||
return ApiResponse.success(accountVO);
|
||||
return ApiResponse.success("账户更新成功", accountVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除账户", description = "超级管理员逻辑删除账户")
|
||||
@@ -61,7 +61,7 @@ public class SuperAccountController {
|
||||
public ApiResponse<Void> deleteAccount(
|
||||
@Parameter(description = "账户ID", example = "1") @PathVariable Long accountId) {
|
||||
superAccountService.deleteAccount(accountId);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("账户删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取账户详情", description = "超级管理员获取账户详细信息")
|
||||
@@ -70,6 +70,6 @@ public class SuperAccountController {
|
||||
public ApiResponse<AccountVO> getAccountDetail(
|
||||
@Parameter(description = "账户ID", example = "1") @PathVariable Long accountId) {
|
||||
AccountVO accountVO = superAccountService.getAccountDetail(accountId);
|
||||
return ApiResponse.success(accountVO);
|
||||
return ApiResponse.success("获取账户详情成功", accountVO);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -36,7 +36,7 @@ public class CompanyController {
|
||||
@RequirePermission(value = "org:company:create", description = "创建公司", allowSuper = true)
|
||||
public ApiResponse<CompanyVO> createCompany(@Valid @RequestBody CreateCompanyDTO createCompanyDTO) {
|
||||
CompanyVO companyVO = companyService.createCompany(createCompanyDTO);
|
||||
return ApiResponse.success(companyVO);
|
||||
return ApiResponse.success("公司创建成功", companyVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新公司", description = "更新现有公司信息")
|
||||
@@ -45,7 +45,7 @@ public class CompanyController {
|
||||
public ApiResponse<CompanyVO> updateCompany(@Valid @RequestBody UpdateCompanyDTO updateCompanyDTO,
|
||||
@PathVariable Long id) {
|
||||
CompanyVO companyVO = companyService.updateCompany(updateCompanyDTO, id);
|
||||
return ApiResponse.success(companyVO);
|
||||
return ApiResponse.success("公司更新成功", companyVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除公司", description = "删除指定公司")
|
||||
@@ -54,7 +54,7 @@ public class CompanyController {
|
||||
public ApiResponse<Void> deleteCompany(
|
||||
@Parameter(description = "公司ID") @PathVariable Long id) {
|
||||
companyService.deleteCompany(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("公司删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询公司列表", description = "分页查询公司列表,支持多种过滤条件")
|
||||
@@ -63,7 +63,7 @@ public class CompanyController {
|
||||
public ApiResponse<PageResultVO<CompanyVO>> getCompanyPage(
|
||||
@Valid @RequestBody PageQueryDTO<CompanyFilterDTO> pageQuery) {
|
||||
PageResultVO<CompanyVO> pageResult = companyService.getCompanyPage(pageQuery);
|
||||
return ApiResponse.success(pageResult);
|
||||
return ApiResponse.success("获取公司列表成功", pageResult);
|
||||
}
|
||||
|
||||
@Operation(summary = "上传公司Logo", description = "上传公司Logo图片")
|
||||
@@ -76,6 +76,6 @@ public class CompanyController {
|
||||
}
|
||||
|
||||
CompanyVO companyVO = companyService.uploadLogo(file);
|
||||
return ApiResponse.success(companyVO);
|
||||
return ApiResponse.success("公司Logo上传成功", companyVO);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -37,7 +37,7 @@ public class CompanyMemberController {
|
||||
@RequirePermission(value = "org:member:manage", description = "创建公司成员", allowSuper = true)
|
||||
public ApiResponse<CompanyMemberVO> create(@Valid @RequestBody CreateCompanyMemberDTO dto) {
|
||||
CompanyMemberVO vo = companyMemberService.create(dto);
|
||||
return ApiResponse.success(vo);
|
||||
return ApiResponse.success("公司成员创建成功", vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新成员职位", description = "更新成员的职位")
|
||||
@@ -47,7 +47,7 @@ public class CompanyMemberController {
|
||||
@Parameter(description = "成员ID") @PathVariable Long memberId,
|
||||
@RequestParam Long positionId) {
|
||||
CompanyMemberVO vo = companyMemberService.updatePosition(memberId, positionId);
|
||||
return ApiResponse.success(vo);
|
||||
return ApiResponse.success("成员职位更新成功", vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "变更成员角色", description = "变更成员的角色")
|
||||
@@ -57,7 +57,7 @@ public class CompanyMemberController {
|
||||
@Parameter(description = "成员ID") @PathVariable Long memberId,
|
||||
@RequestParam String role) {
|
||||
CompanyMemberVO vo = companyMemberService.changeRole(memberId, CompanyMemberRole.fromCode(role));
|
||||
return ApiResponse.success(vo);
|
||||
return ApiResponse.success("成员角色变更成功", vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "移除成员", description = "移除公司成员")
|
||||
@@ -65,7 +65,7 @@ public class CompanyMemberController {
|
||||
@RequirePermission(value = "org:member:manage", description = "移除成员", allowSuper = true)
|
||||
public ApiResponse<Void> remove(@Parameter(description = "成员ID") @PathVariable Long memberId) {
|
||||
companyMemberService.remove(memberId);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("成员移除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取公司所有成员", description = "获取指定公司的所有成员(含用户信息、职位名称)")
|
||||
@@ -74,7 +74,7 @@ public class CompanyMemberController {
|
||||
public ApiResponse<List<CompanyMemberVO>> getByCompanyId(
|
||||
@Parameter(description = "公司ID") @PathVariable Long companyId) {
|
||||
List<CompanyMemberVO> list = companyMemberService.getByCompanyId(companyId);
|
||||
return ApiResponse.success(list);
|
||||
return ApiResponse.success("获取公司成员列表成功", list);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取用户所属公司列表", description = "获取当前用户所属的所有公司列表")
|
||||
@@ -83,7 +83,7 @@ public class CompanyMemberController {
|
||||
public ApiResponse<List<CompanyMemberVO>> getByUserId(
|
||||
@Parameter(description = "用户ID") @PathVariable Long userId) {
|
||||
List<CompanyMemberVO> list = companyMemberService.getByUserId(userId);
|
||||
return ApiResponse.success(list);
|
||||
return ApiResponse.success("获取用户公司列表成功", list);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取当前用户的公司成员信息", description = "获取当前用户在公司中的成员信息")
|
||||
@@ -93,7 +93,7 @@ public class CompanyMemberController {
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
var member = companyMemberService.getByUserIdAndCompanyId(userId, companyId);
|
||||
if (member != null) {
|
||||
return ApiResponse.success(companyMemberService.convertToVO(member));
|
||||
return ApiResponse.success("获取当前公司成员信息成功", companyMemberService.convertToVO(member));
|
||||
}
|
||||
return ApiResponse.fail("用户不属于当前公司");
|
||||
}
|
||||
@@ -103,6 +103,6 @@ public class CompanyMemberController {
|
||||
public ApiResponse<List<CompanyMemberVO>> getCurrentUserAllMembers() {
|
||||
Long userId = currentUserContext.getCurrentUserId();
|
||||
List<CompanyMemberVO> list = companyMemberService.getByUserId(userId);
|
||||
return ApiResponse.success(list);
|
||||
return ApiResponse.success("获取用户所有公司成员信息成功", list);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -31,7 +31,7 @@ public class CompanyMenuController {
|
||||
public ApiResponse<List<Long>> getCompanyMenuIds(
|
||||
@Parameter(description = "公司ID") @PathVariable Long id) {
|
||||
List<Long> menuIds = companyMenuService.getCompanyMenuIds(id);
|
||||
return ApiResponse.success(menuIds);
|
||||
return ApiResponse.success("获取公司菜单ID列表成功", menuIds);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量更新公司菜单(超管)", description = "批量更新公司菜单状态,新增缺失的菜单,停用多余的菜单,启用已有的菜单")
|
||||
@@ -41,7 +41,7 @@ public class CompanyMenuController {
|
||||
@Parameter(description = "公司ID") @PathVariable Long id,
|
||||
@Parameter(description = "菜单ID列表") @RequestBody List<Long> menuIds) {
|
||||
companyMenuService.batchUpdateCompanyMenus(id, menuIds);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("公司菜单更新成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取公司所有菜单列表", description = "获取当前用户公司的所有菜单列表,包含公司菜单中间表ID,中间表只作为过滤条件,不覆盖系统菜单字段")
|
||||
@@ -49,7 +49,7 @@ public class CompanyMenuController {
|
||||
@RequirePermission(value = "org:company-menu:assign", description = "获取公司菜单列表", allowSuper = true)
|
||||
public ApiResponse<List<CompanyMenuVO>> getCompanyMenus() {
|
||||
List<CompanyMenuVO> menus = companyMenuService.getCompanyMenus();
|
||||
return ApiResponse.success(menus);
|
||||
return ApiResponse.success("获取公司菜单列表成功", menus);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取公司完整菜单树", description = "获取当前用户公司的完整菜单树结构,包含公司菜单中间表ID,中间表只作为过滤条件,不覆盖系统菜单字段")
|
||||
@@ -57,6 +57,6 @@ public class CompanyMenuController {
|
||||
@RequirePermission(value = "org:company-menu:assign", description = "获取公司菜单树", allowSuper = true)
|
||||
public ApiResponse<List<CompanyMenuVO>> getCompanyMenuTree() {
|
||||
List<CompanyMenuVO> menuTree = companyMenuService.getCompanyMenuTree();
|
||||
return ApiResponse.success(menuTree);
|
||||
return ApiResponse.success("获取公司菜单树成功", menuTree);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -33,7 +33,7 @@ public class CompanyPermissionController {
|
||||
public ApiResponse<Void> batchAssignCompanyPermissions(
|
||||
@Valid @RequestBody BatchAssignCompanyPermissionDTO batchAssignDTO) {
|
||||
companyPermissionService.batchAssignCompanyPermissions(batchAssignDTO);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("公司权限分配成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取公司权限列表(超管)", description = "获取指定公司的所有权限列表")
|
||||
@@ -42,7 +42,7 @@ public class CompanyPermissionController {
|
||||
public ApiResponse<List<PermissionVO>> getCompanyPermissions(
|
||||
@Parameter(description = "公司ID") @PathVariable Long companyId) {
|
||||
List<PermissionVO> permissions = companyPermissionService.getPermissionsByCompanyId(companyId);
|
||||
return ApiResponse.success(permissions);
|
||||
return ApiResponse.success("获取公司权限列表成功", permissions);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取公司权限ID列表(超管)", description = "获取指定公司的所有权限ID列表")
|
||||
@@ -51,7 +51,7 @@ public class CompanyPermissionController {
|
||||
public ApiResponse<List<Long>> getCompanyPermissionIds(
|
||||
@Parameter(description = "公司ID") @PathVariable Long companyId) {
|
||||
List<Long> permissionIds = companyPermissionService.getCompanyPermissionIds(companyId);
|
||||
return ApiResponse.success(permissionIds);
|
||||
return ApiResponse.success("获取公司权限ID列表成功", permissionIds);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量更新公司权限(超管)", description = "批量更新公司权限")
|
||||
@@ -61,6 +61,6 @@ public class CompanyPermissionController {
|
||||
@Parameter(description = "公司ID") @PathVariable Long companyId,
|
||||
@RequestBody List<Long> permissionIds) {
|
||||
companyPermissionService.batchUpdateCompanyPermissions(companyId, permissionIds);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("公司权限更新成功");
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -36,7 +36,7 @@ public class DepartmentController {
|
||||
@RequirePermission(value = "org:department:manage", description = "创建部门", allowSuper = true)
|
||||
public ApiResponse<DepartmentVO> createDepartment(@Valid @RequestBody CreateDepartmentDTO createDepartmentDTO) {
|
||||
DepartmentVO departmentVO = departmentService.createDepartment(createDepartmentDTO);
|
||||
return ApiResponse.success(departmentVO);
|
||||
return ApiResponse.success("部门创建成功", departmentVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新部门", description = "更新现有部门信息")
|
||||
@@ -45,7 +45,7 @@ public class DepartmentController {
|
||||
public ApiResponse<DepartmentVO> updateDepartment(@Valid @RequestBody UpdateDepartmentDTO updateDepartmentDTO,
|
||||
@PathVariable Long id) {
|
||||
DepartmentVO departmentVO = departmentService.updateDepartment(updateDepartmentDTO, id);
|
||||
return ApiResponse.success(departmentVO);
|
||||
return ApiResponse.success("部门更新成功", departmentVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除部门", description = "删除指定部门")
|
||||
@@ -54,7 +54,7 @@ public class DepartmentController {
|
||||
public ApiResponse<Void> deleteDepartment(
|
||||
@Parameter(description = "部门ID") @PathVariable Long id) {
|
||||
departmentService.deleteDepartment(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("部门删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取部门列表", description = "分页获取部门列表,支持条件过滤")
|
||||
@@ -63,7 +63,7 @@ public class DepartmentController {
|
||||
public ApiResponse<PageResultVO<DepartmentVO>> getDepartmentPage(
|
||||
@Valid @RequestBody PageQueryDTO<DepartmentFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<DepartmentVO> result = departmentService.getDepartmentPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取部门列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取全部部门", description = "获取当前公司全部部门列表")
|
||||
@@ -71,7 +71,7 @@ public class DepartmentController {
|
||||
@RequirePermission(value = "org:department:read", description = "查询全部部门", allowSuper = true)
|
||||
public ApiResponse<List<DepartmentVO>> getAllDepartments() {
|
||||
List<DepartmentVO> result = departmentService.getAllDepartments();
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取全部部门成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取部门树", description = "获取当前公司部门树形结构")
|
||||
@@ -79,6 +79,6 @@ public class DepartmentController {
|
||||
@RequirePermission(value = "org:department:read", description = "查询部门树", allowSuper = true)
|
||||
public ApiResponse<List<DepartmentVO>> getDepartmentTree() {
|
||||
List<DepartmentVO> result = departmentService.getDepartmentTree();
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取部门树成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -33,7 +33,7 @@ public class DepartmentMemberController {
|
||||
@RequirePermission(value = "org:department:manage", description = "添加部门成员", allowSuper = true)
|
||||
public ApiResponse<DepartmentMemberVO> addMember(@Valid @RequestBody AddDepartmentMemberDTO dto) {
|
||||
DepartmentMemberVO vo = departmentMemberService.addMember(dto);
|
||||
return ApiResponse.success(vo);
|
||||
return ApiResponse.success("部门成员添加成功", vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "移除部门成员", description = "从部门移除成员")
|
||||
@@ -41,7 +41,7 @@ public class DepartmentMemberController {
|
||||
@RequirePermission(value = "org:department:manage", description = "移除部门成员", allowSuper = true)
|
||||
public ApiResponse<Void> removeMember(@Valid @RequestBody RemoveDepartmentMemberDTO dto) {
|
||||
departmentMemberService.removeMember(dto.getDepartmentId(), dto.getUserId());
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("部门成员移除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取部门所有成员", description = "获取指定部门的所有成员(含用户信息)")
|
||||
@@ -50,7 +50,7 @@ public class DepartmentMemberController {
|
||||
public ApiResponse<List<DepartmentMemberVO>> getByDepartmentId(
|
||||
@Parameter(description = "部门ID") @PathVariable Long departmentId) {
|
||||
List<DepartmentMemberVO> list = departmentMemberService.getByDepartmentId(departmentId);
|
||||
return ApiResponse.success(list);
|
||||
return ApiResponse.success("获取部门成员列表成功", list);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取用户所属部门列表", description = "获取用户所属的所有部门列表")
|
||||
@@ -59,6 +59,6 @@ public class DepartmentMemberController {
|
||||
public ApiResponse<List<DepartmentMemberVO>> getByUserId(
|
||||
@Parameter(description = "用户ID") @PathVariable Long userId) {
|
||||
List<DepartmentMemberVO> list = departmentMemberService.getByUserId(userId);
|
||||
return ApiResponse.success(list);
|
||||
return ApiResponse.success("获取用户部门列表成功", list);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -34,7 +34,7 @@ public class PositionController {
|
||||
@RequirePermission(value = "org:position:manage", description = "创建岗位", allowSuper = true)
|
||||
public ApiResponse<PositionVO> createPosition(@Valid @RequestBody CreatePositionDTO createPositionDTO) {
|
||||
PositionVO positionVO = positionService.createPosition(createPositionDTO);
|
||||
return ApiResponse.success(positionVO);
|
||||
return ApiResponse.success("岗位创建成功", positionVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新岗位", description = "更新现有岗位信息")
|
||||
@@ -43,7 +43,7 @@ public class PositionController {
|
||||
public ApiResponse<PositionVO> updatePosition(@Valid @RequestBody UpdatePositionDTO updatePositionDTO,
|
||||
@PathVariable Long id) {
|
||||
PositionVO positionVO = positionService.updatePosition(updatePositionDTO, id);
|
||||
return ApiResponse.success(positionVO);
|
||||
return ApiResponse.success("岗位更新成功", positionVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除岗位", description = "删除指定岗位")
|
||||
@@ -52,7 +52,7 @@ public class PositionController {
|
||||
public ApiResponse<Void> deletePosition(
|
||||
@Parameter(description = "岗位ID") @PathVariable Long id) {
|
||||
positionService.deletePosition(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("岗位删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取岗位列表", description = "分页获取岗位列表,支持条件过滤")
|
||||
@@ -61,6 +61,6 @@ public class PositionController {
|
||||
public ApiResponse<PageResultVO<PositionVO>> getPositionPage(
|
||||
@Valid @RequestBody PageQueryDTO<PositionFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<PositionVO> result = positionService.getPositionPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取岗位列表成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -33,7 +33,7 @@ public class PositionPermissionController {
|
||||
@RequirePermission(value = "org:position-menu:assign", description = "批量分配职位菜单", allowSuper = true)
|
||||
public ApiResponse<Void> batchAssignPositionMenus(@Valid @RequestBody BatchAssignPositionMenuDTO batchAssignDTO) {
|
||||
positionMenuService.batchAssignPositionMenus(batchAssignDTO);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("职位菜单分配成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "移除职位菜单", description = "移除指定职位的某个菜单")
|
||||
@@ -43,7 +43,7 @@ public class PositionPermissionController {
|
||||
@Parameter(description = "职位ID") @PathVariable Long positionId,
|
||||
@Parameter(description = "菜单ID") @PathVariable Long menuId) {
|
||||
positionMenuService.removePositionMenu(positionId, menuId);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("职位菜单移除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "查询职位菜单列表", description = "根据职位ID查询该职位拥有的所有菜单")
|
||||
@@ -52,7 +52,7 @@ public class PositionPermissionController {
|
||||
public ApiResponse<List<PositionMenuVO>> getMenusByPositionId(
|
||||
@Parameter(description = "职位ID") @PathVariable Long positionId) {
|
||||
List<PositionMenuVO> menus = positionMenuService.getMenusByPositionId(positionId);
|
||||
return ApiResponse.success(menus);
|
||||
return ApiResponse.success("获取职位菜单列表成功", menus);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量查询职位菜单", description = "根据职位ID列表批量查询菜单")
|
||||
@@ -60,7 +60,7 @@ public class PositionPermissionController {
|
||||
@RequirePermission(value = "org:position-menu:assign", description = "批量查询职位菜单", allowSuper = true)
|
||||
public ApiResponse<List<PositionMenuVO>> getMenusByPositionIds(@RequestBody List<Long> positionIds) {
|
||||
List<PositionMenuVO> menus = positionMenuService.getMenusByPositionIds(positionIds);
|
||||
return ApiResponse.success(menus);
|
||||
return ApiResponse.success("批量获取职位菜单成功", menus);
|
||||
}
|
||||
|
||||
@Operation(summary = "检查职位菜单", description = "检查指定职位是否拥有某个菜单")
|
||||
@@ -70,7 +70,7 @@ public class PositionPermissionController {
|
||||
@Parameter(description = "职位ID") @PathVariable Long positionId,
|
||||
@Parameter(description = "菜单ID") @PathVariable Long menuId) {
|
||||
boolean hasPermission = positionMenuService.hasPositionMenu(positionId, menuId);
|
||||
return ApiResponse.success(hasPermission);
|
||||
return ApiResponse.success("检查职位菜单成功", hasPermission);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取职位所有菜单ID", description = "获取指定职位的所有菜单ID列表")
|
||||
@@ -79,7 +79,7 @@ public class PositionPermissionController {
|
||||
public ApiResponse<List<Long>> getPositionMenuIds(
|
||||
@Parameter(description = "职位ID") @PathVariable Long positionId) {
|
||||
List<Long> menuIds = positionMenuService.getPositionMenuIds(positionId);
|
||||
return ApiResponse.success(menuIds);
|
||||
return ApiResponse.success("获取职位菜单ID列表成功", menuIds);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量更新职位菜单", description = "批量更新职位菜单")
|
||||
@@ -89,6 +89,6 @@ public class PositionPermissionController {
|
||||
@Parameter(description = "职位ID") @PathVariable Long positionId,
|
||||
@Parameter(description = "菜单ID列表") @RequestBody List<Long> menuIds) {
|
||||
positionMenuService.batchUpdatePositionMenus(positionId, menuIds);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("职位菜单更新成功");
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -34,7 +34,7 @@ public class PositionPermissionManagementController {
|
||||
public ApiResponse<Void> batchAssignPositionPermissions(
|
||||
@Valid @RequestBody BatchAssignPositionPermissionDTO batchAssignDTO) {
|
||||
positionPermissionService.batchAssignPositionPermissions(batchAssignDTO);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("岗位权限分配成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "移除岗位权限", description = "移除指定岗位的某个权限")
|
||||
@@ -44,7 +44,7 @@ public class PositionPermissionManagementController {
|
||||
@Parameter(description = "岗位ID") @PathVariable Long positionId,
|
||||
@Parameter(description = "权限ID") @PathVariable Long permissionId) {
|
||||
positionPermissionService.removePositionPermission(positionId, permissionId);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("岗位权限移除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "查询岗位权限列表", description = "根据岗位ID查询该岗位拥有的所有权限")
|
||||
@@ -53,7 +53,7 @@ public class PositionPermissionManagementController {
|
||||
public ApiResponse<List<PositionPermissionVO>> getPermissionsByPositionId(
|
||||
@Parameter(description = "岗位ID") @PathVariable Long positionId) {
|
||||
List<PositionPermissionVO> permissions = positionPermissionService.getPermissionsByPositionId(positionId);
|
||||
return ApiResponse.success(permissions);
|
||||
return ApiResponse.success("获取岗位权限列表成功", permissions);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量查询岗位权限", description = "根据岗位ID列表批量查询权限")
|
||||
@@ -61,7 +61,7 @@ public class PositionPermissionManagementController {
|
||||
@RequirePermission(value = "org:position-permission:assign", description = "批量查询岗位权限", allowSuper = true)
|
||||
public ApiResponse<List<PositionPermissionVO>> getPermissionsByPositionIds(@RequestBody List<Long> positionIds) {
|
||||
List<PositionPermissionVO> permissions = positionPermissionService.getPermissionsByPositionIds(positionIds);
|
||||
return ApiResponse.success(permissions);
|
||||
return ApiResponse.success("批量获取岗位权限成功", permissions);
|
||||
}
|
||||
|
||||
@Operation(summary = "检查岗位权限", description = "检查指定岗位是否拥有某个权限")
|
||||
@@ -71,7 +71,7 @@ public class PositionPermissionManagementController {
|
||||
@Parameter(description = "岗位ID") @PathVariable Long positionId,
|
||||
@Parameter(description = "权限ID") @PathVariable Long permissionId) {
|
||||
boolean hasPermission = positionPermissionService.hasPositionPermission(positionId, permissionId);
|
||||
return ApiResponse.success(hasPermission);
|
||||
return ApiResponse.success("检查岗位权限成功", hasPermission);
|
||||
}
|
||||
|
||||
@Operation(summary = "检查岗位权限码", description = "检查指定岗位是否拥有某个权限码")
|
||||
@@ -81,7 +81,7 @@ public class PositionPermissionManagementController {
|
||||
@Parameter(description = "岗位ID") @PathVariable Long positionId,
|
||||
@Parameter(description = "权限码") @PathVariable String permissionCode) {
|
||||
boolean hasPermission = positionPermissionService.hasPositionPermissionByCode(positionId, permissionCode);
|
||||
return ApiResponse.success(hasPermission);
|
||||
return ApiResponse.success("检查岗位权限码成功", hasPermission);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取岗位所有权限ID", description = "获取指定岗位的所有权限ID列表")
|
||||
@@ -90,7 +90,7 @@ public class PositionPermissionManagementController {
|
||||
public ApiResponse<List<Long>> getPositionPermissionIds(
|
||||
@Parameter(description = "岗位ID") @PathVariable Long positionId) {
|
||||
List<Long> permissionIds = positionPermissionService.getPositionPermissionIds(positionId);
|
||||
return ApiResponse.success(permissionIds);
|
||||
return ApiResponse.success("获取岗位权限ID列表成功", permissionIds);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取岗位所有权限码", description = "获取指定岗位的所有权限码列表")
|
||||
@@ -99,7 +99,7 @@ public class PositionPermissionManagementController {
|
||||
public ApiResponse<List<String>> getPositionPermissionCodes(
|
||||
@Parameter(description = "岗位ID") @PathVariable Long positionId) {
|
||||
List<String> permissionCodes = positionPermissionService.getPositionPermissionCodes(positionId);
|
||||
return ApiResponse.success(permissionCodes);
|
||||
return ApiResponse.success("获取岗位权限码列表成功", permissionCodes);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量更新岗位权限", description = "批量更新岗位权限")
|
||||
@@ -109,6 +109,6 @@ public class PositionPermissionManagementController {
|
||||
@Parameter(description = "岗位ID") @PathVariable Long positionId,
|
||||
@Parameter(description = "权限ID列表") @RequestBody List<Long> permissionIds) {
|
||||
positionPermissionService.batchUpdatePositionPermissions(positionId, permissionIds);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("岗位权限更新成功");
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -35,7 +35,7 @@ public class PlanController {
|
||||
@RequirePermission(value = "system:company:manage", description = "创建套餐", allowSuper = true)
|
||||
public ApiResponse<PlanVO> createPlan(@Valid @RequestBody CreatePlanDTO createPlanDTO) {
|
||||
PlanVO planVO = planService.createPlan(createPlanDTO);
|
||||
return ApiResponse.success(planVO);
|
||||
return ApiResponse.success("套餐创建成功", planVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新套餐", description = "更新现有套餐信息")
|
||||
@@ -44,7 +44,7 @@ public class PlanController {
|
||||
public ApiResponse<PlanVO> updatePlan(@Valid @RequestBody UpdatePlanDTO updatePlanDTO,
|
||||
@PathVariable Long planId) {
|
||||
PlanVO planVO = planService.updatePlan(updatePlanDTO, planId);
|
||||
return ApiResponse.success(planVO);
|
||||
return ApiResponse.success("套餐更新成功", planVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除套餐", description = "删除指定套餐")
|
||||
@@ -53,7 +53,7 @@ public class PlanController {
|
||||
public ApiResponse<Void> deletePlan(
|
||||
@Parameter(description = "套餐ID") @PathVariable Long planId) {
|
||||
planService.deletePlan(planId);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("套餐删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取套餐列表", description = "分页获取套餐列表,支持条件过滤")
|
||||
@@ -62,6 +62,6 @@ public class PlanController {
|
||||
public ApiResponse<PageResultVO<PlanListVO>> getPlanPage(
|
||||
@Valid @RequestBody PageQueryDTO<PlanFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<PlanListVO> result = planService.getPlanPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取套餐列表成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -35,7 +35,7 @@ public class PlanPricingController {
|
||||
@RequirePermission(value = "system:company:manage", description = "创建定价", allowSuper = true)
|
||||
public ApiResponse<PlanPricingVO> createPlanPricing(@Valid @RequestBody CreatePlanPricingDTO createPlanPricingDTO) {
|
||||
PlanPricingVO planPricingVO = planPricingService.createPlanPricing(createPlanPricingDTO);
|
||||
return ApiResponse.success(planPricingVO);
|
||||
return ApiResponse.success("套餐定价创建成功", planPricingVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新定价", description = "更新现有定价信息")
|
||||
@@ -44,7 +44,7 @@ public class PlanPricingController {
|
||||
public ApiResponse<PlanPricingVO> updatePlanPricing(@Valid @RequestBody UpdatePlanPricingDTO updatePlanPricingDTO,
|
||||
@PathVariable Long id) {
|
||||
PlanPricingVO planPricingVO = planPricingService.updatePlanPricing(updatePlanPricingDTO, id);
|
||||
return ApiResponse.success(planPricingVO);
|
||||
return ApiResponse.success("套餐定价更新成功", planPricingVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除定价", description = "删除指定定价")
|
||||
@@ -53,7 +53,7 @@ public class PlanPricingController {
|
||||
public ApiResponse<Void> deletePlanPricing(
|
||||
@Parameter(description = "定价ID") @PathVariable Long id) {
|
||||
planPricingService.deletePlanPricing(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("套餐定价删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取定价列表", description = "分页获取定价列表,支持条件过滤")
|
||||
@@ -62,6 +62,6 @@ public class PlanPricingController {
|
||||
public ApiResponse<PageResultVO<PlanPricingListVO>> getPlanPricingPage(
|
||||
@Valid @RequestBody PageQueryDTO<PlanPricingFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<PlanPricingListVO> result = planPricingService.getPlanPricingPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取套餐定价列表成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -36,7 +36,7 @@ public class SubscriptionController {
|
||||
public ApiResponse<SubscriptionVO> createSubscription(
|
||||
@Valid @RequestBody CreateSubscriptionDTO createSubscriptionDTO) {
|
||||
SubscriptionVO subscriptionVO = subscriptionService.createSubscription(createSubscriptionDTO);
|
||||
return ApiResponse.success(subscriptionVO);
|
||||
return ApiResponse.success("订阅创建成功", subscriptionVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新订阅", description = "更新现有订阅信息")
|
||||
@@ -46,7 +46,7 @@ public class SubscriptionController {
|
||||
@Valid @RequestBody UpdateSubscriptionDTO updateSubscriptionDTO,
|
||||
@PathVariable Long id) {
|
||||
SubscriptionVO subscriptionVO = subscriptionService.updateSubscription(updateSubscriptionDTO, id);
|
||||
return ApiResponse.success(subscriptionVO);
|
||||
return ApiResponse.success("订阅更新成功", subscriptionVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除订阅", description = "删除指定订阅")
|
||||
@@ -55,7 +55,7 @@ public class SubscriptionController {
|
||||
public ApiResponse<Void> deleteSubscription(
|
||||
@Parameter(description = "订阅ID") @PathVariable Long id) {
|
||||
subscriptionService.deleteSubscription(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("订阅删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取订阅列表", description = "分页获取订阅列表,支持条件过滤")
|
||||
@@ -64,6 +64,6 @@ public class SubscriptionController {
|
||||
public ApiResponse<PageResultVO<SubscriptionListVO>> getSubscriptionPage(
|
||||
@Valid @RequestBody PageQueryDTO<SubscriptionFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<SubscriptionListVO> result = subscriptionService.getSubscriptionPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取订阅列表成功", result);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -38,21 +38,21 @@ public class AuthController {
|
||||
@PostMapping("/register")
|
||||
public ApiResponse<LoginVO> register(@Valid @RequestBody RegisterDTO registerDTO) {
|
||||
LoginVO loginVO = userService.register(registerDTO);
|
||||
return ApiResponse.success(loginVO);
|
||||
return ApiResponse.success("用户注册成功", loginVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "用户登录", description = "用户登录接口,支持通过登录账号或手机号码登录")
|
||||
@PostMapping("/login")
|
||||
public ApiResponse<LoginVO> login(@Valid @RequestBody LoginDTO loginDTO) {
|
||||
LoginVO loginVO = userService.login(loginDTO);
|
||||
return ApiResponse.success(loginVO);
|
||||
return ApiResponse.success("用户登录成功", loginVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "刷新访问令牌", description = "使用刷新令牌获取新的访问令牌")
|
||||
@PostMapping("/refresh")
|
||||
public ApiResponse<LoginVO> refreshToken(@Valid @RequestBody RefreshTokenDTO refreshTokenDTO) {
|
||||
LoginVO loginVO = userService.refreshToken(refreshTokenDTO);
|
||||
return ApiResponse.success(loginVO);
|
||||
return ApiResponse.success("令牌刷新成功", loginVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "切换账户", description = "超级管理员切换到指定用户账户,角色保持为super")
|
||||
@@ -60,7 +60,7 @@ public class AuthController {
|
||||
public ApiResponse<LoginVO> switchAccount(
|
||||
@Parameter(description = "目标用户ID") @PathVariable Long userId) {
|
||||
LoginVO loginVO = userService.switchAccount(userId);
|
||||
return ApiResponse.success(loginVO);
|
||||
return ApiResponse.success("账户切换成功", loginVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取用户权限码", description = "获取当前登录用户的权限码列表")
|
||||
@@ -91,10 +91,10 @@ public class AuthController {
|
||||
permissions = List.of();
|
||||
}
|
||||
|
||||
return ApiResponse.success(permissions);
|
||||
return ApiResponse.success("获取权限码成功", permissions);
|
||||
} catch (Exception e) {
|
||||
// 如果获取权限失败,返回空列表
|
||||
return ApiResponse.success(List.of());
|
||||
return ApiResponse.success("获取权限码成功", List.of());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -38,35 +38,35 @@ public class SysFileController {
|
||||
@PostMapping("/batch-upload")
|
||||
public ApiResponse<List<SysFileUploadVO>> batchUploadFiles(@RequestParam("files") List<MultipartFile> files) {
|
||||
List<SysFileUploadVO> result = sysFileService.batchUploadFiles(files);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("文件批量上传成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量获取Header签名", description = "批量获取OSS文件上传Header签名(V1签名方式,HMAC-SHA1),如果文件已存在则返回文件信息")
|
||||
@PostMapping("/batch-sign-url")
|
||||
public ApiResponse<BatchSignUrlVO> batchSignUrl(@Valid @RequestBody BatchSignUrlDTO dto) {
|
||||
BatchSignUrlVO result = sysFileService.batchSignUrl(dto);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取批量签名URL成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量创建OSS文件记录", description = "前端上传OSS文件成功后,批量创建文件记录")
|
||||
@PostMapping("/batch-create-oss")
|
||||
public ApiResponse<List<SysFileVO>> batchCreateOssFiles(@Valid @RequestBody BatchCreateOssFileDTO dto) {
|
||||
List<SysFileVO> result = sysFileService.batchCreateOssFiles(dto);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("创建OSS文件记录成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取文件访问URL", description = "通过文件ID获取文件访问URL")
|
||||
@GetMapping("/{fileId}/access-url")
|
||||
public ApiResponse<String> getFileAccessUrl(@PathVariable Long fileId) {
|
||||
String accessUrl = sysFileService.getFileAccessUrl(fileId);
|
||||
return ApiResponse.success(accessUrl);
|
||||
return ApiResponse.success("获取文件访问URL成功", accessUrl);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取文件列表", description = "分页获取当前公司的文件列表,支持条件过滤")
|
||||
@PostMapping("/page")
|
||||
public ApiResponse<PageResultVO<SysFileVO>> getFilePage(@Valid @RequestBody PageQueryDTO<SysFileFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<SysFileVO> result = sysFileService.getFilePage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
return ApiResponse.success("获取文件列表成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除文件")
|
||||
@@ -74,7 +74,7 @@ public class SysFileController {
|
||||
@RequireRole(description = "删除文件")
|
||||
public ApiResponse<Void> deleteFile(@PathVariable Long fileId) {
|
||||
sysFileService.deleteFile(fileId);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("文件删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "更新文件元信息")
|
||||
@@ -82,7 +82,7 @@ public class SysFileController {
|
||||
@RequireRole(description = "更新文件")
|
||||
public ApiResponse<Void> updateFile(@PathVariable Long fileId, @Valid @RequestBody SysFileUpdateDTO dto) {
|
||||
sysFileService.updateFile(fileId, dto);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("文件信息更新成功");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -34,7 +34,7 @@ public class MenuController {
|
||||
@RequirePermission(value = "system:menu:create", description = "创建菜单", allowSuper = true)
|
||||
public ApiResponse<MenuVO> createMenu(@Valid @RequestBody CreateMenuDTO createMenuDTO) {
|
||||
MenuVO menuVO = menuService.createMenu(createMenuDTO);
|
||||
return ApiResponse.success(menuVO);
|
||||
return ApiResponse.success("菜单创建成功", menuVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新菜单", description = "更新现有菜单信息")
|
||||
@@ -43,7 +43,7 @@ public class MenuController {
|
||||
public ApiResponse<MenuVO> updateMenu(@Valid @RequestBody UpdateMenuDTO updateMenuDTO,
|
||||
@PathVariable Long id) {
|
||||
MenuVO menuVO = menuService.updateMenu(updateMenuDTO, id);
|
||||
return ApiResponse.success(menuVO);
|
||||
return ApiResponse.success("菜单更新成功", menuVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除菜单", description = "删除指定菜单")
|
||||
@@ -52,7 +52,7 @@ public class MenuController {
|
||||
public ApiResponse<Void> deleteMenu(
|
||||
@Parameter(description = "菜单ID") @PathVariable Long id) {
|
||||
menuService.deleteMenu(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("菜单删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取菜单树", description = "获取完整的菜单树结构")
|
||||
@@ -60,7 +60,7 @@ public class MenuController {
|
||||
@RequirePermission(value = "system:menu:read", description = "获取菜单树", allowSuper = true)
|
||||
public ApiResponse<List<MenuVO>> getMenuTree() {
|
||||
List<MenuVO> menuTree = menuService.getMenuTree();
|
||||
return ApiResponse.success(menuTree);
|
||||
return ApiResponse.success("获取菜单树成功", menuTree);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取所有菜单", description = "获取所有菜单的列表")
|
||||
@@ -68,7 +68,7 @@ public class MenuController {
|
||||
@RequirePermission(value = "system:menu:read", description = "获取所有菜单", allowSuper = true)
|
||||
public ApiResponse<List<MenuVO>> getAllMenus() {
|
||||
List<MenuVO> menuList = menuService.getAllMenus();
|
||||
return ApiResponse.success(menuList);
|
||||
return ApiResponse.success("获取菜单列表成功", menuList);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取菜单详情", description = "根据ID获取菜单详细信息")
|
||||
@@ -77,7 +77,7 @@ public class MenuController {
|
||||
public ApiResponse<MenuVO> getMenuDetail(
|
||||
@Parameter(description = "菜单ID") @PathVariable Long id) {
|
||||
MenuVO menuVO = menuService.getMenuDetail(id);
|
||||
return ApiResponse.success(menuVO);
|
||||
return ApiResponse.success("获取菜单详情成功", menuVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量菜单排序", description = "批量更新菜单的排序值")
|
||||
@@ -85,7 +85,7 @@ public class MenuController {
|
||||
@RequirePermission(value = "system:menu:update", description = "批量菜单排序", allowSuper = true)
|
||||
public ApiResponse<Void> batchSortMenu(@Valid @RequestBody BatchSortMenuDTO batchSortMenuDTO) {
|
||||
menuService.batchSortMenu(batchSortMenuDTO);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("菜单排序成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ public class MenuPermissionController {
|
||||
@RequirePermission(value = "system:menu:update", description = "添加菜单权限映射", allowSuper = true)
|
||||
public ApiResponse<MenuPermissionVO> addMenuPermission(@Valid @RequestBody AddMenuPermissionDTO addMenuPermissionDTO) {
|
||||
MenuPermissionVO menuPermissionVO = menuPermissionService.addMenuPermission(addMenuPermissionDTO);
|
||||
return ApiResponse.success(menuPermissionVO);
|
||||
return ApiResponse.success("菜单权限映射添加成功", menuPermissionVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除菜单权限映射", description = "删除指定菜单的权限映射")
|
||||
@@ -39,7 +39,7 @@ public class MenuPermissionController {
|
||||
@RequirePermission(value = "system:menu:update", description = "删除菜单权限映射", allowSuper = true)
|
||||
public ApiResponse<Void> removeMenuPermission(@Valid @RequestBody RemoveMenuPermissionDTO removeMenuPermissionDTO) {
|
||||
menuPermissionService.removeMenuPermission(removeMenuPermissionDTO);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("菜单权限映射删除成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-11
@@ -40,7 +40,7 @@ public class PermissionController {
|
||||
@RequirePermission(value = "system:permission:manage", description = "创建权限", allowSuper = true)
|
||||
public ApiResponse<PermissionVO> createPermission(@Valid @RequestBody CreatePermissionDTO createPermissionDTO) {
|
||||
PermissionVO permissionVO = permissionService.createPermission(createPermissionDTO);
|
||||
return ApiResponse.success(permissionVO);
|
||||
return ApiResponse.success("权限创建成功", permissionVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新权限", description = "更新现有权限信息")
|
||||
@@ -49,7 +49,7 @@ public class PermissionController {
|
||||
public ApiResponse<PermissionVO> updatePermission(@Valid @RequestBody UpdatePermissionDTO updatePermissionDTO,
|
||||
@PathVariable Long id) {
|
||||
PermissionVO permissionVO = permissionService.updatePermission(updatePermissionDTO, id);
|
||||
return ApiResponse.success(permissionVO);
|
||||
return ApiResponse.success("权限更新成功", permissionVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除权限", description = "删除指定权限")
|
||||
@@ -58,7 +58,7 @@ public class PermissionController {
|
||||
public ApiResponse<Void> deletePermission(
|
||||
@Parameter(description = "权限ID") @PathVariable Long id) {
|
||||
permissionService.deletePermission(id);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("权限删除成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "分页获取权限列表", description = "根据条件分页获取权限列表")
|
||||
@@ -67,7 +67,7 @@ public class PermissionController {
|
||||
public ApiResponse<PageResultVO<PermissionVO>> getPermissionPage(
|
||||
@Valid @RequestBody PageQueryDTO<PermissionFilterDTO> filterDTO) {
|
||||
PageResultVO<PermissionVO> pageResult = permissionService.getPermissionPage(filterDTO);
|
||||
return ApiResponse.success(pageResult);
|
||||
return ApiResponse.success("获取权限列表成功", pageResult);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取权限详情", description = "根据ID获取权限详细信息")
|
||||
@@ -76,7 +76,7 @@ public class PermissionController {
|
||||
public ApiResponse<PermissionVO> getPermissionDetail(
|
||||
@Parameter(description = "权限ID") @PathVariable Long id) {
|
||||
PermissionVO permissionVO = permissionService.getPermissionDetail(id);
|
||||
return ApiResponse.success(permissionVO);
|
||||
return ApiResponse.success("获取权限详情成功", permissionVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取所有权限", description = "获取所有启用的权限列表")
|
||||
@@ -84,7 +84,7 @@ public class PermissionController {
|
||||
@RequirePermission(value = "system:permission:read", description = "获取所有权限", allowSuper = true)
|
||||
public ApiResponse<List<PermissionVO>> getAllPermissions() {
|
||||
List<PermissionVO> permissionList = permissionService.getAllPermissions();
|
||||
return ApiResponse.success(permissionList);
|
||||
return ApiResponse.success("获取所有权限成功", permissionList);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取权限树", description = "获取权限树状结构(用于前端展示)")
|
||||
@@ -92,7 +92,7 @@ public class PermissionController {
|
||||
@RequirePermission(value = "system:permission:read", description = "获取权限树", allowSuper = true)
|
||||
public ApiResponse<List<PermissionVO>> getPermissionTree() {
|
||||
List<PermissionVO> tree = permissionService.getPermissionTree();
|
||||
return ApiResponse.success(tree);
|
||||
return ApiResponse.success("获取权限树成功", tree);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取公司可见的权限树", description = "只返回当前用户所属公司的已分配权限及其祖先节点")
|
||||
@@ -101,7 +101,7 @@ public class PermissionController {
|
||||
public ApiResponse<List<PermissionVO>> getCompanyVisiblePermissionTree() {
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
List<PermissionVO> tree = permissionService.getCompanyVisiblePermissionTree(companyId);
|
||||
return ApiResponse.success(tree);
|
||||
return ApiResponse.success("获取公司可见权限树成功", tree);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取职位可见的权限树", description = "只返回已分配权限及其祖先节点")
|
||||
@@ -110,7 +110,7 @@ public class PermissionController {
|
||||
public ApiResponse<List<PermissionVO>> getPositionVisiblePermissionTree(
|
||||
@Parameter(description = "职位ID") @PathVariable Long positionId) {
|
||||
List<PermissionVO> tree = permissionService.getPositionVisiblePermissionTree(positionId);
|
||||
return ApiResponse.success(tree);
|
||||
return ApiResponse.success("获取职位可见权限树成功", tree);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取系统权限树", description = "返回全量权限树(整个平台的权限,用于平台超管管理)")
|
||||
@@ -118,7 +118,7 @@ public class PermissionController {
|
||||
@RequirePermission(value = "system:permission:read", description = "获取系统权限树", allowSuper = true)
|
||||
public ApiResponse<List<PermissionVO>> getSystemPermissionTree() {
|
||||
List<PermissionVO> tree = permissionService.getSystemPermissionTree();
|
||||
return ApiResponse.success(tree);
|
||||
return ApiResponse.success("获取系统权限树成功", tree);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量更新权限排序")
|
||||
@@ -127,6 +127,6 @@ public class PermissionController {
|
||||
public ApiResponse<Void> batchSortPermission(
|
||||
@RequestBody @Valid BatchSortPermissionDTO dto) {
|
||||
permissionService.batchSortPermission(dto);
|
||||
return ApiResponse.success(null);
|
||||
return ApiResponse.<Void>success("权限排序更新成功", null);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -40,7 +40,7 @@ public class UserController {
|
||||
@GetMapping("/info")
|
||||
public ApiResponse<UserVO> getUserInfo() {
|
||||
UserVO userVO = userService.getCurrentUserInfo();
|
||||
return ApiResponse.success(userVO);
|
||||
return ApiResponse.success("获取用户信息成功", userVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新用户信息", description = "更新当前登录用户的基本信息")
|
||||
@@ -48,14 +48,14 @@ public class UserController {
|
||||
@RequirePermission(value = "system:user:update", description = "更新用户信息", allowSuper = true)
|
||||
public ApiResponse<UserVO> updateUserInfo(@Valid @RequestBody UpdateUserInfoDTO updateUserInfoDTO) {
|
||||
UserVO userVO = userService.updateCurrentUserInfo(updateUserInfoDTO);
|
||||
return ApiResponse.success(userVO);
|
||||
return ApiResponse.success("用户信息更新成功", userVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改密码", description = "修改当前登录用户的密码")
|
||||
@PostMapping("/change-password")
|
||||
public ApiResponse<Void> changePassword(@Valid @RequestBody ChangePasswordDTO changePasswordDTO) {
|
||||
userService.changePassword(changePasswordDTO);
|
||||
return ApiResponse.success();
|
||||
return ApiResponse.success("密码修改成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "上传用户头像", description = "上传用户头像图片")
|
||||
@@ -68,14 +68,14 @@ public class UserController {
|
||||
}
|
||||
|
||||
UserVO userVO = userService.uploadAvatar(file);
|
||||
return ApiResponse.success(userVO);
|
||||
return ApiResponse.success("头像上传成功", userVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取用户菜单", description = "根据用户角色获取对应的菜单,用于前端动态路由")
|
||||
@GetMapping("/menu")
|
||||
public ApiResponse<List<UserMenuVO>> getUserMenus() {
|
||||
List<UserMenuVO> userMenuVOS = userMenuService.getUserMenus();
|
||||
return ApiResponse.success(userMenuVOS);
|
||||
return ApiResponse.success("获取用户菜单成功", userMenuVOS);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询用户列表", description = "分页查询用户列表,支持多种过滤条件")
|
||||
@@ -84,6 +84,6 @@ public class UserController {
|
||||
public ApiResponse<PageResultVO<UserVO>> getUserPage(
|
||||
@Valid @RequestBody PageQueryDTO<UserFilterDTO> pageQuery) {
|
||||
PageResultVO<UserVO> pageResult = userService.getUserPage(pageQuery);
|
||||
return ApiResponse.success(pageResult);
|
||||
return ApiResponse.success("获取用户列表成功", pageResult);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user