diff --git a/ecom-dmb-backend/README.md b/ecom-dmb-backend/README.md index 5b431a46..78dd4d1b 100644 --- a/ecom-dmb-backend/README.md +++ b/ecom-dmb-backend/README.md @@ -10,7 +10,6 @@ - MongoDB(BI 聚合统计) - RabbitMQ(业务消息队列) - JWT 认证(HS512) -- Knife4j API 文档 - Lombok + MapStruct ## 环境要求 @@ -49,10 +48,6 @@ cd ecom-dmb-backend ./mvnw spring-boot:run -Dspring-boot.run.arguments="--server.port=8080" ``` -## 接口文档 - -启动后访问:http://localhost:8080/doc.html - ## 项目结构 ``` diff --git a/ecom-dmb-backend/pom.xml b/ecom-dmb-backend/pom.xml index 53a95b09..64636dd9 100644 --- a/ecom-dmb-backend/pom.xml +++ b/ecom-dmb-backend/pom.xml @@ -69,12 +69,6 @@ ${lombok.version} true - - - com.github.xiaoymin - knife4j-openapi3-jakarta-spring-boot-starter - 4.5.0 - org.springframework.boot diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/Knife4jConfig.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/Knife4jConfig.java deleted file mode 100644 index 1b45b24d..00000000 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/Knife4jConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package top.xyquan.ecomdmbbackend.common.config; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * Knife4j配置 - */ -@Configuration -public class Knife4jConfig { - - @Bean - public OpenAPI customOpenAPI() { - return new OpenAPI() - .info(new Info() - .title("ECOM-DMB-Backend API") - .description("ECOM-DMB-Backend 后端服务API文档,支持多模块接口管理") - .version("1.0.0") - .contact(new Contact() - .name("开发团队") - .email("1564467676@qq.com") - .url("https://xyquan.top")) - .license(new License() - .name("MIT License") - .url("https://xyquan.top/licenses/MIT"))); - } -} diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/SecurityConfig.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/SecurityConfig.java index 08dbbbfc..e32b35f1 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/SecurityConfig.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/SecurityConfig.java @@ -58,9 +58,6 @@ public class SecurityConfig { .requestMatchers("/api/auth/login", "/api/auth/register", "/api/auth/refresh").permitAll() .requestMatchers("/api/channel/pdd/auth/callback").permitAll() .requestMatchers("/uploads/**").permitAll() // 允许直接访问上传的文件 - .requestMatchers("/doc.html", "/webjars/**", "/v3/api-docs/**", "/swagger-resources/**", - "/swagger-ui/**", "/swagger-ui.html") - .permitAll() .anyRequest().authenticated()) .exceptionHandling(exceptions -> exceptions .authenticationEntryPoint(new CustomAuthenticationEntryPoint()) diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/WebConfig.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/WebConfig.java index 0869f0da..0361ebcc 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/WebConfig.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/config/WebConfig.java @@ -21,13 +21,6 @@ public class WebConfig implements WebMvcConfigurer { // 配置上传文件访问 - 使用绝对路径 registry.addResourceHandler("/uploads/**") .addResourceLocations("file:./uploads/"); - - // 配置Swagger UI资源 - registry.addResourceHandler("/swagger-ui/**") - .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/"); - - registry.addResourceHandler("/webjars/**") - .addResourceLocations("classpath:/META-INF/resources/webjars/"); } @Override diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/model/dto/PageQueryDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/model/dto/PageQueryDTO.java index 608324eb..b3abfb30 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/model/dto/PageQueryDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/model/dto/PageQueryDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.common.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Min; import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; @@ -12,7 +11,6 @@ import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor -@Schema(description = "分页查询DTO") public class PageQueryDTO { //页码,从1开始 @@ -29,6 +27,5 @@ public class PageQueryDTO { private T filters; // 排序规则列表(优先级从高到低) - @Schema(description = "排序规则列表,优先级从高到低,支持多字段排序") private List sorts; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/model/dto/SortDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/model/dto/SortDTO.java index 6a1190f1..08f8044e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/model/dto/SortDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/common/model/dto/SortDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.common.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.AllArgsConstructor; import lombok.Data; @@ -12,19 +11,16 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -@Schema(description = "排序参数DTO") public class SortDTO { /** * 排序字段名(对应数据库字段名) */ @NotBlank(message = "排序字段不能为空") - @Schema(description = "排序字段名(对应数据库字段名)", example = "order_time") private String field; /** * 排序规则:asc | desc */ - @Schema(description = "排序规则:asc(升序) | desc(降序)", example = "desc") private String order = "desc"; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/CategoryExportDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/CategoryExportDTO.java index e63bbb98..97a208ef 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/CategoryExportDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/CategoryExportDTO.java @@ -1,7 +1,6 @@ package top.xyquan.ecomdmbbackend.modules.bi.overview.model.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Size; import lombok.Data; @@ -15,21 +14,16 @@ import java.util.List; */ @Data @JsonIgnoreProperties(ignoreUnknown = true) -@Schema(description = "全店概览按品类汇总导出 DTO") public class CategoryExportDTO { - @Schema(description = "日期范围数组", example = "[\"2024-01-01\", \"2024-01-31\"]", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "日期范围不能为空") @Size(min = 1, max = 2, message = "日期范围数组必须包含1-2个日期") private List dateRange; - @Schema(description = "品类ID列表,不传则导出全部品类", example = "[1, 2]") private List categoryIds; - @Schema(description = "税率,默认 0.04", example = "0.04") private BigDecimal taxRate = new BigDecimal("0.04"); /** 店铺导出接口传入时用于下载文件名(店铺名_按品类汇总统计_日期.xlsx) */ - @Schema(description = "店铺ID(店铺侧品类导出时传入,用于生成带店铺名的文件名)", example = "1") private Long shopId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/CompanyExportDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/CompanyExportDTO.java index 5ebc39fd..9311ecb1 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/CompanyExportDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/CompanyExportDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.overview.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Size; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -15,20 +14,15 @@ import java.util.List; */ @Data @JsonIgnoreProperties(ignoreUnknown = true) -@Schema(description = "全店概览按店铺汇总导出 DTO") public class CompanyExportDTO { - @Schema(description = "日期范围数组", example = "[\"2024-01-01\", \"2024-01-31\"]", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "日期范围不能为空") @Size(min = 1, max = 2, message = "日期范围数组必须包含1-2个日期") private List dateRange; - @Schema(description = "店铺ID列表,不传则导出全部店铺", example = "[1, 2]") private List shopIds; - @Schema(description = "导出类型:summary-汇总 / detail-明细 / all-全部,默认 all", example = "all") private String exportType = "all"; - @Schema(description = "税率,默认 0.04", example = "0.04") private BigDecimal taxRate = new BigDecimal("0.04"); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/PlatformExportDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/PlatformExportDTO.java index ae3f0dfc..2dd46a16 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/PlatformExportDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/dto/PlatformExportDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.overview.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Size; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -15,17 +14,13 @@ import java.util.List; */ @Data @JsonIgnoreProperties(ignoreUnknown = true) -@Schema(description = "全店概览按平台汇总导出 DTO") public class PlatformExportDTO { - @Schema(description = "日期范围数组", example = "[\"2024-01-01\", \"2024-01-31\"]", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "日期范围不能为空") @Size(min = 1, max = 2, message = "日期范围数组必须包含1-2个日期") private List dateRange; - @Schema(description = "平台代码列表,不传则导出全部平台", example = "[\"pdd\", \"taobao\"]") private List platformCodes; - @Schema(description = "税率,默认 0.04", example = "0.04") private BigDecimal taxRate = new BigDecimal("0.04"); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/vo/CompanyOverviewVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/vo/CompanyOverviewVO.java index 4021cdc0..0b1731e4 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/vo/CompanyOverviewVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/overview/model/vo/CompanyOverviewVO.java @@ -1,7 +1,6 @@ package top.xyquan.ecomdmbbackend.modules.bi.overview.model.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -12,97 +11,80 @@ import java.util.List; * 全店铺概览VO */ @Data -@Schema(description = "全店铺概览VO") public class CompanyOverviewVO { /** * 全店总销售额 */ - @Schema(description = "全店总销售额", example = "100000.00") private BigDecimal totalSalesAmount; /** * 较上月同期增长百分比 */ - @Schema(description = "较上月同期增长百分比", example = "15.50") private BigDecimal monthOverMonthGrowth; /** * 全店总单量 */ - @Schema(description = "全店总单量", example = "1000") private Integer totalOrderCount; /** * 总推广费支出 */ - @Schema(description = "总推广费支出", example = "5000.00") private BigDecimal totalPromotionFee; /** * 平均费比(推广费/销售额) */ - @Schema(description = "平均费比", example = "0.05") private BigDecimal averageFeeRatio; /** * 全店总净利(税后) */ - @Schema(description = "全店总净利(税后)", example = "80000.00") private BigDecimal totalNetProfitAfterTax; /** * 扣除总税额 */ - @Schema(description = "扣除总税额", example = "6000.00") private BigDecimal totalTaxAmount; /** * 各店铺销售占比排行 */ - @Schema(description = "各店铺销售占比排行") private List shopSalesRatios; /** * 店铺效率象限(ROI vs 净利) */ - @Schema(description = "店铺效率象限") private List shopEfficiencyQuadrants; /** * 销售额趋势分析 */ - @Schema(description = "销售额趋势分析") private TrendData salesAmountTrend; /** * 单量趋势分析 */ - @Schema(description = "单量趋势分析") private TrendData orderCountTrend; /** * 多店铺数据横向汇总(包含合计行和店铺列表) */ - @Schema(description = "多店铺数据横向汇总") private ShopOverview shopSummary; /** * 多品类数据横向汇总(包含合计行和品类列表) */ - @Schema(description = "多品类数据横向汇总") private CategoryOverview categorySummary; /** * 平台维度概览(包含合计行和平台列表) */ @Data - @Schema(description = "平台维度概览") public static class PlatformOverview { - @Schema(description = "合计行") private PlatformSummary total; - @Schema(description = "各平台汇总列表") private List platforms; } @@ -110,12 +92,9 @@ public class CompanyOverviewVO { * 多店铺概览(包含合计行和店铺列表) */ @Data - @Schema(description = "多店铺概览") public static class ShopOverview { - @Schema(description = "合计行") private ShopSummary total; - @Schema(description = "各店铺汇总列表") private List shops; } @@ -123,12 +102,9 @@ public class CompanyOverviewVO { * 多品类概览(包含合计行和品类列表) */ @Data - @Schema(description = "多品类概览") public static class CategoryOverview { - @Schema(description = "合计行") private CategorySummary total; - @Schema(description = "各品类汇总列表") private List categories; } @@ -136,69 +112,54 @@ public class CompanyOverviewVO { * 工作台底部四张汇总表(与全店概览「店铺/平台/品类」及扩展「商品」表同源计算) */ @Data - @Schema(description = "工作台汇总表(与全店概览表结构一致)") public static class WorkbenchTableBundle { - @Schema(description = "店铺汇总表") private ShopOverview shopTable; - @Schema(description = "平台汇总表") private PlatformOverview platformTable; - @Schema(description = "品类汇总表") private CategoryOverview categoryTable; - @Schema(description = "商品汇总表(行结构同品类表;categoryId 存商品 ID)") private CategoryOverview productTable; } /** * 平台维度汇总 */ - @Schema(description = "平台维度汇总") private PlatformOverview platformSummary; /** * 汇总ROI */ - @Schema(description = "汇总ROI", example = "1.5") private BigDecimal totalROI; /** * 总税后盈亏 */ - @Schema(description = "总税后盈亏", example = "80000.00") private BigDecimal totalProfitAfterTax; /** * 全店总销量目标(目标订单数) */ - @Schema(description = "全店总销量目标(目标订单数)", example = "1200") private Integer totalTargetOrderCount; /** * 全店总销售额目标 */ - @Schema(description = "全店总销售额目标", example = "120000.00") private BigDecimal totalTargetAmount; /** * 销量目标达成率(实际订单数/目标订单数) */ - @Schema(description = "销量目标达成率", example = "83.33") private BigDecimal orderCountAchievementRate; /** * 销售额目标达成率(实际销售额/目标销售额) */ - @Schema(description = "销售额目标达成率", example = "83.33") private BigDecimal salesAmountAchievementRate; /** * 趋势数据 */ @Data - @Schema(description = "趋势数据") public static class TrendData { - @Schema(description = "时间范围的总值") private BigDecimal total; - @Schema(description = "每日数据列表") private List dailyDataList; } @@ -206,12 +167,9 @@ public class CompanyOverviewVO { * 趋势数据项 */ @Data - @Schema(description = "趋势数据项") public static class TrendDataItem { @JsonFormat(pattern = "yyyy-MM-dd") - @Schema(description = "日期", example = "2024-01-01") private LocalDate date; - @Schema(description = "对应的值") private BigDecimal value; } @@ -219,18 +177,13 @@ public class CompanyOverviewVO { * 店铺销售占比 */ @Data - @Schema(description = "店铺销售占比") public static class ShopSalesRatio { - @Schema(description = "店铺ID", example = "1") private Long shopId; - @Schema(description = "店铺名称", example = "旗舰店") private String shopName; - @Schema(description = "销售额", example = "50000.00") private BigDecimal salesAmount; - @Schema(description = "占比百分比", example = "50.00") private BigDecimal ratio; } @@ -238,21 +191,15 @@ public class CompanyOverviewVO { * 店铺效率象限 */ @Data - @Schema(description = "店铺效率象限") public static class ShopEfficiencyQuadrant { - @Schema(description = "店铺ID", example = "1") private Long shopId; - @Schema(description = "店铺名称", example = "旗舰店") private String shopName; - @Schema(description = "ROI", example = "1.5") private BigDecimal roi; - @Schema(description = "净利", example = "30000.00") private BigDecimal netProfit; - @Schema(description = "象限(1-高ROI高净利,2-高ROI低净利,3-低ROI高净利,4-低ROI低净利)", example = "1") private Integer quadrant; } @@ -260,78 +207,53 @@ public class CompanyOverviewVO { * 店铺汇总数据 */ @Data - @Schema(description = "店铺汇总数据") public static class ShopSummary { - @Schema(description = "店铺ID", example = "1") private Long shopId; - @Schema(description = "店铺名称", example = "旗舰店") private String shopName; - @Schema(description = "平台", example = "拼多多") private String platform; - @Schema(description = "目标销量(目标订单数)", example = "1000") private Integer targetOrderCount; - @Schema(description = "销量达成率", example = "83.33") private BigDecimal orderCountAchievementRate; - @Schema(description = "目标销售额", example = "100000.00") private BigDecimal targetAmount; - @Schema(description = "销售额达成率", example = "83.33") private BigDecimal salesAmountAchievementRate; - @Schema(description = "销售额", example = "50000.00") private BigDecimal salesAmount; - @Schema(description = "成交金额(全订单状态商家实收合计)", example = "52000.00") private BigDecimal dealAmount; - @Schema(description = "单量", example = "500") private Integer orderCount; - @Schema(description = "客单价", example = "100.00") private BigDecimal averageOrderValue; - @Schema(description = "商品成本", example = "3000.00") private BigDecimal productCost; - @Schema(description = "运费", example = "1000.00") private BigDecimal shippingCost; - @Schema(description = "其他成本", example = "1000.00") private BigDecimal otherCost; - @Schema(description = "订单成本(商品成本+运费+其他成本,不含推广费、刷单费)", example = "5000.00") private BigDecimal orderCost; - @Schema(description = "退款金额", example = "1000.00") private BigDecimal refundAmount; - @Schema(description = "推广费", example = "5000.00") private BigDecimal totalPromotionFee; - @Schema(description = "刷单费用", example = "2000.00") private BigDecimal brushFee; - @Schema(description = "费比", example = "0.10") private BigDecimal feeRatio; - @Schema(description = "毛利(实际销售额 − 订单成本 − 退款,未扣推广/刷单/税)", example = "38000.00") private BigDecimal grossProfit; - @Schema(description = "税前净利(毛利 − 推广费 − 刷单费)", example = "35000.00") private BigDecimal totalProfitBeforeTax; - @Schema(description = "销售额4%税额", example = "2000.00") private BigDecimal salesTaxAmount; - @Schema(description = "税后净利(税前净利 − 税额)", example = "30000.00") private BigDecimal profitAfterTax; - @Schema(description = "ROI", example = "1.5") private BigDecimal roi; } @@ -339,63 +261,43 @@ public class CompanyOverviewVO { * 品类汇总数据 */ @Data - @Schema(description = "品类汇总数据") public static class CategorySummary { - @Schema(description = "品类ID(未分配为null)", example = "1") private Long categoryId; - @Schema(description = "品类名称(未分配为\"未分配品类\")", example = "手机数码") private String categoryName; - @Schema(description = "销售额", example = "50000.00") private BigDecimal salesAmount; - @Schema(description = "成交金额(全订单状态商家实收合计)", example = "52000.00") private BigDecimal dealAmount; - @Schema(description = "单量", example = "500") private Integer orderCount; - @Schema(description = "客单价", example = "100.00") private BigDecimal averageOrderValue; - @Schema(description = "商品成本", example = "3000.00") private BigDecimal productCost; - @Schema(description = "运费", example = "1000.00") private BigDecimal shippingCost; - @Schema(description = "其他成本", example = "1000.00") private BigDecimal otherCost; - @Schema(description = "订单成本(商品成本+运费+其他成本,不含推广费、刷单费)", example = "5000.00") private BigDecimal orderCost; - @Schema(description = "退款金额", example = "1000.00") private BigDecimal refundAmount; - @Schema(description = "推广费", example = "5000.00") private BigDecimal totalPromotionFee; - @Schema(description = "刷单费用", example = "2000.00") private BigDecimal brushFee; - @Schema(description = "费比", example = "0.10") private BigDecimal feeRatio; - @Schema(description = "毛利(实际销售额 − 订单成本 − 退款,未扣推广/刷单/税)", example = "38000.00") private BigDecimal grossProfit; - @Schema(description = "税前净利(毛利 − 推广费 − 刷单费)", example = "35000.00") private BigDecimal totalProfitBeforeTax; - @Schema(description = "销售额4%税额", example = "2000.00") private BigDecimal salesTaxAmount; - @Schema(description = "税后净利(税前净利 − 税额)", example = "30000.00") private BigDecimal profitAfterTax; - @Schema(description = "ROI", example = "1.5") private BigDecimal roi; } @@ -403,75 +305,51 @@ public class CompanyOverviewVO { * 平台维度汇总 */ @Data - @Schema(description = "平台维度汇总") public static class PlatformSummary { - @Schema(description = "平台代码", example = "pdd") private String platformCode; - @Schema(description = "平台名称", example = "淘宝") private String platformName; - @Schema(description = "目标单量", example = "5000") private Integer targetOrderCount; - @Schema(description = "单量达成率", example = "90.4") private BigDecimal orderCountAchievementRate; - @Schema(description = "目标销售额", example = "320000.00") private BigDecimal targetAmount; - @Schema(description = "销售额达成率", example = "88.6") private BigDecimal salesAmountAchievementRate; - @Schema(description = "销售额", example = "283600.00") private BigDecimal salesAmount; - @Schema(description = "成交金额(全订单状态商家实收合计)", example = "290000.00") private BigDecimal dealAmount; - @Schema(description = "单量", example = "4521") private Integer orderCount; - @Schema(description = "客单价", example = "62.70") private BigDecimal averageOrderValue; - @Schema(description = "商品成本", example = "156000.00") private BigDecimal productCost; - @Schema(description = "运费", example = "8500.00") private BigDecimal shippingCost; - @Schema(description = "其他成本", example = "3200.00") private BigDecimal otherCost; - @Schema(description = "订单成本(商品成本+运费+其他成本,不含推广费、刷单费)", example = "167700.00") private BigDecimal orderCost; - @Schema(description = "退款金额", example = "12600.00") private BigDecimal refundAmount; - @Schema(description = "推广费", example = "9800.00") private BigDecimal totalPromotionFee; - @Schema(description = "刷单费用", example = "4200.00") private BigDecimal brushFee; - @Schema(description = "费比", example = "0.187") private BigDecimal feeRatio; - @Schema(description = "毛利(实际销售额 − 订单成本 − 退款,未扣推广/刷单/税)", example = "102000.00") private BigDecimal grossProfit; - @Schema(description = "税前净利(毛利 − 推广费 − 刷单费)", example = "98600.00") private BigDecimal totalProfitBeforeTax; - @Schema(description = "销售额4%税额", example = "11344.00") private BigDecimal salesTaxAmount; - @Schema(description = "ROI", example = "2.34") private BigDecimal roi; - @Schema(description = "税后净利(税前净利 − 税额)", example = "87256.00") private BigDecimal profitAfterTax; } } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/controller/BiProductOverviewController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/controller/BiProductOverviewController.java index b780015c..6290fda2 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/controller/BiProductOverviewController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/controller/BiProductOverviewController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.productoverview.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -13,7 +11,6 @@ import top.xyquan.ecomdmbbackend.modules.bi.productoverview.service.BiProductOve import top.xyquan.ecomdmbbackend.modules.bi.productoverview.model.dto.ProductOverviewQueryDTO; import top.xyquan.ecomdmbbackend.modules.bi.productoverview.model.vo.ProductOverviewVO; -@Tag(name = "BI-商品概览", description = "商品概览(Mongo 订单/SKU 日汇聚)") @RestController @RequestMapping("/api/bi/product") public class BiProductOverviewController { @@ -24,7 +21,6 @@ public class BiProductOverviewController { this.biProductOverviewService = biProductOverviewService; } - @Operation(summary = "商品概览", description = "KPI、趋势、规格汇总;订单/SKU 读 Mongo,推广/目标读 MySQL") @PostMapping("/overview") @RequirePermission(value = "ecom:product:read", description = "查询商品概览", allowSuper = true) public ApiResponse overview(@Valid @RequestBody ProductOverviewQueryDTO queryDTO) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/model/dto/ProductOverviewQueryDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/model/dto/ProductOverviewQueryDTO.java index 2f6e5564..a350a4fd 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/model/dto/ProductOverviewQueryDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/model/dto/ProductOverviewQueryDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.productoverview.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -11,39 +10,33 @@ import java.time.LocalDate; * 商品概览查询DTO */ @Data -@Schema(description = "商品概览查询DTO") public class ProductOverviewQueryDTO { /** * 商品ID */ - @Schema(description = "商品ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "商品ID不能为空") private Long productId; /** * 开始日期 */ - @Schema(description = "开始日期", example = "2024-01-01", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "开始日期不能为空") private LocalDate startDate; /** * 结束日期 */ - @Schema(description = "结束日期", example = "2024-01-31", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "结束日期不能为空") private LocalDate endDate; /** * 店铺ID(可选;传入时仅统计该店铺下该商品的订单与推广费分摊) */ - @Schema(description = "店铺ID(可选)", example = "1") private Long shopId; /** * 税率(默认0.04) */ - @Schema(description = "税率,用于计算税额,默认0.04", example = "0.04") private BigDecimal taxRate = new BigDecimal("0.04"); } \ No newline at end of file diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/model/vo/ProductOverviewVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/model/vo/ProductOverviewVO.java index 50dfb2ad..862beda6 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/model/vo/ProductOverviewVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/productoverview/model/vo/ProductOverviewVO.java @@ -1,7 +1,6 @@ package top.xyquan.ecomdmbbackend.modules.bi.productoverview.model.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -12,19 +11,16 @@ import java.util.List; * 商品概览响应VO */ @Data -@Schema(description = "商品概览响应VO") public class ProductOverviewVO { /** * 商品ID */ - @Schema(description = "商品ID") private Long productId; /** * 商品名称 */ - @Schema(description = "商品名称") private String productName; // ========== KPI 汇总指标 ========== @@ -32,55 +28,46 @@ public class ProductOverviewVO { /** * 总销售额 */ - @Schema(description = "总销售额") private BigDecimal totalSalesAmount; /** * 较上月同期增长百分比 */ - @Schema(description = "较上月同期增长百分比", example = "15.50") private BigDecimal monthOverMonthGrowth; /** * 总订单量 */ - @Schema(description = "总订单量") private Integer totalOrderCount; /** * 平均费比(推广费/销售额) */ - @Schema(description = "平均费比") private BigDecimal averageFeeRatio; /** * 总净利润(税后) */ - @Schema(description = "总净利润(税后)") private BigDecimal totalNetProfitAfterTax; /** * 扣除总税额 */ - @Schema(description = "扣除总税额") private BigDecimal totalTaxAmount; /** * 销量目标达成率 */ - @Schema(description = "销量目标达成率") private BigDecimal orderCountAchievementRate; /** * 销售额目标达成率 */ - @Schema(description = "销售额目标达成率") private BigDecimal salesAmountAchievementRate; /** * 汇总ROI */ - @Schema(description = "汇总ROI") private BigDecimal totalROI; // ========== 各规格销量 Top10 ========== @@ -88,7 +75,6 @@ public class ProductOverviewVO { /** * 各规格销量 Top10(按单量降序,最多10条) */ - @Schema(description = "各规格销量 Top10") private List specSalesTop10; // ========== 趋势数据 ========== @@ -96,13 +82,11 @@ public class ProductOverviewVO { /** * 销售额趋势分析 */ - @Schema(description = "销售额趋势分析") private TrendData salesAmountTrend; /** * 单量趋势分析 */ - @Schema(description = "单量趋势分析") private TrendData orderCountTrend; // ========== 规格销售汇总 ========== @@ -110,7 +94,6 @@ public class ProductOverviewVO { /** * 规格销售汇总(含各规格明细列表和合计行) */ - @Schema(description = "规格销售汇总") private SpecSummary specSummaries; // ========== 内部类 ========== @@ -119,18 +102,15 @@ public class ProductOverviewVO { * 趋势数据 */ @Data - @Schema(description = "趋势数据") public static class TrendData { /** * 时间范围的总值 */ - @Schema(description = "时间范围的总值") private BigDecimal total; /** * 每日数据列表 */ - @Schema(description = "每日数据列表") private List dailyDataList; } @@ -138,19 +118,16 @@ public class ProductOverviewVO { * 趋势数据项 */ @Data - @Schema(description = "趋势数据项") public static class TrendDataItem { /** * 日期 */ @JsonFormat(pattern = "yyyy-MM-dd") - @Schema(description = "日期", example = "2024-01-01") private LocalDate date; /** * 对应的值 */ - @Schema(description = "对应的值") private BigDecimal value; } @@ -158,18 +135,15 @@ public class ProductOverviewVO { * 规格销售汇总 */ @Data - @Schema(description = "规格销售汇总") public static class SpecSummary { /** * 各规格明细列表 */ - @Schema(description = "各规格明细列表") private List list; /** * 合计行 */ - @Schema(description = "合计行") private SpecSummaryTotal total; } @@ -177,114 +151,95 @@ public class ProductOverviewVO { * 规格销售明细项 */ @Data - @Schema(description = "规格销售明细项") public static class SpecSummaryItem { /** * 规格ID */ - @Schema(description = "规格ID") private Long skuId; /** * 规格名称 */ - @Schema(description = "规格名称") private String skuName; /** * 规格编码 */ - @Schema(description = "规格编码") private String skuCode; /** * 销售额 */ - @Schema(description = "销售额") private BigDecimal salesAmount; /** * 订单量(按平台订单号去重) */ - @Schema(description = "订单量") private Integer orderCount; /** * 总件数 */ - @Schema(description = "总件数") private Integer quantity; /** * 客单价 */ - @Schema(description = "客单价") private BigDecimal averageOrderValue; /** * 商品成本 */ - @Schema(description = "商品成本") private BigDecimal productCost; /** * 运费 */ - @Schema(description = "运费") private BigDecimal shippingCost; /** * 其他成本 */ - @Schema(description = "其他成本") private BigDecimal otherCost; /** * 订单成本(商品成本+运费+其他成本,不含推广费、刷单费) */ - @Schema(description = "订单成本(商品成本+运费+其他成本,不含推广费、刷单费)") private BigDecimal orderCost; /** * 退款金额 */ - @Schema(description = "退款金额") private BigDecimal refundAmount; /** * 推广费 */ - @Schema(description = "推广费") private BigDecimal promotionFee; /** * 费比(推广费/销售额) */ - @Schema(description = "费比") private BigDecimal feeRatio; /** * 税前盈亏 */ - @Schema(description = "税前盈亏") private BigDecimal profitBeforeTax; /** * 销售额×税率的税额 */ - @Schema(description = "销售额×税率的税额") private BigDecimal salesTaxAmount; /** * ROI */ - @Schema(description = "ROI") private BigDecimal roi; /** * 税后盈亏 */ - @Schema(description = "税后盈亏") private BigDecimal profitAfterTax; } @@ -292,90 +247,75 @@ public class ProductOverviewVO { * 规格销售汇总合计行 */ @Data - @Schema(description = "规格销售汇总合计行") public static class SpecSummaryTotal { /** * 销售额 */ - @Schema(description = "销售额") private BigDecimal salesAmount; /** * 订单量 */ - @Schema(description = "订单量") private Integer orderCount; /** * 总件数 */ - @Schema(description = "总件数") private Integer quantity; /** * 商品成本 */ - @Schema(description = "商品成本") private BigDecimal productCost; /** * 运费 */ - @Schema(description = "运费") private BigDecimal shippingCost; /** * 其他成本 */ - @Schema(description = "其他成本") private BigDecimal otherCost; /** * 订单成本(商品成本+运费+其他成本,不含推广费、刷单费) */ - @Schema(description = "订单成本(商品成本+运费+其他成本,不含推广费、刷单费)") private BigDecimal orderCost; /** * 退款金额 */ - @Schema(description = "退款金额") private BigDecimal refundAmount; /** * 推广费 */ - @Schema(description = "推广费") private BigDecimal promotionFee; /** * 费比 */ - @Schema(description = "费比") private BigDecimal feeRatio; /** * 税前盈亏 */ - @Schema(description = "税前盈亏") private BigDecimal profitBeforeTax; /** * 税额 */ - @Schema(description = "税额") private BigDecimal salesTaxAmount; /** * ROI */ - @Schema(description = "ROI") private BigDecimal roi; /** * 税后盈亏 */ - @Schema(description = "税后盈亏") private BigDecimal profitAfterTax; } @@ -383,36 +323,30 @@ public class ProductOverviewVO { * 规格销量排名项 */ @Data - @Schema(description = "规格销量排名项") public static class SpecSalesRankItem { /** * 规格ID */ - @Schema(description = "规格ID") private Long skuId; /** * 规格名称 */ - @Schema(description = "规格名称") private String skuName; /** * 规格编码 */ - @Schema(description = "规格编码") private String skuCode; /** * 订单量 */ - @Schema(description = "订单量") private Integer orderCount; /** * 销售额 */ - @Schema(description = "销售额") private BigDecimal salesAmount; } } \ No newline at end of file diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/controller/BiShopExportController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/controller/BiShopExportController.java index aad4ae1f..d9386ba0 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/controller/BiShopExportController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/controller/BiShopExportController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.shopoverview.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.Valid; import org.springframework.http.HttpHeaders; @@ -21,7 +19,6 @@ import top.xyquan.ecomdmbbackend.modules.ec.shop.service.ShopService; /** * 店铺 Excel 导出:{@code /bi/shop/export/summary-by-product}、{@code /bi/shop/export/summary-by-category} */ -@Tag(name = "BI-店铺导出", description = "店铺概览按商品/按品类汇总导出(Mongo 同源)") @RestController @RequestMapping("/api/bi/shop/export") public class BiShopExportController { @@ -45,7 +42,6 @@ public class BiShopExportController { return "店铺" + shopId; } - @Operation(summary = "店铺数据统计-按商品汇总", description = "导出单店铺按商品维度汇总为 Excel") @PostMapping("/summary-by-product") @RequirePermission(value = "data:export", description = "导出店铺按商品汇总", allowSuper = true) public void exportShopSummaryByProduct(@Valid @RequestBody ShopExportDTO dto, HttpServletResponse response) { @@ -55,7 +51,6 @@ public class BiShopExportController { writeExcel(response, filename, data); } - @Operation(summary = "店铺数据统计-按品类汇总", description = "导出单店铺按品类维度汇总为 Excel") @PostMapping("/summary-by-category") @RequirePermission(value = "data:export", description = "导出店铺按品类汇总", allowSuper = true) public void exportShopSummaryByCategory(@Valid @RequestBody CategoryExportDTO dto, HttpServletResponse response) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/controller/BiShopOverviewController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/controller/BiShopOverviewController.java index d57978df..2487ba4a 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/controller/BiShopOverviewController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/controller/BiShopOverviewController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.shopoverview.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -13,7 +11,6 @@ import top.xyquan.ecomdmbbackend.modules.bi.shopoverview.service.BiShopOverviewS import top.xyquan.ecomdmbbackend.modules.bi.shopoverview.model.dto.ShopOverviewQueryDTO; import top.xyquan.ecomdmbbackend.modules.bi.shopoverview.model.vo.ShopOverviewStatisticsVO; -@Tag(name = "BI-店铺概览", description = "单店概览(Mongo 订单日汇聚)") @RestController @RequestMapping("/api/bi/shop") public class BiShopOverviewController { @@ -24,7 +21,6 @@ public class BiShopOverviewController { this.biShopOverviewService = biShopOverviewService; } - @Operation(summary = "店铺概览", description = "KPI、趋势、商品/品类汇总;订单读 Mongo,推广/刷单/目标读 MySQL") @PostMapping("/overview") @RequirePermission(value = "ecom:shop:read", description = "查询店铺概览", allowSuper = true) public ApiResponse overview(@Valid @RequestBody ShopOverviewQueryDTO queryDTO) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/dto/ShopExportDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/dto/ShopExportDTO.java index 5cf00ea9..804db97e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/dto/ShopExportDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/dto/ShopExportDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.shopoverview.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; @@ -16,21 +15,16 @@ import java.util.List; */ @Data @JsonIgnoreProperties(ignoreUnknown = true) -@Schema(description = "店铺概览导出DTO") public class ShopExportDTO { - @Schema(description = "店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; - @Schema(description = "日期范围数组", example = "[\"2024-01-01\", \"2024-01-31\"]", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "日期范围不能为空") @Size(min = 1, max = 2, message = "日期范围数组必须包含1-2个日期") private List dateRange; - @Schema(description = "导出类型:summary-汇总 / product-商品明细 / trend-趋势 / all-全部,默认 all", example = "all") private String exportType = "all"; - @Schema(description = "税率,默认 0.04", example = "0.04") private BigDecimal taxRate = new BigDecimal("0.04"); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/dto/ShopOverviewQueryDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/dto/ShopOverviewQueryDTO.java index e70efabe..62ae4994 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/dto/ShopOverviewQueryDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/dto/ShopOverviewQueryDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.shopoverview.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; @@ -16,20 +15,17 @@ import java.util.List; */ @Data @JsonIgnoreProperties(ignoreUnknown = true) -@Schema(description = "单店铺概览查询DTO") public class ShopOverviewQueryDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; /** * 日期范围数组(第一个是开始日期,第二个是结束日期,只有一个日期则返回当天数据) */ - @Schema(description = "日期范围数组", example = "[\"2024-01-01\", \"2024-01-31\"]", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "日期范围不能为空") @Size(min = 1, max = 2, message = "日期范围数组必须包含1-2个日期") private List dateRange; @@ -37,7 +33,6 @@ public class ShopOverviewQueryDTO { /** * 税率(默认4%) */ - @Schema(description = "税率,默认为0.04(即4%)", example = "0.04") private BigDecimal taxRate = new BigDecimal("0.04"); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/vo/ShopOverviewStatisticsVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/vo/ShopOverviewStatisticsVO.java index 1c3d556a..fa87e4e7 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/vo/ShopOverviewStatisticsVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/shopoverview/model/vo/ShopOverviewStatisticsVO.java @@ -1,7 +1,6 @@ package top.xyquan.ecomdmbbackend.modules.bi.shopoverview.model.vo; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -12,160 +11,131 @@ import java.util.List; * 单店铺概览统计VO */ @Data -@Schema(description = "单店铺概览统计VO") public class ShopOverviewStatisticsVO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1") private Long shopId; /** * 店铺名称 */ - @Schema(description = "店铺名称", example = "淘宝旗舰店") private String shopName; /** * 店铺总销售额 */ - @Schema(description = "店铺总销售额", example = "100000.00") private BigDecimal totalSalesAmount; /** * 较上月同期增长百分比 */ - @Schema(description = "较上月同期增长百分比", example = "15.50") private BigDecimal monthOverMonthGrowth; /** * 店铺总单量 */ - @Schema(description = "店铺总单量", example = "1000") private Integer totalOrderCount; /** * 总推广费支出 */ - @Schema(description = "总推广费支出", example = "5000.00") private BigDecimal totalPromotionFee; /** * 平均费比(推广费/销售额) */ - @Schema(description = "平均费比", example = "0.05") private BigDecimal averageFeeRatio; /** * 店铺总净利(税后) */ - @Schema(description = "店铺总净利(税后)", example = "80000.00") private BigDecimal totalNetProfitAfterTax; /** * 扣除总税额 */ - @Schema(description = "扣除总税额", example = "6000.00") private BigDecimal totalTaxAmount; /** * 店铺总销量目标(目标订单数) */ - @Schema(description = "店铺总销量目标(目标订单数)", example = "1200") private Integer totalTargetOrderCount; /** * 店铺总销售额目标 */ - @Schema(description = "店铺总销售额目标", example = "120000.00") private BigDecimal totalTargetAmount; /** * 销量目标达成率 */ - @Schema(description = "销量目标达成率", example = "83.33") private BigDecimal orderCountAchievementRate; /** * 销售额目标达成率 */ - @Schema(description = "销售额目标达成率", example = "83.33") private BigDecimal salesAmountAchievementRate; /** * 汇总ROI */ - @Schema(description = "汇总ROI", example = "1.5") private BigDecimal totalROI; /** * 店铺汇总客单价(销售额÷单量,与前端概览一致) */ - @Schema(description = "店铺汇总客单价", example = "120.00") private BigDecimal averageOrderValue; /** * 退款状态订单实收合计 */ - @Schema(description = "退款金额合计", example = "500.00") private BigDecimal refundAmount; /** * 店铺税前盈亏(扣「销售额×税率」前的经营结果,与 totalNetProfitAfterTax + totalTaxAmount 一致) */ - @Schema(description = "店铺税前盈亏", example = "85000.00") private BigDecimal totalProfitBeforeTax; /** * 各商品按单量排序的销量 Top10(与当前筛选时间范围一致) */ - @Schema(description = "各商品销量 Top10") private List productSalesTop10; /** * 销售额趋势分析 */ - @Schema(description = "销售额趋势分析") private TrendData salesAmountTrend; /** * 单量趋势分析 */ - @Schema(description = "单量趋势分析") private TrendData orderCountTrend; /** * 多商品数据横向汇总(含合计行) */ - @Schema(description = "多商品数据横向汇总") private ProductOverview productOverview; /** * 品类多维度数据汇总(含合计行) */ - @Schema(description = "品类多维度数据汇总") private CategoryOverview categoryOverview; /** * 商品销量排行项(概览 Top10) */ @Data - @Schema(description = "商品销量排行项") public static class ProductSalesRankItem { - @Schema(description = "商品ID", example = "1") private Long productId; - @Schema(description = "商品名称", example = "iPhone 15 Pro") private String productName; - @Schema(description = "商品编码", example = "IPHONE15PRO") private String productCode; - @Schema(description = "单量", example = "500") private Integer orderCount; - @Schema(description = "销售额", example = "50000.00") private BigDecimal salesAmount; } @@ -173,11 +143,8 @@ public class ShopOverviewStatisticsVO { * 商品概览(含合计行和商品列表) */ @Data - @Schema(description = "商品概览") public static class ProductOverview { - @Schema(description = "合计行") private ProductSummary total; - @Schema(description = "各商品汇总列表") private List products; } @@ -185,11 +152,8 @@ public class ShopOverviewStatisticsVO { * 品类概览(含合计行和品类列表) */ @Data - @Schema(description = "品类概览") public static class CategoryOverview { - @Schema(description = "合计行") private CategorySummary total; - @Schema(description = "各品类汇总列表") private List categories; } @@ -197,60 +161,41 @@ public class ShopOverviewStatisticsVO { * 商品汇总数据 */ @Data - @Schema(description = "商品汇总数据") public static class ProductSummary { - @Schema(description = "商品ID", example = "1") private Long productId; - @Schema(description = "商品名称", example = "iPhone 15 Pro") private String productName; - @Schema(description = "商品编码", example = "IPHONE15PRO") private String productCode; - @Schema(description = "销售额", example = "50000.00") private BigDecimal salesAmount; - @Schema(description = "单量", example = "500") private Integer orderCount; - @Schema(description = "客单价", example = "100.00") private BigDecimal averageOrderValue; - @Schema(description = "商品成本", example = "3000.00") private BigDecimal productCost; - @Schema(description = "运费", example = "1000.00") private BigDecimal shippingCost; - @Schema(description = "其他成本", example = "1000.00") private BigDecimal otherCost; - @Schema(description = "订单成本(商品成本+运费+其他成本,不含推广费、刷单费)", example = "5000.00") private BigDecimal orderCost; - @Schema(description = "退款金额", example = "1000.00") private BigDecimal refundAmount; - @Schema(description = "推广费", example = "5000.00") private BigDecimal totalPromotionFee; - @Schema(description = "刷单费用", example = "2000.00") private BigDecimal brushFee; - @Schema(description = "费比", example = "0.10") private BigDecimal feeRatio; - @Schema(description = "税前盈亏", example = "35000.00") private BigDecimal totalProfitBeforeTax; - @Schema(description = "销售额4%税额", example = "2000.00") private BigDecimal salesTaxAmount; - @Schema(description = "税后盈亏", example = "30000.00") private BigDecimal profitAfterTax; - @Schema(description = "ROI", example = "1.5") private BigDecimal roi; } @@ -258,57 +203,39 @@ public class ShopOverviewStatisticsVO { * 品类汇总数据 */ @Data - @Schema(description = "品类汇总数据") public static class CategorySummary { - @Schema(description = "品类ID", example = "1") private Long categoryId; - @Schema(description = "品类名称", example = "手机数码") private String categoryName; - @Schema(description = "销售额", example = "50000.00") private BigDecimal salesAmount; - @Schema(description = "单量", example = "500") private Integer orderCount; - @Schema(description = "客单价", example = "100.00") private BigDecimal averageOrderValue; - @Schema(description = "商品成本", example = "3000.00") private BigDecimal productCost; - @Schema(description = "运费", example = "1000.00") private BigDecimal shippingCost; - @Schema(description = "其他成本", example = "1000.00") private BigDecimal otherCost; - @Schema(description = "订单成本(商品成本+运费+其他成本,不含推广费、刷单费)", example = "5000.00") private BigDecimal orderCost; - @Schema(description = "退款金额", example = "1000.00") private BigDecimal refundAmount; - @Schema(description = "推广费", example = "5000.00") private BigDecimal totalPromotionFee; - @Schema(description = "刷单费用", example = "2000.00") private BigDecimal brushFee; - @Schema(description = "费比", example = "0.10") private BigDecimal feeRatio; - @Schema(description = "税前盈亏", example = "35000.00") private BigDecimal totalProfitBeforeTax; - @Schema(description = "销售额税率", example = "2000.00") private BigDecimal salesTaxAmount; - @Schema(description = "税后盈亏", example = "30000.00") private BigDecimal profitAfterTax; - @Schema(description = "ROI", example = "1.5") private BigDecimal roi; } @@ -316,18 +243,15 @@ public class ShopOverviewStatisticsVO { * 趋势数据 */ @Data - @Schema(description = "趋势数据") public static class TrendData { /** * 时间范围的总值 */ - @Schema(description = "时间范围的总值") private BigDecimal total; /** * 每日数据列表 */ - @Schema(description = "每日数据列表") private List dailyDataList; } @@ -335,19 +259,16 @@ public class ShopOverviewStatisticsVO { * 趋势数据项 */ @Data - @Schema(description = "趋势数据项") public static class TrendDataItem { /** * 日期 */ @JsonFormat(pattern = "yyyy-MM-dd") - @Schema(description = "日期", example = "2024-01-01") private LocalDate date; /** * 对应的值 */ - @Schema(description = "对应的值") private BigDecimal value; } } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/controller/BiWorkbenchController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/controller/BiWorkbenchController.java index 84a32724..00ca3dd5 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/controller/BiWorkbenchController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/controller/BiWorkbenchController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -18,7 +16,6 @@ import top.xyquan.ecomdmbbackend.modules.bi.workbench.model.vo.WorkbenchPeriodCo /** * BI 工作台查询:订单指标来自 Mongo 日汇聚,推广/刷单来自 MySQL。 */ -@Tag(name = "BI-工作台", description = "工作台聚合统计(Mongo 订单日汇聚)") @RestController @RequestMapping("/api/bi/workbench") public class BiWorkbenchController { @@ -29,28 +26,24 @@ public class BiWorkbenchController { this.biWorkbenchService = biWorkbenchService; } - @Operation(summary = "经营概览 Tab", description = "KPI、趋势、平台占比及底部四张汇总表") @PostMapping("/finance") @RequirePermission(value = "ecom:shop:read", description = "查询工作台经营概览", allowSuper = true) public ApiResponse finance(@Valid @RequestBody WorkbenchQueryDTO queryDTO) { return ApiResponse.success("获取经营概览成功", biWorkbenchService.financeSlice(queryDTO)); } - @Operation(summary = "多维分析 Tab", description = "平台/店铺/品类/商品四维损益") @PostMapping("/multi-analysis") @RequirePermission(value = "ecom:shop:read", description = "查询工作台多维分析", allowSuper = true) public ApiResponse multiAnalysis(@Valid @RequestBody WorkbenchQueryDTO queryDTO) { return ApiResponse.success("获取多维分析成功", biWorkbenchService.multiAnalysis(queryDTO)); } - @Operation(summary = "销售额排行 Tab", description = "与多维分析同源,按销售额降序") @PostMapping("/sales-rank") @RequirePermission(value = "ecom:shop:read", description = "查询工作台销售额排行", allowSuper = true) public ApiResponse salesRank(@Valid @RequestBody WorkbenchQueryDTO queryDTO) { return ApiResponse.success("获取销售额排行成功", biWorkbenchService.salesRank(queryDTO)); } - @Operation(summary = "区间对比切片", description = "按单段日期范围返回店铺汇总「合计」行") @PostMapping("/period-compare/slice") @RequirePermission(value = "ecom:shop:read", description = "查询工作台区间对比", allowSuper = true) public ApiResponse periodCompareSlice( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/controller/BiWorkbenchExportController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/controller/BiWorkbenchExportController.java index 7d749959..ba17a2a6 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/controller/BiWorkbenchExportController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/controller/BiWorkbenchExportController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.Valid; import org.springframework.http.HttpHeaders; @@ -15,7 +13,6 @@ import top.xyquan.ecomdmbbackend.modules.bi.workbench.service.BiWorkbenchExportS import top.xyquan.ecomdmbbackend.modules.bi.overview.util.ExportFilenameUtils; import top.xyquan.ecomdmbbackend.modules.bi.workbench.model.dto.WorkbenchExportDTO; -@Tag(name = "BI-工作台导出", description = "多维度经营明细 Excel 导出(Mongo 订单日汇聚)") @RestController @RequestMapping("/api/bi/workbench/export") public class BiWorkbenchExportController { @@ -26,7 +23,6 @@ public class BiWorkbenchExportController { this.exportService = exportService; } - @Operation(summary = "多维度经营明细-按店铺汇总导出") @PostMapping("/by-shop") @RequirePermission(value = "data:export", description = "导出多维度经营明细(按店铺)", allowSuper = true) public void exportByShop(@Valid @RequestBody WorkbenchExportDTO dto, HttpServletResponse response) { @@ -34,7 +30,6 @@ public class BiWorkbenchExportController { exportService.exportByShop(dto)); } - @Operation(summary = "多维度经营明细-按平台汇总导出") @PostMapping("/by-platform") @RequirePermission(value = "data:export", description = "导出多维度经营明细(按平台)", allowSuper = true) public void exportByPlatform(@Valid @RequestBody WorkbenchExportDTO dto, HttpServletResponse response) { @@ -42,7 +37,6 @@ public class BiWorkbenchExportController { exportService.exportByPlatform(dto)); } - @Operation(summary = "多维度经营明细-按品类汇总导出") @PostMapping("/by-category") @RequirePermission(value = "data:export", description = "导出多维度经营明细(按品类)", allowSuper = true) public void exportByCategory(@Valid @RequestBody WorkbenchExportDTO dto, HttpServletResponse response) { @@ -50,7 +44,6 @@ public class BiWorkbenchExportController { exportService.exportByCategory(dto)); } - @Operation(summary = "多维度经营明细-按商品汇总导出") @PostMapping("/by-product") @RequirePermission(value = "data:export", description = "导出多维度经营明细(按商品)", allowSuper = true) public void exportByProduct(@Valid @RequestBody WorkbenchExportDTO dto, HttpServletResponse response) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/dto/WorkbenchExportDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/dto/WorkbenchExportDTO.java index 425277a9..10ee1e5f 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/dto/WorkbenchExportDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/dto/WorkbenchExportDTO.java @@ -1,7 +1,6 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Size; import lombok.Data; @@ -15,32 +14,23 @@ import java.util.List; */ @Data @JsonIgnoreProperties(ignoreUnknown = true) -@Schema(description = "工作台汇总表导出参数") public class WorkbenchExportDTO { - @Schema(description = "日期范围 [开始, 结束],单元素表示当天", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "日期范围不能为空") @Size(min = 1, max = 2, message = "日期范围必须包含 1~2 个日期") private List dateRange; - @Schema(description = "税率,默认 0.04", example = "0.04") private BigDecimal taxRate = new BigDecimal("0.04"); - @Schema(description = "平台代码,不传表示全平台", example = "pdd") private String platformCode; - @Schema(description = "店铺 ID,不传表示当前筛选下全部门店") private Long shopId; - @Schema(description = "按店铺导出时勾选的店铺 ID,不传导出当前筛选下全部") private List shopIds; - @Schema(description = "按平台导出时勾选的平台代码,不传导出当前筛选下全部") private List platformCodes; - @Schema(description = "按品类导出时勾选的品类 ID,不传导出全部") private List categoryIds; - @Schema(description = "按商品导出时勾选的商品 ID(与汇总行 categoryId 一致),不传导出全部") private List productIds; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/dto/WorkbenchQueryDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/dto/WorkbenchQueryDTO.java index 16e9f2cf..99c9bae6 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/dto/WorkbenchQueryDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/dto/WorkbenchQueryDTO.java @@ -1,7 +1,6 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Size; import lombok.Data; @@ -15,20 +14,15 @@ import java.util.List; */ @Data @JsonIgnoreProperties(ignoreUnknown = true) -@Schema(description = "工作台聚合查询 DTO") public class WorkbenchQueryDTO { - @Schema(description = "日期范围 [开始, 结束],单元素表示当天", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "日期范围不能为空") @Size(min = 1, max = 2, message = "日期范围必须包含 1~2 个日期") private List dateRange; - @Schema(description = "税率,默认 0.04", example = "0.04") private BigDecimal taxRate = new BigDecimal("0.04"); - @Schema(description = "平台代码,不传表示全平台", example = "pdd") private String platformCode; - @Schema(description = "店铺 ID,不传表示所选平台下全部店铺(仍受公司数据权限约束)") private Long shopId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchCostSliceVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchCostSliceVO.java index ae06784a..2fb73c0a 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchCostSliceVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchCostSliceVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,7 +11,6 @@ import java.math.BigDecimal; @Builder @NoArgsConstructor @AllArgsConstructor -@Schema(description = "饼图扇区(金额元两位小数;pct 为占分母销售额比例 %)") public class WorkbenchCostSliceVO { private String name; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchDimRowVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchDimRowVO.java index adebf998..52718505 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchDimRowVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchDimRowVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -15,30 +14,21 @@ import java.math.BigDecimal; @Builder @NoArgsConstructor @AllArgsConstructor -@Schema(description = "工作台-维度汇总行(元 / %)") public class WorkbenchDimRowVO { - @Schema(description = "维度唯一键") private String key; - @Schema(description = "展示名称") private String name; - @Schema(description = "销售额(元,两位小数)") private BigDecimal salesYuan; - @Schema(description = "毛利额(元,两位小数)") private BigDecimal grossProfitYuan; - @Schema(description = "净利额(元,两位小数)") private BigDecimal netProfitYuan; - @Schema(description = "退款金额(元,两位小数)") private BigDecimal refundYuan; - @Schema(description = "毛利率 %") private BigDecimal grossMarginPct; - @Schema(description = "净利率 %") private BigDecimal netMarginPct; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchFinancePanelVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchFinancePanelVO.java index 1ec92af5..398732eb 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchFinancePanelVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchFinancePanelVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,25 +11,19 @@ import java.util.List; @Builder @NoArgsConstructor @AllArgsConstructor -@Schema(description = "工作台-经营概览区") public class WorkbenchFinancePanelVO { private List kpis; private List dealTrend; - @Schema(description = "各平台实际销售额占比(饼图)") private List platformSalesShare; - @Schema(description = "环比对比期开始(yyyy-MM-dd,与 KPI 环一致)") private String momCompareDateStart; - @Schema(description = "环比对比期结束(yyyy-MM-dd)") private String momCompareDateEnd; - @Schema(description = "同比对比期开始(yyyy-MM-dd,与 KPI 同一致)") private String yoyCompareDateStart; - @Schema(description = "同比对比期结束(yyyy-MM-dd)") private String yoyCompareDateEnd; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchFinanceSliceVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchFinanceSliceVO.java index 4c6e32d0..a3b6d985 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchFinanceSliceVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchFinanceSliceVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -14,12 +13,9 @@ import top.xyquan.ecomdmbbackend.modules.bi.overview.model.vo.CompanyOverviewVO; @Builder @NoArgsConstructor @AllArgsConstructor -@Schema(description = "工作台经营概览 Tab 数据") public class WorkbenchFinanceSliceVO { - @Schema(description = "KPI、趋势、平台销售额占比") private WorkbenchFinancePanelVO finance; - @Schema(description = "底部四张汇总表(与全店概览同源口径)") private CompanyOverviewVO.WorkbenchTableBundle summaryTables; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchKpiItemVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchKpiItemVO.java index 6f548203..a246ec9c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchKpiItemVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchKpiItemVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,31 +11,22 @@ import java.math.BigDecimal; @Builder @NoArgsConstructor @AllArgsConstructor -@Schema(description = "工作台-KPI 卡片项") public class WorkbenchKpiItemVO { - @Schema(description = "标题") private String label; - @Schema(description = "主展示值(字符串便于千分位等)") private String value; - @Schema(description = "单位,如 万、单、元、%") private String unit; - @Schema(description = "环比上期变化 %(相对上一同期时段)") private BigDecimal changePct; - @Schema(description = "环比是否上涨(前端箭头颜色)") private Boolean up; - @Schema(description = "同比去年变化 %(相对去年同期时段)") private BigDecimal yoyChangePct; - @Schema(description = "同比是否上涨") private Boolean yoyUp; - @Schema(description = "副文案") private String sub; /** diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchMultiAnalysisPanelVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchMultiAnalysisPanelVO.java index 67cdebba..15da20aa 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchMultiAnalysisPanelVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchMultiAnalysisPanelVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,7 +11,6 @@ import java.util.List; @Builder @NoArgsConstructor @AllArgsConstructor -@Schema(description = "工作台-多维分析(四维度行列表)") public class WorkbenchMultiAnalysisPanelVO { private List platform; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchPeriodCompareSliceVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchPeriodCompareSliceVO.java index 0c3a9bf5..ccdc4a28 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchPeriodCompareSliceVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchPeriodCompareSliceVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -16,15 +15,11 @@ import java.time.LocalDate; @Builder @NoArgsConstructor @AllArgsConstructor -@Schema(description = "工作台区间对比——单区间汇总切片") public class WorkbenchPeriodCompareSliceVO { - @Schema(description = "区间开始日(含)") private LocalDate startDate; - @Schema(description = "区间结束日(含)") private LocalDate endDate; - @Schema(description = "店铺维度汇总合计行(与多维度经营明细汇总同源)") private CompanyOverviewVO.ShopSummary total; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchTrendPointVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchTrendPointVO.java index 93912b44..d96ed3b5 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchTrendPointVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/bi/workbench/model/vo/WorkbenchTrendPointVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.bi.workbench.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,30 +11,21 @@ import java.math.BigDecimal; @Builder @NoArgsConstructor @AllArgsConstructor -@Schema(description = "工作台-经营趋势点(元,两位小数)") public class WorkbenchTrendPointVO { - @Schema(description = "横轴日期,如 M/d") private String date; - @Schema(description = "成交金额(元,两位小数):全部订单状态商家实收合计") private BigDecimal dealYuan; - @Schema(description = "成交单量:全部订单状态的订单笔数,与 KPI「成交单量」同口径") private Integer dealOrderCount; - @Schema(description = "实际销售额(元,两位小数),与计入销售额的订单状态配置一致") private BigDecimal salesYuan; - @Schema(description = "实际销售单量:计入销售额状态的订单笔数,与 KPI「销售单量」同口径") private Integer salesOrderCount; - @Schema(description = "日毛利润(元,两位小数)= 销售额−成本−退款,与 KPI「毛利润」按日拆解口径一致") private BigDecimal profitYuan; - @Schema(description = "日净利润(元,两位小数)= 毛利润−按日销售额占比分摊的推广费、刷单费、税额,与 KPI「净利润」及多维分析分摊口径一致") private BigDecimal netProfitYuan; - @Schema(description = "退款(元,两位小数)") private BigDecimal refundYuan; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/controller/PddGoodsAdFeeController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/controller/PddGoodsAdFeeController.java index b5104193..371987fd 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/controller/PddGoodsAdFeeController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/controller/PddGoodsAdFeeController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -18,7 +15,6 @@ import top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.model.vo.BatchImportP import top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.model.vo.PddGoodsAdFeeVO; import top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.service.PddGoodsAdFeeService; -@Tag(name = "拼多多-商品广告费", description = "拼多多商品按日广告费增删改查") @RestController @RequestMapping("/api/channel/pdd/goods/adfee") @RequiredArgsConstructor @@ -26,38 +22,33 @@ public class PddGoodsAdFeeController { private final PddGoodsAdFeeService pddGoodsAdFeeService; - @Operation(summary = "创建") @PostMapping("/create") @RequirePermission(value = "biz:pdd:ad-fee:manage", description = "创建拼多多商品广告费", allowSuper = true) public ApiResponse create(@Valid @RequestBody CreatePddGoodsAdFeeDTO dto) { return ApiResponse.success("创建成功", pddGoodsAdFeeService.create(dto)); } - @Operation(summary = "更新") @PutMapping("/update/{id}") @RequirePermission(value = "biz:pdd:ad-fee:manage", description = "更新拼多多商品广告费", allowSuper = true) public ApiResponse update( - @Parameter(description = "记录ID") @PathVariable Long id, +@PathVariable Long id, @Valid @RequestBody UpdatePddGoodsAdFeeDTO dto) { return ApiResponse.success("更新成功", pddGoodsAdFeeService.update(id, dto)); } - @Operation(summary = "删除") @DeleteMapping("/delete/{id}") @RequirePermission(value = "biz:pdd:ad-fee:manage", description = "删除拼多多商品广告费", allowSuper = true) - public ApiResponse delete(@Parameter(description = "记录ID") @PathVariable Long id) { + public ApiResponse delete(@PathVariable Long id) { pddGoodsAdFeeService.delete(id); return ApiResponse.success("删除成功"); } - @Operation(summary = "详情") @GetMapping("/detail/{id}") @RequirePermission(value = "biz:pdd:ad-fee:read", description = "查询拼多多商品广告费详情", allowSuper = true) - public ApiResponse detail(@Parameter(description = "记录ID") @PathVariable Long id) { + public ApiResponse detail(@PathVariable Long id) { return ApiResponse.success("获取成功", pddGoodsAdFeeService.getDetail(id)); } - @Operation(summary = "分页列表") @PostMapping("/list") @RequirePermission(value = "biz:pdd:ad-fee:read", description = "查询拼多多商品广告费列表", allowSuper = true) public ApiResponse> list( @@ -65,9 +56,6 @@ public class PddGoodsAdFeeController { return ApiResponse.success("获取成功", pddGoodsAdFeeService.getPage(pageQueryDTO)); } - @Operation(summary = "批量导入/覆盖", - description = "按 channelShopId+goods_id+日期 upsert;金额无变化跳过更新;" - + "新增/变更后异步转换为内部广告费(缺渠道商品时自动拉取并绑定内部商品)") @PostMapping("/batch-import") @RequirePermission(value = "biz:pdd:ad-fee:manage", description = "批量导入拼多多商品广告费", allowSuper = true) public ApiResponse batchImport( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/BatchImportPddGoodsAdFeeDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/BatchImportPddGoodsAdFeeDTO.java index 986ddd32..5fd18577 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/BatchImportPddGoodsAdFeeDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/BatchImportPddGoodsAdFeeDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; import lombok.Data; @@ -8,11 +7,9 @@ import lombok.Data; import java.util.List; @Data -@Schema(description = "批量导入拼多多商品广告费") public class BatchImportPddGoodsAdFeeDTO { @NotEmpty(message = "广告费记录不能为空") @Valid - @Schema(description = "广告费记录列表", requiredMode = Schema.RequiredMode.REQUIRED) private List items; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/BatchImportPddGoodsAdFeeItemDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/BatchImportPddGoodsAdFeeItemDTO.java index e0c8a2b6..51394256 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/BatchImportPddGoodsAdFeeItemDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/BatchImportPddGoodsAdFeeItemDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; @@ -10,23 +9,18 @@ import java.math.BigDecimal; import java.time.LocalDate; @Data -@Schema(description = "批量导入拼多多商品广告费单条") public class BatchImportPddGoodsAdFeeItemDTO { @NotNull(message = "渠道店铺ID不能为空") - @Schema(description = "渠道店铺ID(channel_pdd_shop.id)", requiredMode = Schema.RequiredMode.REQUIRED) private Long channelShopId; @NotNull(message = "统计日期不能为空") - @Schema(description = "广告费统计日期", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDate feeDate; @NotBlank(message = "商品ID不能为空") - @Schema(description = "拼多多商品ID(goods_id)", requiredMode = Schema.RequiredMode.REQUIRED) private String goodsId; @NotNull(message = "广告费金额不能为空") @Positive(message = "广告费金额须大于0") - @Schema(description = "广告费金额(元),须大于0", requiredMode = Schema.RequiredMode.REQUIRED) private BigDecimal feeAmount; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/CreatePddGoodsAdFeeDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/CreatePddGoodsAdFeeDTO.java index d7e574a7..38c1f253 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/CreatePddGoodsAdFeeDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/CreatePddGoodsAdFeeDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; @@ -10,23 +9,18 @@ import java.math.BigDecimal; import java.time.LocalDate; @Data -@Schema(description = "创建拼多多商品广告费") public class CreatePddGoodsAdFeeDTO { @NotNull(message = "渠道店铺ID不能为空") - @Schema(description = "渠道店铺ID(channel_pdd_shop.id)", requiredMode = Schema.RequiredMode.REQUIRED) private Long channelShopId; @NotBlank(message = "商品ID不能为空") - @Schema(description = "拼多多商品ID", requiredMode = Schema.RequiredMode.REQUIRED) private String goodsId; @NotNull(message = "统计日期不能为空") - @Schema(description = "广告费统计日期", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDate feeDate; @NotNull(message = "广告费金额不能为空") @Positive(message = "广告费金额须大于0") - @Schema(description = "广告费金额(元),须大于0", requiredMode = Schema.RequiredMode.REQUIRED) private BigDecimal feeAmount; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/PddGoodsAdFeeFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/PddGoodsAdFeeFilterDTO.java index cee58dfa..195cc500 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/PddGoodsAdFeeFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/PddGoodsAdFeeFilterDTO.java @@ -1,23 +1,17 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDate; @Data -@Schema(description = "拼多多商品广告费过滤条件") public class PddGoodsAdFeeFilterDTO { - @Schema(description = "渠道店铺ID(channel_pdd_shop.id)") private Long channelShopId; - @Schema(description = "拼多多商品ID") private String goodsId; - @Schema(description = "统计日期起") private LocalDate feeDateStart; - @Schema(description = "统计日期止") private LocalDate feeDateEnd; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/UpdatePddGoodsAdFeeDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/UpdatePddGoodsAdFeeDTO.java index 59b7eabf..b960424c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/UpdatePddGoodsAdFeeDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/dto/UpdatePddGoodsAdFeeDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; @@ -10,23 +9,18 @@ import java.math.BigDecimal; import java.time.LocalDate; @Data -@Schema(description = "更新拼多多商品广告费") public class UpdatePddGoodsAdFeeDTO { @NotNull(message = "渠道店铺ID不能为空") - @Schema(description = "渠道店铺ID(channel_pdd_shop.id)", requiredMode = Schema.RequiredMode.REQUIRED) private Long channelShopId; @NotBlank(message = "商品ID不能为空") - @Schema(description = "拼多多商品ID", requiredMode = Schema.RequiredMode.REQUIRED) private String goodsId; @NotNull(message = "统计日期不能为空") - @Schema(description = "广告费统计日期", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDate feeDate; @NotNull(message = "广告费金额不能为空") @Positive(message = "广告费金额须大于0") - @Schema(description = "广告费金额(元),须大于0", requiredMode = Schema.RequiredMode.REQUIRED) private BigDecimal feeAmount; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/vo/BatchImportPddGoodsAdFeeResultVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/vo/BatchImportPddGoodsAdFeeResultVO.java index 785fc452..3cf675ed 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/vo/BatchImportPddGoodsAdFeeResultVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/vo/BatchImportPddGoodsAdFeeResultVO.java @@ -1,12 +1,10 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; @Data -@Schema(description = "拼多多商品广告费批量导入结果") public class BatchImportPddGoodsAdFeeResultVO { private Integer totalCount; @@ -16,7 +14,6 @@ public class BatchImportPddGoodsAdFeeResultVO { private List failureRecords; @Data - @Schema(description = "导入失败记录") public static class ImportFailureRecord { private Integer rowNumber; private Long channelShopId; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/vo/PddGoodsAdFeeVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/vo/PddGoodsAdFeeVO.java index 462d8666..1e296d6d 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/vo/PddGoodsAdFeeVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/adfee/model/vo/PddGoodsAdFeeVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.adfee.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -8,7 +7,6 @@ import java.time.LocalDate; import java.time.LocalDateTime; @Data -@Schema(description = "拼多多商品广告费 VO") public class PddGoodsAdFeeVO { private Long id; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/controller/PddAuthController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/controller/PddAuthController.java index f216bd86..b2a8f97e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/controller/PddAuthController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/controller/PddAuthController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.auth.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; @@ -17,7 +14,6 @@ import top.xyquan.ecomdmbbackend.modules.channel.pdd.auth.service.PddAuthService /** * 拼多多 OAuth 授权 */ -@Tag(name = "拼多多-授权", description = "拼多多店铺 OAuth 授权跳转与回调") @RestController @RequestMapping("/api/channel/pdd/auth") public class PddAuthController { @@ -28,20 +24,17 @@ public class PddAuthController { this.pddAuthService = pddAuthService; } - @Operation(summary = "获取授权跳转 URL", description = "为指定内部店铺生成拼多多授权页链接,前端新窗口打开后引导商家授权") @GetMapping("/authorize-url") @RequirePermission(value = "channel:pdd:auth:manage", description = "拼多多授权管理", allowSuper = true) public ApiResponse authorizeUrl( - @Parameter(description = "内部店铺 ID(ec_shop.id)", required = true) @RequestParam("shopId") Long shopId) { return ApiResponse.success(pddAuthService.buildAuthorizeUrl(shopId)); } - @Operation(summary = "授权回调", description = "拼多多回调入口:接收 code 换取 token、绑定内部店铺,返回提示 HTML(3 秒后关闭)") @GetMapping(value = "/callback", produces = MediaType.TEXT_HTML_VALUE) public ResponseEntity callback( - @Parameter(description = "授权码") @RequestParam(value = "code", required = false) String code, - @Parameter(description = "自定义 state") @RequestParam(value = "state", required = false) String state) { +@RequestParam(value = "code", required = false) String code, +@RequestParam(value = "state", required = false) String state) { String html = pddAuthService.handleCallback(code, state); return ResponseEntity.ok() .contentType(MediaType.TEXT_HTML) diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/model/vo/PddAuthVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/model/vo/PddAuthVO.java index 7b4a976b..78ce38cd 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/model/vo/PddAuthVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/model/vo/PddAuthVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.auth.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,33 +8,23 @@ import java.time.LocalDateTime; * 拼多多授权信息(对外展示,不含 token / raw_response) */ @Data -@Schema(description = "拼多多授权信息VO") public class PddAuthVO { - @Schema(description = "授权主键ID") private Long id; - @Schema(description = "公司ID") private Long companyId; - @Schema(description = "拼多多授权主体ID(owner_id)") private String ownerId; - @Schema(description = "access_token 过期时间") private LocalDateTime expiresAt; - @Schema(description = "refresh_token 过期时间") private LocalDateTime refreshTokenExpiresAt; - @Schema(description = "授权 scope(JSON 数组字符串)") private String scope; - @Schema(description = "状态:0=失效 1=正常 2=已撤销") private Integer status; - @Schema(description = "创建时间") private LocalDateTime createTime; - @Schema(description = "更新时间") private LocalDateTime updateTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/model/vo/PddAuthorizeUrlVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/model/vo/PddAuthorizeUrlVO.java index f9331563..27729d61 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/model/vo/PddAuthorizeUrlVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/auth/model/vo/PddAuthorizeUrlVO.java @@ -1,17 +1,13 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.auth.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Data; @Data @Builder -@Schema(description = "拼多多授权跳转信息") public class PddAuthorizeUrlVO { - @Schema(description = "拼多多授权页完整 URL,前端直接打开") private String authorizeUrl; - @Schema(description = "本次授权 state(调试用;回调时拼多多会原样带回)") private String state; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/controller/PddGoodsController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/controller/PddGoodsController.java index 7fde977b..8c949c40 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/controller/PddGoodsController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/controller/PddGoodsController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -16,7 +13,6 @@ import top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.vo.PddGoodsSync import top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.vo.PddGoodsVO; import top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.service.PddGoodsService; -@Tag(name = "拼多多-商品管理", description = "拼多多商品的增删改查接口") @RestController @RequestMapping("/api/channel/pdd/goods") public class PddGoodsController { @@ -27,7 +23,6 @@ public class PddGoodsController { this.pddGoodsService = pddGoodsService; } - @Operation(summary = "创建", description = "创建新的拼多多商品及SKU明细") @PostMapping("/create") @RequirePermission(value = "channel:pdd:goods:manage", description = "创建拼多多商品", allowSuper = true) public ApiResponse createPddGoods(@Valid @RequestBody CreatePddGoodsDTO createPddGoodsDTO) { @@ -35,24 +30,21 @@ public class PddGoodsController { return ApiResponse.success("创建成功", vo); } - @Operation(summary = "更新", description = "更新现有拼多多商品信息") @PutMapping("/update/{id}") @RequirePermission(value = "channel:pdd:goods:manage", description = "更新拼多多商品", allowSuper = true) public ApiResponse updatePddGoods(@Valid @RequestBody UpdatePddGoodsDTO updatePddGoodsDTO, - @Parameter(description = "商品ID") @PathVariable Long id) { +@PathVariable Long id) { PddGoodsVO vo = pddGoodsService.updatePddGoods(updatePddGoodsDTO, id); return ApiResponse.success("更新成功", vo); } - @Operation(summary = "删除", description = "删除指定拼多多商品及SKU明细") @DeleteMapping("/delete/{id}") @RequirePermission(value = "channel:pdd:goods:manage", description = "删除拼多多商品", allowSuper = true) - public ApiResponse deletePddGoods(@Parameter(description = "商品ID") @PathVariable Long id) { + public ApiResponse deletePddGoods(@PathVariable Long id) { pddGoodsService.deletePddGoods(id); return ApiResponse.success("删除成功"); } - @Operation(summary = "分页列表", description = "分页获取拼多多商品列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "channel:pdd:goods:read", description = "查询拼多多商品列表", allowSuper = true) public ApiResponse> getPddGoodsPage( @@ -61,19 +53,17 @@ public class PddGoodsController { return ApiResponse.success("获取成功", result); } - @Operation(summary = "详情", description = "根据ID获取拼多多商品详情,含SKU明细") @GetMapping("/detail/{id}") @RequirePermission(value = "channel:pdd:goods:read", description = "查询拼多多商品详情", allowSuper = true) - public ApiResponse getPddGoodsDetail(@Parameter(description = "商品ID") @PathVariable Long id) { + public ApiResponse getPddGoodsDetail(@PathVariable Long id) { PddGoodsVO vo = pddGoodsService.getPddGoodsDetail(id); return ApiResponse.success("获取成功", vo); } - @Operation(summary = "同步商品", description = "按渠道店铺调用 pdd.goods.list.get,同步上架+下架商品及SKU到本地") @PostMapping("/sync/{pddShopId}") @RequirePermission(value = "channel:pdd:goods:manage", description = "同步拼多多商品", allowSuper = true) public ApiResponse syncGoodsByPddShop( - @Parameter(description = "渠道店铺ID(channel_pdd_shop.id)") @PathVariable Long pddShopId) { +@PathVariable Long pddShopId) { PddGoodsSyncResultVO result = pddGoodsService.syncGoodsByPddShop(pddShopId); return ApiResponse.success("同步完成", result); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/CreatePddGoodsDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/CreatePddGoodsDTO.java index b081d736..f2193433 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/CreatePddGoodsDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/CreatePddGoodsDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -9,56 +8,40 @@ import java.time.LocalDateTime; import java.util.List; @Data -@Schema(description = "创建拼多多商品DTO") public class CreatePddGoodsDTO { - @Schema(description = "渠道店铺ID(channel_pdd_shop.id)", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "渠道店铺ID不能为空") private Long shopId; - @Schema(description = "拼多多店铺ID(mall_id)", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "mall_id不能为空") private Long mallId; - @Schema(description = "内部商品ID(ec_product.id);不传则按首条 SKU.outer_id 解析", requiredMode = Schema.RequiredMode.NOT_REQUIRED) private Long productId; - @Schema(description = "拼多多商品ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "商品ID不能为空") private String goodsId; - @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "商品名称不能为空") private String goodsName; - @Schema(description = "商品总库存") private Integer goodsQuantity; - @Schema(description = "商品预扣库存") private Integer goodsReserveQuantity; - @Schema(description = "商品主图") private String imageUrl; - @Schema(description = "商品缩略图") private String thumbUrl; - @Schema(description = "是否多SKU 0否 1是") private Integer isMoreSku; - @Schema(description = "是否在架 0否 1是") private Integer isOnsale; - @Schema(description = "拼多多创建时间") private LocalDateTime pddCreatedAt; - @Schema(description = "商品完整JSON") private String rawResponse; - @Schema(description = "最近一次同步时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "同步时间不能为空") private LocalDateTime lastSyncTime; - @Schema(description = "SKU明细列表") private List skus; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/CreatePddGoodsSkuDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/CreatePddGoodsSkuDTO.java index b2b67bca..4ffefa5d 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/CreatePddGoodsSkuDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/CreatePddGoodsSkuDTO.java @@ -1,39 +1,28 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @Data -@Schema(description = "创建拼多多商品SKU明细DTO") public class CreatePddGoodsSkuDTO { - @Schema(description = "拼多多商品ID(冗余)", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "商品ID不能为空") private String goodsId; - @Schema(description = "拼多多SKU ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "SKU ID不能为空") private String skuId; - @Schema(description = "规格描述") private String spec; - @Schema(description = "规格明细JSON") private String specDetails; - @Schema(description = "SKU库存") private Integer skuQuantity; - @Schema(description = "SKU预扣库存") private Integer reserveQuantity; - @Schema(description = "SKU是否在架 0否 1是") private Integer isSkuOnsale; - @Schema(description = "商家外部商品编码") private String outerGoodsId; - @Schema(description = "商家外部SKU编码") private String outerId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/PddGoodsFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/PddGoodsFilterDTO.java index 5846ee4b..1789dbe2 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/PddGoodsFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/PddGoodsFilterDTO.java @@ -1,30 +1,21 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data -@Schema(description = "拼多多商品过滤DTO") public class PddGoodsFilterDTO { - @Schema(description = "渠道店铺ID(channel_pdd_shop.id)") private Long shopId; - @Schema(description = "拼多多店铺ID(mall_id)") private Long mallId; - @Schema(description = "内部商品ID(ec_product.id)") private Long productId; - @Schema(description = "商品名称") private String goodsName; - @Schema(description = "拼多多商品ID") private String goodsId; - @Schema(description = "是否在架 0否 1是") private Integer isOnsale; - @Schema(description = "是否多SKU 0否 1是") private Integer isMoreSku; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/UpdatePddGoodsDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/UpdatePddGoodsDTO.java index 55a3c289..65a3b443 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/UpdatePddGoodsDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/UpdatePddGoodsDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -9,56 +8,40 @@ import java.time.LocalDateTime; import java.util.List; @Data -@Schema(description = "更新拼多多商品DTO") public class UpdatePddGoodsDTO { - @Schema(description = "渠道店铺ID(channel_pdd_shop.id)", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "渠道店铺ID不能为空") private Long shopId; - @Schema(description = "拼多多店铺ID(mall_id)", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "mall_id不能为空") private Long mallId; - @Schema(description = "内部商品ID(ec_product.id);不传则按首条 SKU.outer_id 解析", requiredMode = Schema.RequiredMode.NOT_REQUIRED) private Long productId; - @Schema(description = "拼多多商品ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "商品ID不能为空") private String goodsId; - @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "商品名称不能为空") private String goodsName; - @Schema(description = "商品总库存") private Integer goodsQuantity; - @Schema(description = "商品预扣库存") private Integer goodsReserveQuantity; - @Schema(description = "商品主图") private String imageUrl; - @Schema(description = "商品缩略图") private String thumbUrl; - @Schema(description = "是否多SKU 0否 1是") private Integer isMoreSku; - @Schema(description = "是否在架 0否 1是") private Integer isOnsale; - @Schema(description = "拼多多创建时间") private LocalDateTime pddCreatedAt; - @Schema(description = "商品完整JSON") private String rawResponse; - @Schema(description = "最近一次同步时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "同步时间不能为空") private LocalDateTime lastSyncTime; - @Schema(description = "SKU明细列表") private List skus; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsSkuVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsSkuVO.java index e7236e51..2a2a3895 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsSkuVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsSkuVO.java @@ -1,42 +1,29 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data -@Schema(description = "拼多多商品SKU明细VO") public class PddGoodsSkuVO { - @Schema(description = "主键ID") private Long id; - @Schema(description = "商品主表ID") private Long goodsRowId; - @Schema(description = "拼多多商品ID") private String goodsId; - @Schema(description = "拼多多SKU ID") private String skuId; - @Schema(description = "规格描述") private String spec; - @Schema(description = "规格明细JSON") private String specDetails; - @Schema(description = "SKU库存") private Integer skuQuantity; - @Schema(description = "SKU预扣库存") private Integer reserveQuantity; - @Schema(description = "SKU是否在架") private Integer isSkuOnsale; - @Schema(description = "商家外部商品编码") private String outerGoodsId; - @Schema(description = "商家外部SKU编码") private String outerId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsSyncResultVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsSyncResultVO.java index e15722dc..4818da11 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsSyncResultVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsSyncResultVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -10,33 +9,23 @@ import lombok.NoArgsConstructor; @Builder @NoArgsConstructor @AllArgsConstructor -@Schema(description = "拼多多商品同步结果") public class PddGoodsSyncResultVO { - @Schema(description = "渠道店铺ID") private Long pddShopId; - @Schema(description = "拼多多 mall_id") private Long mallId; - @Schema(description = "本次拉取并落库的商品数(去重后)") private Integer syncedCount; - @Schema(description = "新增数") private Integer createdCount; - @Schema(description = "更新数") private Integer updatedCount; - @Schema(description = "SKU 落库条数") private Integer skuCount; - @Schema(description = "因无法匹配内部商品而跳过的数") private Integer skippedCount; - @Schema(description = "同步时自动创建内部商品的数量") private Integer autoCreatedProductCount; - @Schema(description = "调用列表接口页次数") private Integer pageCount; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsVO.java index dc819e34..e5b7f6fa 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/vo/PddGoodsVO.java @@ -1,69 +1,48 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; import java.util.List; @Data -@Schema(description = "拼多多商品VO") public class PddGoodsVO { - @Schema(description = "主键ID") private Long id; - @Schema(description = "公司ID") private Long companyId; - @Schema(description = "渠道店铺ID(channel_pdd_shop.id)") private Long shopId; - @Schema(description = "拼多多店铺ID(mall_id)") private Long mallId; - @Schema(description = "内部商品ID(ec_product.id)") private Long productId; - @Schema(description = "内部商品名称") private String productName; - @Schema(description = "拼多多商品ID") private String goodsId; - @Schema(description = "商品名称") private String goodsName; - @Schema(description = "商品总库存") private Integer goodsQuantity; - @Schema(description = "商品预扣库存") private Integer goodsReserveQuantity; - @Schema(description = "商品主图") private String imageUrl; - @Schema(description = "商品缩略图") private String thumbUrl; - @Schema(description = "是否多SKU") private Integer isMoreSku; - @Schema(description = "是否在架") private Integer isOnsale; - @Schema(description = "拼多多创建时间") private LocalDateTime pddCreatedAt; - @Schema(description = "最近一次同步时间") private LocalDateTime lastSyncTime; - @Schema(description = "创建时间") private LocalDateTime createTime; - @Schema(description = "更新时间") private LocalDateTime updateTime; - @Schema(description = "SKU明细列表") private List skus; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/controller/PddOrderController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/controller/PddOrderController.java index e0ddfe23..560aad65 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/controller/PddOrderController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/controller/PddOrderController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -15,7 +12,6 @@ import top.xyquan.ecomdmbbackend.modules.channel.pdd.order.model.dto.UpdatePddOr import top.xyquan.ecomdmbbackend.modules.channel.pdd.order.model.vo.PddOrderVO; import top.xyquan.ecomdmbbackend.modules.channel.pdd.order.service.PddOrderService; -@Tag(name = "拼多多-订单管理", description = "拼多多订单的增删改查接口") @RestController @RequestMapping("/api/channel/pdd/order") public class PddOrderController { @@ -26,7 +22,6 @@ public class PddOrderController { this.pddOrderService = pddOrderService; } - @Operation(summary = "创建", description = "创建新的拼多多订单及商品明细") @PostMapping("/create") @RequirePermission(value = "channel:pdd:order:manage", description = "创建拼多多订单", allowSuper = true) public ApiResponse createPddOrder(@Valid @RequestBody CreatePddOrderDTO createPddOrderDTO) { @@ -34,24 +29,21 @@ public class PddOrderController { return ApiResponse.success("创建成功", vo); } - @Operation(summary = "更新", description = "更新现有拼多多订单信息") @PutMapping("/update/{id}") @RequirePermission(value = "channel:pdd:order:manage", description = "更新拼多多订单", allowSuper = true) public ApiResponse updatePddOrder(@Valid @RequestBody UpdatePddOrderDTO updatePddOrderDTO, - @Parameter(description = "订单ID") @PathVariable Long id) { +@PathVariable Long id) { PddOrderVO vo = pddOrderService.updatePddOrder(updatePddOrderDTO, id); return ApiResponse.success("更新成功", vo); } - @Operation(summary = "删除", description = "删除指定拼多多订单及商品明细") @DeleteMapping("/delete/{id}") @RequirePermission(value = "channel:pdd:order:manage", description = "删除拼多多订单", allowSuper = true) - public ApiResponse deletePddOrder(@Parameter(description = "订单ID") @PathVariable Long id) { + public ApiResponse deletePddOrder(@PathVariable Long id) { pddOrderService.deletePddOrder(id); return ApiResponse.success("删除成功"); } - @Operation(summary = "分页列表", description = "分页获取拼多多订单列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "channel:pdd:order:read", description = "查询拼多多订单列表", allowSuper = true) public ApiResponse> getPddOrderPage( @@ -60,10 +52,9 @@ public class PddOrderController { return ApiResponse.success("获取成功", result); } - @Operation(summary = "详情", description = "根据ID获取拼多多订单详情,含商品明细") @GetMapping("/detail/{id}") @RequirePermission(value = "channel:pdd:order:read", description = "查询拼多多订单详情", allowSuper = true) - public ApiResponse getPddOrderDetail(@Parameter(description = "订单ID") @PathVariable Long id) { + public ApiResponse getPddOrderDetail(@PathVariable Long id) { PddOrderVO vo = pddOrderService.getPddOrderDetail(id); return ApiResponse.success("获取成功", vo); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/CreatePddOrderDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/CreatePddOrderDTO.java index 8eaefdf3..546087f3 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/CreatePddOrderDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/CreatePddOrderDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -10,125 +9,86 @@ import java.time.LocalDateTime; import java.util.List; @Data -@Schema(description = "创建拼多多订单DTO") public class CreatePddOrderDTO { - @Schema(description = "店铺ID(ec_shop.id)", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; - @Schema(description = "拼多多授权ID") private Long pddAuthId; - @Schema(description = "拼多多订单号", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "拼多多订单号不能为空") private String orderSn; - @Schema(description = "订单状态:1待发货 2已发货待签收 3已签收", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "订单状态不能为空") private Integer orderStatus; - @Schema(description = "退款状态") private Integer refundStatus; - @Schema(description = "售后状态") private Integer afterSalesStatus; - @Schema(description = "成交状态") private Integer confirmStatus; - @Schema(description = "实付金额") private BigDecimal payAmount; - @Schema(description = "商品金额") private BigDecimal goodsAmount; - @Schema(description = "折扣金额") private BigDecimal discountAmount; - @Schema(description = "邮费") private BigDecimal postage; - @Schema(description = "平台优惠") private BigDecimal platformDiscount; - @Schema(description = "商家优惠") private BigDecimal sellerDiscount; - @Schema(description = "服务费合计") private BigDecimal serviceFee; - @Schema(description = "服务费明细 JSON") private String serviceFeeDetail; - @Schema(description = "快递公司编码") private Long logisticsId; - @Schema(description = "快递运单号") private String trackingNumber; - @Schema(description = "下单时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "下单时间不能为空") private LocalDateTime createdTime; - @Schema(description = "支付时间") private LocalDateTime payTime; - @Schema(description = "成交时间") private LocalDateTime confirmTime; - @Schema(description = "发货时间") private LocalDateTime shippingTime; - @Schema(description = "签收时间") private LocalDateTime receiveTime; - @Schema(description = "承诺发货时间") private LocalDateTime lastShipTime; - @Schema(description = "拼多多订单更新时间") private LocalDateTime pddUpdatedAt; - @Schema(description = "省份") private String province; - @Schema(description = "城市") private String city; - @Schema(description = "区县") private String town; - @Schema(description = "收件人姓名脱敏") private String receiverNameMask; - @Schema(description = "收件人手机脱敏") private String receiverPhoneMask; - @Schema(description = "收件地址脱敏") private String receiverAddressMask; - @Schema(description = "买家留言") private String buyerMemo; - @Schema(description = "商家备注") private String remark; - @Schema(description = "交易类型") private Integer tradeType; - @Schema(description = "是否预售 0否 1是") private Integer isPreSale; - @Schema(description = "拼团状态") private Integer groupStatus; - @Schema(description = "订单完整JSON") private String rawResponse; - @Schema(description = "最近一次同步时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "同步时间不能为空") private LocalDateTime lastSyncTime; - @Schema(description = "订单商品明细") private List items; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/CreatePddOrderItemDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/CreatePddOrderItemDTO.java index e5949952..207c9bd1 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/CreatePddOrderItemDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/CreatePddOrderItemDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -8,37 +7,27 @@ import lombok.Data; import java.math.BigDecimal; @Data -@Schema(description = "创建拼多多订单商品明细DTO") public class CreatePddOrderItemDTO { - @Schema(description = "拼多多商品ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "商品ID不能为空") private String goodsId; - @Schema(description = "拼多多SKU ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "SKU ID不能为空") private String skuId; - @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "商品名称不能为空") private String goodsName; - @Schema(description = "商品规格") private String goodsSpec; - @Schema(description = "商品图片") private String goodsImg; - @Schema(description = "商品数量") @NotNull(message = "商品数量不能为空") private Integer goodsCount; - @Schema(description = "商品单价") private BigDecimal goodsPrice; - @Schema(description = "商家外部商品编码") private String outerGoodsId; - @Schema(description = "商家外部SKU编码") private String outerId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/PddOrderFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/PddOrderFilterDTO.java index b800906b..a17268af 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/PddOrderFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/PddOrderFilterDTO.java @@ -1,44 +1,31 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @Data -@Schema(description = "拼多多订单过滤DTO") public class PddOrderFilterDTO { - @Schema(description = "店铺ID") private Long shopId; - @Schema(description = "拼多多订单号") private String orderSn; - @Schema(description = "订单状态") private Integer orderStatus; - @Schema(description = "退款状态") private Integer refundStatus; - @Schema(description = "售后状态") private Integer afterSalesStatus; - @Schema(description = "下单时间-开始") private LocalDateTime createdTimeStart; - @Schema(description = "下单时间-结束") private LocalDateTime createdTimeEnd; - @Schema(description = "支付时间-开始") private LocalDateTime payTimeStart; - @Schema(description = "支付时间-结束") private LocalDateTime payTimeEnd; - @Schema(description = "成交时间-开始") private LocalDateTime confirmTimeStart; - @Schema(description = "成交时间-结束") private LocalDateTime confirmTimeEnd; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/UpdatePddOrderDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/UpdatePddOrderDTO.java index 19044d83..f17be243 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/UpdatePddOrderDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/dto/UpdatePddOrderDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -10,125 +9,86 @@ import java.time.LocalDateTime; import java.util.List; @Data -@Schema(description = "更新拼多多订单DTO") public class UpdatePddOrderDTO { - @Schema(description = "店铺ID(ec_shop.id)", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; - @Schema(description = "拼多多授权ID") private Long pddAuthId; - @Schema(description = "拼多多订单号", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "拼多多订单号不能为空") private String orderSn; - @Schema(description = "订单状态:1待发货 2已发货待签收 3已签收", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "订单状态不能为空") private Integer orderStatus; - @Schema(description = "退款状态") private Integer refundStatus; - @Schema(description = "售后状态") private Integer afterSalesStatus; - @Schema(description = "成交状态") private Integer confirmStatus; - @Schema(description = "实付金额") private BigDecimal payAmount; - @Schema(description = "商品金额") private BigDecimal goodsAmount; - @Schema(description = "折扣金额") private BigDecimal discountAmount; - @Schema(description = "邮费") private BigDecimal postage; - @Schema(description = "平台优惠") private BigDecimal platformDiscount; - @Schema(description = "商家优惠") private BigDecimal sellerDiscount; - @Schema(description = "服务费合计") private BigDecimal serviceFee; - @Schema(description = "服务费明细 JSON") private String serviceFeeDetail; - @Schema(description = "快递公司编码") private Long logisticsId; - @Schema(description = "快递运单号") private String trackingNumber; - @Schema(description = "下单时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "下单时间不能为空") private LocalDateTime createdTime; - @Schema(description = "支付时间") private LocalDateTime payTime; - @Schema(description = "成交时间") private LocalDateTime confirmTime; - @Schema(description = "发货时间") private LocalDateTime shippingTime; - @Schema(description = "签收时间") private LocalDateTime receiveTime; - @Schema(description = "承诺发货时间") private LocalDateTime lastShipTime; - @Schema(description = "拼多多订单更新时间") private LocalDateTime pddUpdatedAt; - @Schema(description = "省份") private String province; - @Schema(description = "城市") private String city; - @Schema(description = "区县") private String town; - @Schema(description = "收件人姓名脱敏") private String receiverNameMask; - @Schema(description = "收件人手机脱敏") private String receiverPhoneMask; - @Schema(description = "收件地址脱敏") private String receiverAddressMask; - @Schema(description = "买家留言") private String buyerMemo; - @Schema(description = "商家备注") private String remark; - @Schema(description = "交易类型") private Integer tradeType; - @Schema(description = "是否预售 0否 1是") private Integer isPreSale; - @Schema(description = "拼团状态") private Integer groupStatus; - @Schema(description = "订单完整JSON") private String rawResponse; - @Schema(description = "最近一次同步时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "同步时间不能为空") private LocalDateTime lastSyncTime; - @Schema(description = "订单商品明细") private List items; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/vo/PddOrderItemVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/vo/PddOrderItemVO.java index 28614cc3..253e938c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/vo/PddOrderItemVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/vo/PddOrderItemVO.java @@ -1,47 +1,33 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @Data -@Schema(description = "拼多多订单商品明细VO") public class PddOrderItemVO { - @Schema(description = "主键ID") private Long id; - @Schema(description = "订单ID") private Long orderId; - @Schema(description = "拼多多订单号") private String orderSn; - @Schema(description = "拼多多商品ID") private String goodsId; - @Schema(description = "拼多多SKU ID") private String skuId; - @Schema(description = "商品名称") private String goodsName; - @Schema(description = "商品规格") private String goodsSpec; - @Schema(description = "商品图片") private String goodsImg; - @Schema(description = "商品数量") private Integer goodsCount; - @Schema(description = "商品单价") private BigDecimal goodsPrice; - @Schema(description = "商家外部商品编码") private String outerGoodsId; - @Schema(description = "商家外部SKU编码") private String outerId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/vo/PddOrderVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/vo/PddOrderVO.java index fb4ad0b0..fc0748f8 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/vo/PddOrderVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/model/vo/PddOrderVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -8,123 +7,83 @@ import java.time.LocalDateTime; import java.util.List; @Data -@Schema(description = "拼多多订单VO") public class PddOrderVO { - @Schema(description = "主键ID") private Long id; - @Schema(description = "公司ID") private Long companyId; - @Schema(description = "店铺ID") private Long shopId; - @Schema(description = "拼多多授权ID") private Long pddAuthId; - @Schema(description = "拼多多订单号") private String orderSn; - @Schema(description = "订单状态:1待发货 2已发货待签收 3已签收") private Integer orderStatus; - @Schema(description = "退款状态") private Integer refundStatus; - @Schema(description = "售后状态") private Integer afterSalesStatus; - @Schema(description = "成交状态") private Integer confirmStatus; - @Schema(description = "实付金额") private BigDecimal payAmount; - @Schema(description = "商品金额") private BigDecimal goodsAmount; - @Schema(description = "折扣金额") private BigDecimal discountAmount; - @Schema(description = "邮费") private BigDecimal postage; - @Schema(description = "平台优惠") private BigDecimal platformDiscount; - @Schema(description = "商家优惠") private BigDecimal sellerDiscount; - @Schema(description = "服务费合计") private BigDecimal serviceFee; - @Schema(description = "服务费明细 JSON") private String serviceFeeDetail; - @Schema(description = "快递公司编码") private Long logisticsId; - @Schema(description = "快递运单号") private String trackingNumber; - @Schema(description = "下单时间") private LocalDateTime createdTime; - @Schema(description = "支付时间") private LocalDateTime payTime; - @Schema(description = "成交时间") private LocalDateTime confirmTime; - @Schema(description = "发货时间") private LocalDateTime shippingTime; - @Schema(description = "签收时间") private LocalDateTime receiveTime; - @Schema(description = "省份") private String province; - @Schema(description = "城市") private String city; - @Schema(description = "区县") private String town; - @Schema(description = "收件人姓名脱敏") private String receiverNameMask; - @Schema(description = "收件人手机脱敏") private String receiverPhoneMask; - @Schema(description = "收件地址脱敏") private String receiverAddressMask; - @Schema(description = "买家留言") private String buyerMemo; - @Schema(description = "商家备注") private String remark; - @Schema(description = "交易类型") private Integer tradeType; - @Schema(description = "是否预售") private Integer isPreSale; - @Schema(description = "拼团状态") private Integer groupStatus; - @Schema(description = "最近一次同步时间") private LocalDateTime lastSyncTime; - @Schema(description = "创建时间") private LocalDateTime createTime; - @Schema(description = "更新时间") private LocalDateTime updateTime; - @Schema(description = "订单商品明细") private List items; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/controller/PddOrderSyncController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/controller/PddOrderSyncController.java index ed02b9ed..fa3334ac 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/controller/PddOrderSyncController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/controller/PddOrderSyncController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.sync.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.*; @@ -30,7 +27,6 @@ import java.util.List; * 拼多多订单同步:执行类接口入队;补单仍同步执行。 * 全量(含单日 / 区间回补)统一写任务表后入队。 */ -@Tag(name = "拼多多-订单同步", description = "按天回补 / 增量 / 补单 / 全量任务 / 增量开关") @RestController @RequestMapping("/api/channel/pdd/order/sync") public class PddOrderSyncController { @@ -50,7 +46,6 @@ public class PddOrderSyncController { this.contextResolver = contextResolver; } - @Operation(summary = "按成交日同步一天", description = "创建单日全量任务并入队(持久化到任务表)") @PostMapping("/day") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse syncDay(@Valid @RequestBody PddOrderSyncDayDTO dto) { @@ -61,13 +56,12 @@ public class PddOrderSyncController { return ApiResponse.success("任务已入队", fullSyncTaskService.createTask(create)); } - @Operation(summary = "按成交日范围回补", description = "创建区间全量任务并入队(持久化到任务表)") @PostMapping("/bootstrap") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse bootstrap( - @Parameter(description = "内部店铺 ID") @RequestParam Long shopId, - @Parameter(description = "开始日期") @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate, - @Parameter(description = "结束日期") @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) { +@RequestParam Long shopId, +@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate, +@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) { PddOrderFullSyncTaskCreateDTO create = new PddOrderFullSyncTaskCreateDTO(); create.setShopId(shopId); create.setDateFrom(startDate); @@ -75,11 +69,10 @@ public class PddOrderSyncController { return ApiResponse.success("任务已入队", fullSyncTaskService.createTask(create)); } - @Operation(summary = "增量同步(入队)") @PostMapping("/incremental") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse incremental( - @Parameter(description = "内部店铺 ID") @RequestParam Long shopId) { +@RequestParam Long shopId) { PddOrderSyncShopContext ctx = contextResolver.resolveForCurrentCompany(shopId); syncPublisher.publishInc(ctx.getCompanyId(), ctx.getShopId()); return ApiResponse.success("已入队", PddOrderSyncResultVO.builder() @@ -92,14 +85,12 @@ public class PddOrderSyncController { .build()); } - @Operation(summary = "按订单号补拉", description = "同步执行;完成后投递 INC 转换") @PostMapping("/repair") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse repair(@Valid @RequestBody PddOrderRepairDTO dto) { return ApiResponse.success("补单完成", pddOrderSyncService.repair(dto)); } - @Operation(summary = "创建全量同步任务", description = "写任务表并入全量同步队列") @PostMapping("/full-task") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse createFullTask( @@ -107,46 +98,39 @@ public class PddOrderSyncController { return ApiResponse.success("任务已入队", fullSyncTaskService.createTask(dto)); } - @Operation(summary = "查询店铺最新全量同步任务", description = "进行中优先,否则最近一次;无任务返回 null") @GetMapping("/full-task/latest") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse latestFullTask( - @Parameter(description = "内部店铺 ID") @RequestParam Long shopId) { +@RequestParam Long shopId) { return ApiResponse.success(fullSyncTaskService.latestTask(shopId)); } - @Operation(summary = "查询店铺全量同步任务列表", description = "按创建时间倒序,默认最近 20 条") @GetMapping("/full-task/list") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse> listFullTasks( - @Parameter(description = "内部店铺 ID") @RequestParam Long shopId, - @Parameter(description = "条数上限,默认 20,最大 100") +@RequestParam Long shopId, @RequestParam(required = false, defaultValue = "20") Integer limit) { return ApiResponse.success(fullSyncTaskService.listTasks(shopId, limit)); } - @Operation(summary = "查询全量同步任务") @GetMapping("/full-task/{taskId}") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse getFullTask(@PathVariable Long taskId) { return ApiResponse.success(fullSyncTaskService.getTask(taskId)); } - @Operation(summary = "取消全量同步任务") @PostMapping("/full-task/{taskId}/cancel") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse cancelFullTask(@PathVariable Long taskId) { return ApiResponse.success("已取消", fullSyncTaskService.cancelTask(taskId)); } - @Operation(summary = "续跑失败的全量同步任务", description = "从失败日继续(按 doneDays 推进)") @PostMapping("/full-task/{taskId}/resume") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse resumeFullTask(@PathVariable Long taskId) { return ApiResponse.success("已续跑入队", fullSyncTaskService.resumeTask(taskId)); } - @Operation(summary = "批量查询店铺同步状态摘要", description = "列表用;每店返回最新全量任务摘要 + 增量完整态") @PostMapping("/status/batch") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse> batchStatus( @@ -154,7 +138,6 @@ public class PddOrderSyncController { return ApiResponse.success(fullSyncTaskService.batchStatus(dto.getShopIds())); } - @Operation(summary = "增量同步开关") @PostMapping("/incremental/toggle") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse toggleIncremental( @@ -162,11 +145,10 @@ public class PddOrderSyncController { return ApiResponse.success(fullSyncTaskService.toggleIncremental(dto)); } - @Operation(summary = "查询增量同步开关状态") @GetMapping("/incremental/status") @RequirePermission(value = "biz:pdd:order:sync", description = "拼多多订单同步", allowSuper = true) public ApiResponse incrementalStatus( - @Parameter(description = "内部店铺 ID") @RequestParam Long shopId) { +@RequestParam Long shopId) { return ApiResponse.success(fullSyncTaskService.incrementalStatus(shopId)); } } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/dto/PddOrderRepairDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/dto/PddOrderRepairDTO.java index 9ea1cd5c..43e80245 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/dto/PddOrderRepairDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/dto/PddOrderRepairDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.sync.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -8,14 +7,11 @@ import lombok.Data; import java.util.List; @Data -@Schema(description = "按订单号补拉拼多多订单") public class PddOrderRepairDTO { @NotNull - @Schema(description = "内部店铺 ID", requiredMode = Schema.RequiredMode.REQUIRED) private Long shopId; @NotEmpty - @Schema(description = "拼多多订单号列表", requiredMode = Schema.RequiredMode.REQUIRED) private List orderSns; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/dto/PddOrderSyncDayDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/dto/PddOrderSyncDayDTO.java index 624aa6f5..f8321a14 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/dto/PddOrderSyncDayDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/dto/PddOrderSyncDayDTO.java @@ -1,20 +1,16 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.sync.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; import java.time.LocalDate; @Data -@Schema(description = "按成交日同步拼多多订单") public class PddOrderSyncDayDTO { @NotNull - @Schema(description = "内部店铺 ID", requiredMode = Schema.RequiredMode.REQUIRED) private Long shopId; @NotNull - @Schema(description = "成交日期(按天,东八区)", example = "2026-08-03", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDate confirmDate; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/vo/PddOrderSyncResultVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/vo/PddOrderSyncResultVO.java index b8477bc5..a7e75513 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/vo/PddOrderSyncResultVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/order/sync/model/vo/PddOrderSyncResultVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.order.sync.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Data; @@ -9,25 +8,18 @@ import java.util.List; @Data @Builder -@Schema(description = "拼多多订单同步结果") public class PddOrderSyncResultVO { - @Schema(description = "同步模式:day/bootstrap/incremental/repair") private String mode; - @Schema(description = "内部店铺 ID") private Long shopId; - @Schema(description = "拉取到的订单条数(含跳过)") private int fetchedCount; - @Schema(description = "实际 upsert 条数") private int upsertedCount; - @Schema(description = "跳过条数") private int skippedCount; - @Schema(description = "错误信息(若有)") @Builder.Default private List errors = new ArrayList<>(); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/controller/PddShopController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/controller/PddShopController.java index 3014a3b2..6dedd88d 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/controller/PddShopController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/controller/PddShopController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.shop.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -15,7 +12,6 @@ import top.xyquan.ecomdmbbackend.modules.channel.pdd.shop.model.dto.UpdatePddSho import top.xyquan.ecomdmbbackend.modules.channel.pdd.shop.model.vo.PddShopVO; import top.xyquan.ecomdmbbackend.modules.channel.pdd.shop.service.PddShopService; -@Tag(name = "拼多多-店铺管理", description = "拼多多店铺信息的增删改查接口") @RestController @RequestMapping("/api/channel/pdd/shop") public class PddShopController { @@ -26,7 +22,6 @@ public class PddShopController { this.pddShopService = pddShopService; } - @Operation(summary = "创建", description = "创建新的拼多多店铺信息") @PostMapping("/create") @RequirePermission(value = "channel:pdd:shop:manage", description = "创建拼多多店铺", allowSuper = true) public ApiResponse createPddShop(@Valid @RequestBody CreatePddShopDTO createPddShopDTO) { @@ -34,24 +29,20 @@ public class PddShopController { return ApiResponse.success("创建成功", vo); } - @Operation(summary = "更新", description = "更新现有拼多多店铺信息") @PutMapping("/update/{id}") @RequirePermission(value = "channel:pdd:shop:manage", description = "更新拼多多店铺", allowSuper = true) - public ApiResponse updatePddShop(@Valid @RequestBody UpdatePddShopDTO updatePddShopDTO, - @Parameter(description = "店铺ID") @PathVariable Long id) { + public ApiResponse updatePddShop(@Valid @RequestBody UpdatePddShopDTO updatePddShopDTO, @PathVariable Long id) { PddShopVO vo = pddShopService.updatePddShop(updatePddShopDTO, id); return ApiResponse.success("更新成功", vo); } - @Operation(summary = "删除", description = "删除指定拼多多店铺") @DeleteMapping("/delete/{id}") @RequirePermission(value = "channel:pdd:shop:manage", description = "删除拼多多店铺", allowSuper = true) - public ApiResponse deletePddShop(@Parameter(description = "店铺ID") @PathVariable Long id) { + public ApiResponse deletePddShop(@PathVariable Long id) { pddShopService.deletePddShop(id); return ApiResponse.success("删除成功"); } - @Operation(summary = "分页列表", description = "分页获取拼多多店铺列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "channel:pdd:shop:read", description = "查询拼多多店铺列表", allowSuper = true) public ApiResponse> getPddShopPage( @@ -60,10 +51,9 @@ public class PddShopController { return ApiResponse.success("获取成功", result); } - @Operation(summary = "详情", description = "根据ID获取拼多多店铺详情(含授权信息,不含 token)") @GetMapping("/detail/{id}") @RequirePermission(value = "channel:pdd:shop:read", description = "查询拼多多店铺详情", allowSuper = true) - public ApiResponse getPddShopDetail(@Parameter(description = "店铺ID") @PathVariable Long id) { + public ApiResponse getPddShopDetail(@PathVariable Long id) { PddShopVO vo = pddShopService.getPddShopDetail(id); return ApiResponse.success("获取成功", vo); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/CreatePddShopDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/CreatePddShopDTO.java index 65e602a8..b600afd8 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/CreatePddShopDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/CreatePddShopDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.shop.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -8,34 +7,25 @@ import lombok.Data; import java.time.LocalDateTime; @Data -@Schema(description = "创建拼多多店铺DTO") public class CreatePddShopDTO { - @Schema(description = "拼多多授权ID(channel_pdd_auth.id)") private Long pddAuthId; - @Schema(description = "拼多多店铺ID(mall_id)", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "拼多多店铺ID不能为空") private Long mallId; - @Schema(description = "店铺名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "店铺名称不能为空") private String mallName; - @Schema(description = "店铺logo") private String logo; - @Schema(description = "店铺描述") private String mallDesc; - @Schema(description = "店铺类型:1个人 2企业 3旗舰店 4专卖店 5专营店 6普通店", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺类型不能为空") private Integer merchantType; - @Schema(description = "店铺身份:0厂商 1分销商 2都不是 3都是") private Integer mallCharacter; - @Schema(description = "最近一次同步时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "同步时间不能为空") private LocalDateTime lastSyncTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/PddShopFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/PddShopFilterDTO.java index a1edab70..a6ccf0b3 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/PddShopFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/PddShopFilterDTO.java @@ -1,21 +1,15 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.shop.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data -@Schema(description = "拼多多店铺过滤DTO") public class PddShopFilterDTO { - @Schema(description = "店铺名称") private String mallName; - @Schema(description = "店铺类型") private Integer merchantType; - @Schema(description = "店铺身份") private Integer mallCharacter; - @Schema(description = "拼多多授权ID") private Long pddAuthId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/UpdatePddShopDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/UpdatePddShopDTO.java index 6b775279..62bd42cf 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/UpdatePddShopDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/dto/UpdatePddShopDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.shop.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -8,34 +7,25 @@ import lombok.Data; import java.time.LocalDateTime; @Data -@Schema(description = "更新拼多多店铺DTO") public class UpdatePddShopDTO { - @Schema(description = "拼多多授权ID(channel_pdd_auth.id)") private Long pddAuthId; - @Schema(description = "拼多多店铺ID(mall_id)", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "拼多多店铺ID不能为空") private Long mallId; - @Schema(description = "店铺名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "店铺名称不能为空") private String mallName; - @Schema(description = "店铺logo") private String logo; - @Schema(description = "店铺描述") private String mallDesc; - @Schema(description = "店铺类型:1个人 2企业 3旗舰店 4专卖店 5专营店 6普通店", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺类型不能为空") private Integer merchantType; - @Schema(description = "店铺身份:0厂商 1分销商 2都不是 3都是") private Integer mallCharacter; - @Schema(description = "最近一次同步时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "同步时间不能为空") private LocalDateTime lastSyncTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/vo/PddShopVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/vo/PddShopVO.java index 80f4c7db..c2be2507 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/vo/PddShopVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/shop/model/vo/PddShopVO.java @@ -1,51 +1,36 @@ package top.xyquan.ecomdmbbackend.modules.channel.pdd.shop.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import top.xyquan.ecomdmbbackend.modules.channel.pdd.auth.model.vo.PddAuthVO; import java.time.LocalDateTime; @Data -@Schema(description = "拼多多店铺VO") public class PddShopVO { - @Schema(description = "主键ID") private Long id; - @Schema(description = "公司ID") private Long companyId; - @Schema(description = "拼多多授权ID(channel_pdd_auth.id)") private Long pddAuthId; - @Schema(description = "关联的拼多多授权信息(有 pddAuthId 时返回,不含 token)") private PddAuthVO auth; - @Schema(description = "拼多多店铺ID(mall_id)") private Long mallId; - @Schema(description = "店铺名称") private String mallName; - @Schema(description = "店铺logo") private String logo; - @Schema(description = "店铺描述") private String mallDesc; - @Schema(description = "店铺类型:1个人 2企业 3旗舰店 4专卖店 5专营店 6普通店") private Integer merchantType; - @Schema(description = "店铺身份:0厂商 1分销商 2都不是 3都是") private Integer mallCharacter; - @Schema(description = "最近一次同步时间") private LocalDateTime lastSyncTime; - @Schema(description = "创建时间") private LocalDateTime createTime; - @Schema(description = "更新时间") private LocalDateTime updateTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/controller/AdFeeController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/controller/AdFeeController.java index 68a8dab6..b6c722b3 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/controller/AdFeeController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/controller/AdFeeController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.adfee.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -26,13 +23,11 @@ import java.util.List; @RestController @RequestMapping("/api/ec/ad-fee") @RequiredArgsConstructor -@Tag(name = "电商-广告费记录管理", description = "广告费记录相关接口") public class AdFeeController { private final AdFeeService adFeeService; @PostMapping - @Operation(summary = "创建广告费记录", description = "创建新的广告费记录") @RequirePermission(value = "ec:order:create", description = "创建广告费记录", allowSuper = true) public ApiResponse createAdFee(@Valid @RequestBody CreateAdFeeDTO dto) { Long id = adFeeService.createAdFee(dto); @@ -40,7 +35,6 @@ public class AdFeeController { } @PutMapping - @Operation(summary = "更新广告费记录", description = "更新广告费记录信息") @RequirePermission(value = "ec:order:update", description = "更新广告费记录", allowSuper = true) public ApiResponse updateAdFee(@Valid @RequestBody UpdateAdFeeDTO dto) { adFeeService.updateAdFee(dto); @@ -48,25 +42,22 @@ public class AdFeeController { } @DeleteMapping("/{id}") - @Operation(summary = "删除广告费记录", description = "删除指定的广告费记录") @RequirePermission(value = "ec:order:delete", description = "删除广告费记录", allowSuper = true) public ApiResponse deleteAdFee( - @Parameter(description = "记录ID", required = true) @PathVariable Long id) { +@PathVariable Long id) { adFeeService.deleteAdFee(id); return ApiResponse.success("广告费记录删除成功"); } @GetMapping("/{id}") - @Operation(summary = "查询广告费记录详情", description = "根据ID查询广告费记录详情") @RequirePermission(value = "ec:order:read", description = "查询广告费记录详情", allowSuper = true) public ApiResponse getAdFeeById( - @Parameter(description = "记录ID", required = true) @PathVariable Long id) { +@PathVariable Long id) { AdFeeVO vo = adFeeService.getAdFeeById(id); return ApiResponse.success("获取广告费记录详情成功", vo); } @PostMapping("/list") - @Operation(summary = "分页查询广告费记录", description = "分页查询广告费记录列表") @RequirePermission(value = "ec:order:read", description = "查询广告费记录列表", allowSuper = true) public ApiResponse> getAdFeePage( @Valid @RequestBody PageQueryDTO pageQueryDTO) { @@ -75,7 +66,6 @@ public class AdFeeController { } @GetMapping("/fields") - @Operation(summary = "获取广告费导入字段定义", description = "获取广告费导入时可映射的系统字段列表") @RequirePermission(value = "ec:order:read", description = "查询导入字段", allowSuper = true) public ApiResponse> getAdFeeFields() { return ApiResponse.success("获取广告费导入字段成功", AdFeeFieldConstants.FIELDS); diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/AdFeeFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/AdFeeFilterDTO.java index d81134ab..56473932 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/AdFeeFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/AdFeeFilterDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.adfee.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDate; @@ -9,30 +8,25 @@ import java.time.LocalDate; * 广告费记录筛选DTO */ @Data -@Schema(description = "广告费记录筛选DTO") public class AdFeeFilterDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1") private Long shopId; /** * 商品ID(可选) */ - @Schema(description = "商品ID(可选)", example = "1") private Long productId; /** * 推广费发生日期开始 */ - @Schema(description = "推广费发生日期开始", example = "2024-01-01") private LocalDate feeDateStart; /** * 推广费发生日期结束 */ - @Schema(description = "推广费发生日期结束", example = "2024-01-31") private LocalDate feeDateEnd; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/CreateAdFeeDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/CreateAdFeeDTO.java index ba26ae18..3fdd6447 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/CreateAdFeeDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/CreateAdFeeDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.adfee.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -11,45 +10,38 @@ import java.time.LocalDate; * 创建广告费记录DTO */ @Data -@Schema(description = "创建广告费记录DTO") public class CreateAdFeeDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; /** * 商品ID(可选,关联到具体商品) */ - @Schema(description = "商品ID(可选)", example = "1") private Long productId; /** * 推广活动名称 */ - @Schema(description = "推广活动名称", example = "双十一大促") private String campaignName; /** * 推广费金额 */ - @Schema(description = "推广费金额", example = "1000.00", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "推广费金额不能为空") private BigDecimal feeAmount; /** * 推广费发生日期 */ - @Schema(description = "推广费发生日期", example = "2024-01-01", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "推广费发生日期不能为空") private LocalDate feeDate; /** * 备注 */ - @Schema(description = "备注", example = "双十一期间推广费用") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/UpdateAdFeeDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/UpdateAdFeeDTO.java index 6d8df329..54abd0bd 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/UpdateAdFeeDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/dto/UpdateAdFeeDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.adfee.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -11,52 +10,44 @@ import java.time.LocalDate; * 更新广告费记录DTO */ @Data -@Schema(description = "更新广告费记录DTO") public class UpdateAdFeeDTO { /** * 广告费记录ID */ - @Schema(description = "广告费记录ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "广告费记录ID不能为空") private Long id; /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; /** * 商品ID(可选,关联到具体商品) */ - @Schema(description = "商品ID(可选)", example = "1") private Long productId; /** * 推广活动名称 */ - @Schema(description = "推广活动名称", example = "双十一大促") private String campaignName; /** * 推广费金额 */ - @Schema(description = "推广费金额", example = "1000.00", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "推广费金额不能为空") private BigDecimal feeAmount; /** * 推广费发生日期 */ - @Schema(description = "推广费发生日期", example = "2024-01-01", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "推广费发生日期不能为空") private LocalDate feeDate; /** * 备注 */ - @Schema(description = "备注", example = "双十一期间推广费用") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/vo/AdFeeFieldVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/vo/AdFeeFieldVO.java index 7dce4836..50094df9 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/vo/AdFeeFieldVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/vo/AdFeeFieldVO.java @@ -1,27 +1,19 @@ package top.xyquan.ecomdmbbackend.modules.ec.adfee.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data -@Schema(description = "广告费导入字段信息VO") public class AdFeeFieldVO { - @Schema(description = "数据库字段名", example = "campaign_name") private String fieldName; - @Schema(description = "中文字段名", example = "推广活动名称") private String fieldLabel; - @Schema(description = "建议的文件字段名", example = "活动名称") private String fileFieldName; - @Schema(description = "是否必填", example = "true") private Boolean required; - @Schema(description = "排序", example = "1") private Integer sort; - @Schema(description = "数据类型", example = "string") private String dataType; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/vo/AdFeeVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/vo/AdFeeVO.java index b03a6beb..75a153a0 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/vo/AdFeeVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/adfee/model/vo/AdFeeVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.adfee.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -11,96 +10,80 @@ import java.time.LocalDateTime; * 广告费记录VO */ @Data -@Schema(description = "广告费记录VO") public class AdFeeVO { /** * 广告费记录ID */ - @Schema(description = "广告费记录ID", example = "1") private Long id; /** * 公司ID */ - @Schema(description = "公司ID", example = "1") private Long companyId; /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1") private Long shopId; /** * 店铺名称 */ - @Schema(description = "店铺名称", example = "旗舰店") private String shopName; /** * 商品ID(可选) */ - @Schema(description = "商品ID(可选)", example = "1") private Long productId; /** * 商品名称 */ - @Schema(description = "商品名称", example = "iPhone 15 Pro") private String productName; /** * 商品编码 */ - @Schema(description = "商品编码", example = "IPHONE15PRO001") private String productCode; /** * 推广活动名称 */ - @Schema(description = "推广活动名称", example = "双十一大促") private String campaignName; /** * 推广费金额 */ - @Schema(description = "推广费金额", example = "1000.00") private BigDecimal feeAmount; /** * 推广费发生日期 */ - @Schema(description = "推广费发生日期", example = "2024-01-01") private LocalDate feeDate; /** * 备注 */ - @Schema(description = "备注", example = "双十一期间推广费用") private String remark; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建人ID */ - @Schema(description = "创建人ID", example = "1") private Long createBy; /** * 更新人ID */ - @Schema(description = "更新人ID", example = "1") private Long updateBy; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/controller/BrushOrderController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/controller/BrushOrderController.java index 56771e70..e362a5cf 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/controller/BrushOrderController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/controller/BrushOrderController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.brushorder.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -18,7 +15,6 @@ import top.xyquan.ecomdmbbackend.modules.ec.brushorder.service.BrushOrderService /** * 刷单记录管理控制器 */ -@Tag(name = "电商-刷单记录管理", description = "刷单记录的增删改查接口") @RestController @RequestMapping("/api/ec/brush-order") public class BrushOrderController { @@ -29,7 +25,6 @@ public class BrushOrderController { this.brushOrderService = brushOrderService; } - @Operation(summary = "创建刷单记录", description = "创建新的刷单记录") @PostMapping("/create") @RequirePermission(value = "ec:order:create", description = "创建刷单记录", allowSuper = true) public ApiResponse createBrushOrder(@Valid @RequestBody CreateBrushOrderDTO createBrushOrderDTO) { @@ -37,25 +32,22 @@ public class BrushOrderController { return ApiResponse.success("刷单记录创建成功", brushOrderVO); } - @Operation(summary = "更新刷单记录", description = "更新现有刷单记录信息") @PutMapping("/update/{id}") @RequirePermission(value = "ec:order:update", description = "更新刷单记录", allowSuper = true) public ApiResponse updateBrushOrder(@Valid @RequestBody UpdateBrushOrderDTO updateBrushOrderDTO, - @Parameter(description = "刷单记录ID") @PathVariable Long id) { +@PathVariable Long id) { BrushOrderVO brushOrderVO = brushOrderService.updateBrushOrder(updateBrushOrderDTO, id); return ApiResponse.success("刷单记录更新成功", brushOrderVO); } - @Operation(summary = "删除刷单记录", description = "删除指定刷单记录") @DeleteMapping("/delete/{id}") @RequirePermission(value = "ec:order:delete", description = "删除刷单记录", allowSuper = true) public ApiResponse deleteBrushOrder( - @Parameter(description = "刷单记录ID") @PathVariable Long id) { +@PathVariable Long id) { brushOrderService.deleteBrushOrder(id); return ApiResponse.success("刷单记录删除成功"); } - @Operation(summary = "分页获取刷单记录列表", description = "分页获取刷单记录列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "ec:order:read", description = "查询刷单记录列表", allowSuper = true) public ApiResponse> getBrushOrderPage( @@ -64,11 +56,10 @@ public class BrushOrderController { return ApiResponse.success("获取刷单记录列表成功", result); } - @Operation(summary = "获取刷单记录详情", description = "根据ID获取刷单记录详情") @GetMapping("/detail/{id}") @RequirePermission(value = "ec:order:read", description = "查询刷单记录详情", allowSuper = true) public ApiResponse getBrushOrderById( - @Parameter(description = "刷单记录ID") @PathVariable Long id) { +@PathVariable Long id) { BrushOrderVO brushOrderVO = brushOrderService.getBrushOrderById(id); return ApiResponse.success("获取刷单记录详情成功", brushOrderVO); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/BrushOrderFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/BrushOrderFilterDTO.java index 96ffd677..89d5c972 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/BrushOrderFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/BrushOrderFilterDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.brushorder.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -10,44 +9,36 @@ import java.time.LocalDateTime; * 刷单记录分页查询过滤DTO */ @Data -@Schema(description = "刷单记录分页查询过滤DTO") public class BrushOrderFilterDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1") private Long shopId; /** * 商品ID */ - @Schema(description = "商品ID", example = "1") private Long productId; - /** * 刷单金额范围-最小值 */ - @Schema(description = "刷单金额范围-最小值", example = "100.00") private BigDecimal minBrushAmount; /** * 刷单金额范围-最大值 */ - @Schema(description = "刷单金额范围-最大值", example = "10000.00") private BigDecimal maxBrushAmount; /** * 刷单时间范围-开始时间 */ - @Schema(description = "刷单时间范围-开始时间", example = "2024-01-01T00:00:00") private LocalDateTime startBrushTime; /** * 刷单时间范围-结束时间 */ - @Schema(description = "刷单时间范围-结束时间", example = "2024-12-31T23:59:59") private LocalDateTime endBrushTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/CreateBrushOrderDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/CreateBrushOrderDTO.java index 4192d609..f917c6f6 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/CreateBrushOrderDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/CreateBrushOrderDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.brushorder.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; import lombok.Data; @@ -12,54 +11,45 @@ import java.time.LocalDateTime; * 创建刷单记录DTO */ @Data -@Schema(description = "创建刷单记录DTO") public class CreateBrushOrderDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; /** * 商品ID(可选) */ - @Schema(description = "商品ID", example = "1") private Long productId; /** * 商品规格ID(可选) */ - @Schema(description = "商品规格ID", example = "1") private Long productSkuId; /** * 刷单金额 */ - @Schema(description = "刷单金额", example = "9999.00", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "刷单金额不能为空") private BigDecimal brushAmount; /** * 刷单时间 */ - @Schema(description = "刷单时间", example = "2024-01-01T10:00:00", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "刷单时间不能为空") private LocalDateTime brushTime; - /** * 刷单数量 */ - @Schema(description = "刷单数量", example = "1") @Positive(message = "刷单数量必须大于0") private Integer quantity; /** * 备注 */ - @Schema(description = "备注", example = "备注信息") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/UpdateBrushOrderDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/UpdateBrushOrderDTO.java index f9274873..3083c986 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/UpdateBrushOrderDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/dto/UpdateBrushOrderDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.brushorder.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; import lombok.Data; @@ -12,54 +11,45 @@ import java.time.LocalDateTime; * 更新刷单记录DTO */ @Data -@Schema(description = "更新刷单记录DTO") public class UpdateBrushOrderDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; /** * 商品ID(可选) */ - @Schema(description = "商品ID", example = "1") private Long productId; /** * 商品规格ID(可选) */ - @Schema(description = "商品规格ID", example = "1") private Long productSkuId; /** * 刷单金额 */ - @Schema(description = "刷单金额", example = "9999.00", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "刷单金额不能为空") private BigDecimal brushAmount; /** * 刷单时间 */ - @Schema(description = "刷单时间", example = "2024-01-01T10:00:00", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "刷单时间不能为空") private LocalDateTime brushTime; - /** * 刷单数量 */ - @Schema(description = "刷单数量", example = "1") @Positive(message = "刷单数量必须大于0") private Integer quantity; /** * 备注 */ - @Schema(description = "备注", example = "备注信息") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/vo/BrushOrderVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/vo/BrushOrderVO.java index ad21e5d1..33ae06c5 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/vo/BrushOrderVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/brushorder/model/vo/BrushOrderVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.brushorder.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -10,104 +9,86 @@ import java.time.LocalDateTime; * 刷单记录VO */ @Data -@Schema(description = "刷单记录VO") public class BrushOrderVO { /** * 刷单记录ID */ - @Schema(description = "刷单记录ID", example = "1") private Long id; /** * 公司ID */ - @Schema(description = "公司ID", example = "1") private Long companyId; /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1") private Long shopId; /** * 店铺名称 */ - @Schema(description = "店铺名称", example = "旗舰店") private String shopName; /** * 商品ID */ - @Schema(description = "商品ID", example = "1") private Long productId; /** * 商品名称 */ - @Schema(description = "商品名称", example = "iPhone 15 Pro") private String productName; /** * 商品规格ID */ - @Schema(description = "商品规格ID", example = "1") private Long productSkuId; /** * 商品规格名称 */ - @Schema(description = "商品规格名称", example = "256GB 深空黑色") private String productSkuName; /** * 刷单金额 */ - @Schema(description = "刷单金额", example = "9999.00") private BigDecimal brushAmount; /** * 刷单时间 */ - @Schema(description = "刷单时间", example = "2024-01-01T10:00:00") private LocalDateTime brushTime; - /** * 刷单数量 */ - @Schema(description = "刷单数量", example = "1") private Integer quantity; /** * 备注 */ - @Schema(description = "备注", example = "备注信息") private String remark; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建人ID */ - @Schema(description = "创建人ID", example = "1") private Long createBy; /** * 更新人ID */ - @Schema(description = "更新人ID", example = "1") private Long updateBy; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/controller/CategoryController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/controller/CategoryController.java index c8bccae6..62833fce 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/controller/CategoryController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/controller/CategoryController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.category.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -20,7 +17,6 @@ import java.util.List; /** * 商品类目管理控制器 */ -@Tag(name = "电商-商品类目管理", description = "商品类目的增删改查接口") @RestController @RequestMapping("/api/ec/category") public class CategoryController { @@ -31,7 +27,6 @@ public class CategoryController { this.categoryService = categoryService; } - @Operation(summary = "创建类目", description = "创建新的商品类目") @PostMapping("/create") @RequirePermission(value = "ec:category:manage", description = "创建类目", allowSuper = true) public ApiResponse createCategory(@Valid @RequestBody CreateCategoryDTO createCategoryDTO) { @@ -39,25 +34,22 @@ public class CategoryController { return ApiResponse.success("类目创建成功", categoryVO); } - @Operation(summary = "更新类目", description = "更新现有商品类目信息") @PutMapping("/update/{id}") @RequirePermission(value = "ec:category:manage", description = "更新类目", allowSuper = true) public ApiResponse updateCategory(@Valid @RequestBody UpdateCategoryDTO updateCategoryDTO, - @Parameter(description = "类目ID") @PathVariable Long id) { +@PathVariable Long id) { CategoryVO categoryVO = categoryService.updateCategory(updateCategoryDTO, id); return ApiResponse.success("类目更新成功", categoryVO); } - @Operation(summary = "删除类目", description = "删除指定商品类目") @DeleteMapping("/delete/{id}") @RequirePermission(value = "ec:category:manage", description = "删除类目", allowSuper = true) public ApiResponse deleteCategory( - @Parameter(description = "类目ID") @PathVariable Long id) { +@PathVariable Long id) { categoryService.deleteCategory(id); return ApiResponse.success("类目删除成功", null); } - @Operation(summary = "分页获取类目列表", description = "分页获取类目列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "ec:category:read", description = "查询类目列表", allowSuper = true) public ApiResponse> getCategoryPage( @@ -66,7 +58,6 @@ public class CategoryController { return ApiResponse.success("获取类目列表成功", result); } - @Operation(summary = "获取类目树形结构", description = "获取当前公司的所有类目,以树形结构返回") @GetMapping("/tree") @RequirePermission(value = "ec:category:read", description = "查询类目树", allowSuper = true) public ApiResponse> getCategoryTree() { @@ -74,7 +65,6 @@ public class CategoryController { return ApiResponse.success("获取类目树成功", tree); } - @Operation(summary = "获取类目扁平列表", description = "获取当前公司的所有类目,以扁平列表返回,用于下拉选择") @GetMapping("/list") @RequirePermission(value = "ec:category:read", description = "查询类目列表", allowSuper = true) public ApiResponse> getCategoryList() { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/CategoryFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/CategoryFilterDTO.java index a92ffdc2..40aeffcf 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/CategoryFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/CategoryFilterDTO.java @@ -1,24 +1,20 @@ package top.xyquan.ecomdmbbackend.modules.ec.category.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 类目分页查询过滤DTO */ @Data -@Schema(description = "类目分页查询过滤DTO") public class CategoryFilterDTO { /** * 类目名称(模糊查询) */ - @Schema(description = "类目名称(模糊查询)", example = "手机") private String name; /** * 父级类目ID(精确查询) */ - @Schema(description = "父级类目ID(精确查询)", example = "1") private Long parentId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/CreateCategoryDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/CreateCategoryDTO.java index 42c4056e..ad59e1c7 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/CreateCategoryDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/CreateCategoryDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.category.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,25 +7,21 @@ import lombok.Data; * 创建类目DTO */ @Data -@Schema(description = "创建类目DTO") public class CreateCategoryDTO { /** * 父级类目ID */ - @Schema(description = "父级类目ID(顶级类目不传)") private Long parentId; /** * 类目名称 */ - @Schema(description = "类目名称", example = "手机数码", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "类目名称不能为空") private String name; /** * 排序 */ - @Schema(description = "排序", example = "0") private Integer sortOrder; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/UpdateCategoryDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/UpdateCategoryDTO.java index 26e9404c..d2bb4fae 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/UpdateCategoryDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/dto/UpdateCategoryDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.category.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,25 +7,21 @@ import lombok.Data; * 更新类目DTO */ @Data -@Schema(description = "更新类目DTO") public class UpdateCategoryDTO { /** * 父级类目ID */ - @Schema(description = "父级类目ID(设为null表示顶级)") private Long parentId; /** * 类目名称 */ - @Schema(description = "类目名称", example = "手机数码", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "类目名称不能为空") private String name; /** * 排序 */ - @Schema(description = "排序", example = "0") private Integer sortOrder; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/vo/CategoryVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/vo/CategoryVO.java index 697698e0..4282c3b9 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/vo/CategoryVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/category/model/vo/CategoryVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.category.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -10,72 +9,60 @@ import java.util.List; * 类目VO */ @Data -@Schema(description = "类目VO") public class CategoryVO { /** * 类目ID */ - @Schema(description = "类目ID", example = "1") private Long id; /** * 公司ID */ - @Schema(description = "公司ID", example = "1") private Long companyId; /** * 父级类目ID */ - @Schema(description = "父级类目ID", example = "1") private Long parentId; /** * 父级类目名称 */ - @Schema(description = "父级类目名称", example = "数码") private String parentName; /** * 类目名称 */ - @Schema(description = "类目名称", example = "手机") private String name; /** * 排序 */ - @Schema(description = "排序", example = "0") private Integer sortOrder; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建人ID */ - @Schema(description = "创建人ID", example = "1") private Long createBy; /** * 更新人ID */ - @Schema(description = "更新人ID", example = "1") private Long updateBy; /** * 子类目列表 */ - @Schema(description = "子类目列表") private List children; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/controller/ImportMappingController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/controller/ImportMappingController.java index 5d97b8e7..a050b1b8 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/controller/ImportMappingController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/controller/ImportMappingController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.importmapping.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -18,7 +15,6 @@ import top.xyquan.ecomdmbbackend.modules.ec.importmapping.service.ImportMappingS /** * 导入映射模板管理控制器 */ -@Tag(name = "电商-导入映射模板管理", description = "导入映射模板的增删改查接口") @RestController @RequestMapping("/api/ec/import-mapping") public class ImportMappingController { @@ -29,7 +25,6 @@ public class ImportMappingController { this.importMappingService = importMappingService; } - @Operation(summary = "创建导入映射模板", description = "创建新的导入映射模板") @PostMapping("/create") @RequirePermission(value = "data:import", description = "创建导入映射模板", allowSuper = true) public ApiResponse createImportMapping(@Valid @RequestBody CreateImportMappingDTO createImportMappingDTO) { @@ -37,26 +32,23 @@ public class ImportMappingController { return ApiResponse.success("导入映射模板创建成功", importMappingVO); } - @Operation(summary = "更新导入映射模板", description = "更新现有导入映射模板") @PutMapping("/update/{id}") @RequirePermission(value = "data:import", description = "更新导入映射模板", allowSuper = true) public ApiResponse updateImportMapping( @Valid @RequestBody UpdateImportMappingDTO updateImportMappingDTO, - @Parameter(description = "模板ID") @PathVariable Long id) { +@PathVariable Long id) { ImportMappingVO importMappingVO = importMappingService.updateImportMapping(updateImportMappingDTO, id); return ApiResponse.success("导入映射模板更新成功", importMappingVO); } - @Operation(summary = "删除导入映射模板", description = "删除指定导入映射模板") @DeleteMapping("/delete/{id}") @RequirePermission(value = "data:import", description = "删除导入映射模板", allowSuper = true) public ApiResponse deleteImportMapping( - @Parameter(description = "模板ID") @PathVariable Long id) { +@PathVariable Long id) { importMappingService.deleteImportMapping(id); return ApiResponse.success("导入映射模板删除成功"); } - @Operation(summary = "分页获取导入映射模板列表", description = "分页获取导入映射模板列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "data:import", description = "查询导入映射模板列表", allowSuper = true) public ApiResponse> getImportMappingPage( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/CreateImportMappingDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/CreateImportMappingDTO.java index 63db4ff2..380e4392 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/CreateImportMappingDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/CreateImportMappingDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.importmapping.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Pattern; import lombok.Data; @@ -9,13 +8,11 @@ import lombok.Data; * 创建导入映射模板DTO */ @Data -@Schema(description = "创建导入映射模板DTO") public class CreateImportMappingDTO { /** * 导入类型(PRODUCT-商品 ORDER-订单 ORDER_STATUS-订单状态 PROMOTION_FEE-推广费) */ - @Schema(description = "导入类型", example = "PRODUCT", requiredMode = Schema.RequiredMode.REQUIRED, allowableValues = {"PRODUCT", "ORDER", "ORDER_STATUS", "PROMOTION_FEE"}) @NotBlank(message = "导入类型不能为空") @Pattern(regexp = "^(PRODUCT|ORDER|ORDER_STATUS|PROMOTION_FEE)$", message = "导入类型只能是PRODUCT、ORDER、ORDER_STATUS或PROMOTION_FEE") private String type; @@ -23,14 +20,12 @@ public class CreateImportMappingDTO { /** * 模板名称 */ - @Schema(description = "模板名称", example = "商品导入映射模板", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "模板名称不能为空") private String name; /** * 模板JSON */ - @Schema(description = "模板JSON", example = "{\"商品名称\":\"name\",\"价格(元)\":\"price\"}", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "模板JSON不能为空") private String mapping; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/ImportMappingFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/ImportMappingFilterDTO.java index 1d3bb44f..1c3d899a 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/ImportMappingFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/ImportMappingFilterDTO.java @@ -1,25 +1,21 @@ package top.xyquan.ecomdmbbackend.modules.ec.importmapping.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 导入映射模板过滤DTO */ @Data -@Schema(description = "导入映射模板过滤DTO") public class ImportMappingFilterDTO { /** * 导入类型(PRODUCT-商品 ORDER-订单 ORDER_STATUS-订单状态 PROMOTION_FEE-推广费) */ - @Schema(description = "导入类型", example = "PRODUCT", allowableValues = {"PRODUCT", "ORDER", "ORDER_STATUS", "PROMOTION_FEE"}) private String type; /** * 模板名称(模糊查询) */ - @Schema(description = "模板名称(模糊查询)", example = "商品导入") private String name; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/UpdateImportMappingDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/UpdateImportMappingDTO.java index e3d1ad6d..da9cc569 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/UpdateImportMappingDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/dto/UpdateImportMappingDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.importmapping.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,19 +7,16 @@ import lombok.Data; * 更新导入映射模板DTO */ @Data -@Schema(description = "更新导入映射模板DTO") public class UpdateImportMappingDTO { /** * 模板名称 */ - @Schema(description = "模板名称", example = "商品导入映射模板") private String name; /** * 模板JSON */ - @Schema(description = "模板JSON", example = "{\"商品名称\":\"name\",\"价格(元)\":\"price\"}", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "模板JSON不能为空") private String mapping; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/vo/ImportMappingVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/vo/ImportMappingVO.java index a84ed51f..c9ce574c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/vo/ImportMappingVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importmapping/model/vo/ImportMappingVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.importmapping.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,61 +8,51 @@ import java.time.LocalDateTime; * 导入映射模板VO */ @Data -@Schema(description = "导入映射模板VO") public class ImportMappingVO { /** * 模板ID */ - @Schema(description = "模板ID", example = "1") private Long id; /** * 所属公司ID */ - @Schema(description = "所属公司ID", example = "1") private Long companyId; /** * 导入类型(PRODUCT-商品 ORDER-订单 ORDER_STATUS-订单状态) */ - @Schema(description = "导入类型", example = "PRODUCT") private String type; /** * 模板名称 */ - @Schema(description = "模板名称", example = "商品导入映射模板") private String name; /** * 模板JSON */ - @Schema(description = "模板JSON", example = "{\"商品名称\":\"name\",\"价格(元)\":\"price\"}") private String mapping; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建人ID */ - @Schema(description = "创建人ID", example = "1") private Long createBy; /** * 更新人ID */ - @Schema(description = "更新人ID", example = "1") private Long updateBy; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/controller/ImportTaskController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/controller/ImportTaskController.java index 023d3399..cb490d4e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/controller/ImportTaskController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/controller/ImportTaskController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.importtask.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -16,7 +14,6 @@ import top.xyquan.ecomdmbbackend.modules.ec.importtask.service.ImportTaskService /** * 导入任务管理控制器 */ -@Tag(name = "电商-导入任务管理", description = "导入任务的创建和查询接口") @RestController @RequestMapping("/api/ec/import-task") public class ImportTaskController { @@ -27,7 +24,6 @@ public class ImportTaskController { this.importTaskService = importTaskService; } - @Operation(summary = "创建导入任务", description = "创建新的导入任务") @PostMapping("/create") @RequirePermission(value = "data:import", description = "创建导入任务", allowSuper = true) public ApiResponse createImportTask(@Valid @RequestBody CreateImportTaskDTO createImportTaskDTO) { @@ -35,7 +31,6 @@ public class ImportTaskController { return ApiResponse.success("导入任务创建成功", importTaskVO); } - @Operation(summary = "分页获取导入任务列表", description = "分页获取导入任务列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "data:import", description = "查询导入任务列表", allowSuper = true) public ApiResponse> getImportTaskPage( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/dto/CreateImportTaskDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/dto/CreateImportTaskDTO.java index 84453447..04018cfb 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/dto/CreateImportTaskDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/dto/CreateImportTaskDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.importtask.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; @@ -10,20 +9,17 @@ import lombok.Data; * 创建导入任务DTO */ @Data -@Schema(description = "创建导入任务DTO") public class CreateImportTaskDTO { /** * 所属店铺ID */ - @Schema(description = "所属店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; /** * 导入类型(product-商品 order-订单 promotion_record-推广记录) */ - @Schema(description = "导入类型", example = "product", requiredMode = Schema.RequiredMode.REQUIRED, allowableValues = {"product", "order", "promotion_record"}) @NotBlank(message = "导入类型不能为空") @Pattern(regexp = "^(product|order|promotion_record)$", message = "导入类型只能是product、order或promotion_record") private String type; @@ -31,21 +27,18 @@ public class CreateImportTaskDTO { /** * 原始文件名 */ - @Schema(description = "原始文件名", example = "商品导入.xlsx", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "文件名不能为空") private String fileName; /** * 关联文件ID(外键到sys_file) */ - @Schema(description = "关联文件ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "文件ID不能为空") private Long fileId; /** * 字段映射记录(JSON字符串) */ - @Schema(description = "字段映射记录", example = "{\"商品名称\":\"name\",\"价格\":\"price\"}") private String mapping; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/dto/ImportTaskFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/dto/ImportTaskFilterDTO.java index b9ce074b..505b91c8 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/dto/ImportTaskFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/dto/ImportTaskFilterDTO.java @@ -1,37 +1,31 @@ package top.xyquan.ecomdmbbackend.modules.ec.importtask.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 导入任务过滤DTO */ @Data -@Schema(description = "导入任务过滤DTO") public class ImportTaskFilterDTO { /** * 所属店铺ID */ - @Schema(description = "所属店铺ID", example = "1") private Long shopId; /** * 导入类型(product-商品 order-订单) */ - @Schema(description = "导入类型", example = "product", allowableValues = {"product", "order"}) private String type; /** * 任务状态 */ - @Schema(description = "任务状态", example = "pending", allowableValues = {"pending", "processing", "success", "failed"}) private String status; /** * 文件名(模糊查询) */ - @Schema(description = "文件名(模糊查询)", example = "商品") private String fileName; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/vo/ImportTaskVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/vo/ImportTaskVO.java index 2e67cc0b..ca2850a3 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/vo/ImportTaskVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/importtask/model/vo/ImportTaskVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.importtask.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,115 +8,96 @@ import java.time.LocalDateTime; * 导入任务VO */ @Data -@Schema(description = "导入任务VO") public class ImportTaskVO { /** * 主键ID */ - @Schema(description = "主键ID", example = "1") private Long id; /** * 所属公司ID */ - @Schema(description = "所属公司ID", example = "1") private Long companyId; /** * 所属店铺ID */ - @Schema(description = "所属店铺ID", example = "1") private Long shopId; /** * 所属店铺名称 */ - @Schema(description = "所属店铺名称", example = "旗舰店") private String shopName; /** * 导入类型(product-商品 order-订单) */ - @Schema(description = "导入类型", example = "product") private String type; /** * 任务名称 */ - @Schema(description = "任务名称", example = "T-1001-20260311123059") private String taskName; /** * 原始文件名 */ - @Schema(description = "原始文件名", example = "商品导入.xlsx") private String fileName; /** * 关联文件ID */ - @Schema(description = "关联文件ID", example = "1") private Long fileId; /** * 任务状态 */ - @Schema(description = "任务状态", example = "pending") private String status; /** * 总行数 */ - @Schema(description = "总行数", example = "100") private Integer totalCount; /** * 成功行数 */ - @Schema(description = "成功行数", example = "95") private Integer successCount; /** * 失败行数 */ - @Schema(description = "失败行数", example = "5") private Integer failCount; /** * 字段映射记录(JSON字符串) */ - @Schema(description = "字段映射记录", example = "{\"商品名称\":\"name\",\"价格\":\"price\"}") private String mapping; /** * 错误信息或备注 */ - @Schema(description = "错误信息或备注", example = "处理完成") private String message; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建人ID */ - @Schema(description = "创建人ID", example = "1") private Long createBy; /** * 更新人ID */ - @Schema(description = "更新人ID", example = "1") private Long updateBy; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/controller/OrderController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/controller/OrderController.java index 5503cfdc..b914eb63 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/controller/OrderController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/controller/OrderController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -27,7 +24,6 @@ import java.util.List; /** * 订单管理控制器 */ -@Tag(name = "电商-订单管理", description = "订单的增删改查接口") @RestController @RequestMapping("/api/ec/order") public class OrderController { @@ -38,7 +34,6 @@ public class OrderController { this.orderService = orderService; } - @Operation(summary = "创建订单", description = "创建新的订单") @PostMapping("/create") @RequiresOrderCreateLicense @RequirePermission(value = "ec:order:create", description = "创建订单", allowSuper = true) @@ -47,25 +42,22 @@ public class OrderController { return ApiResponse.success("订单创建成功", orderVO); } - @Operation(summary = "更新订单", description = "更新现有订单信息") @PutMapping("/update/{id}") @RequirePermission(value = "ec:order:update", description = "更新订单", allowSuper = true) public ApiResponse updateOrder(@Valid @RequestBody UpdateOrderDTO updateOrderDTO, - @Parameter(description = "订单ID") @PathVariable Long id) { +@PathVariable Long id) { OrderVO orderVO = orderService.updateOrder(updateOrderDTO, id); return ApiResponse.success("订单更新成功", orderVO); } - @Operation(summary = "删除订单", description = "删除指定订单") @DeleteMapping("/delete/{id}") @RequirePermission(value = "ec:order:delete", description = "删除订单", allowSuper = true) public ApiResponse deleteOrder( - @Parameter(description = "订单ID") @PathVariable Long id) { +@PathVariable Long id) { orderService.deleteOrder(id); return ApiResponse.success("订单删除成功"); } - @Operation(summary = "批量删除订单", description = "按ID批量删除订单,须属于当前公司") @PostMapping("/batch-delete") @RequirePermission(value = "ec:order:delete", description = "删除订单", allowSuper = true) public ApiResponse batchDeleteOrders(@Valid @RequestBody BatchDeleteOrderDTO dto) { @@ -73,7 +65,6 @@ public class OrderController { return ApiResponse.success("批量删除订单成功"); } - @Operation(summary = "分页获取订单列表", description = "分页获取订单列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "ec:order:read", description = "查询订单列表", allowSuper = true) public ApiResponse> getOrderPage( @@ -82,16 +73,14 @@ public class OrderController { return ApiResponse.success("获取订单列表成功", result); } - @Operation(summary = "获取订单详情", description = "根据ID获取订单详情") @GetMapping("/detail/{id}") @RequirePermission(value = "ec:order:read", description = "查询订单详情", allowSuper = true) public ApiResponse getOrderById( - @Parameter(description = "订单ID") @PathVariable Long id) { +@PathVariable Long id) { OrderVO orderVO = orderService.getOrderById(id); return ApiResponse.success("获取订单详情成功", orderVO); } - @Operation(summary = "批量导入订单", description = "批量导入订单数据,支持部分成功部分失败") @PostMapping("/batch-import") @LicenseRequired @RequirePermission(value = "ec:order:import", description = "批量导入订单", allowSuper = true) @@ -100,7 +89,6 @@ public class OrderController { return ApiResponse.success("批量导入订单成功", result); } - @Operation(summary = "获取订单字段信息列表", description = "获取订单导入的字段信息列表") @GetMapping("/fields") @RequirePermission(value = "ec:order:read", description = "获取订单字段信息列表", allowSuper = true) public ApiResponse> getOrderFieldDefs() { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/BatchDeleteOrderDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/BatchDeleteOrderDTO.java index b0e3da78..45541f8f 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/BatchDeleteOrderDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/BatchDeleteOrderDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Size; import lombok.Data; @@ -11,10 +10,8 @@ import java.util.List; * 批量删除订单 DTO */ @Data -@Schema(description = "批量删除订单DTO") public class BatchDeleteOrderDTO { - @Schema(description = "订单ID列表", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "订单ID列表不能为空") @Size(max = 500, message = "单次最多删除500条订单") private List orderIds; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/BatchImportOrderDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/BatchImportOrderDTO.java index 5e09fc6c..da95aa95 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/BatchImportOrderDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/BatchImportOrderDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; import lombok.Data; @@ -11,13 +10,11 @@ import java.util.List; * 批量导入订单DTO */ @Data -@Schema(description = "批量导入订单DTO") public class BatchImportOrderDTO { /** * 订单列表 */ - @Schema(description = "订单列表", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "订单列表不能为空") @Valid private List orders; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/CreateOrderDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/CreateOrderDTO.java index d474e482..86838a2c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/CreateOrderDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/CreateOrderDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; @@ -15,104 +14,73 @@ import java.util.List; * 创建订单 DTO(主表 + 明细;导入可仍用扁平单行字段) */ @Data -@Schema(description = "创建订单DTO") public class CreateOrderDTO { - @Schema(description = "店铺ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; - @Schema(description = "平台订单号") private String platformOrderNo; - @Schema(description = "订单状态码", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "订单状态不能为空") private String status; - @Schema(description = "买家实付金额", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "实付金额不能为空") private BigDecimal payAmount; - @Schema(description = "商家实收金额(未传时按 实付-服务费+平台优惠 计算)") private BigDecimal receivedAmount; - @Schema(description = "平台服务费") private BigDecimal serviceFee; - @Schema(description = "下单时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "下单时间不能为空") private LocalDateTime orderTime; - @Schema(description = "导入时下单时间是否为空(仅用于更新跳过逻辑)") private Boolean orderTimeEmptyInInput; - @Schema(description = "平台代码(未传时从店铺补全)") private String platformCode; - @Schema(description = "来源:import/sync/manual") private String source; - @Schema(description = "商品金额合计") private BigDecimal goodsAmount; - @Schema(description = "折扣金额合计") private BigDecimal discountAmount; - @Schema(description = "邮费") private BigDecimal postage; - @Schema(description = "平台优惠") private BigDecimal platformDiscount; - @Schema(description = "商家优惠") private BigDecimal sellerDiscount; - @Schema(description = "订单明细(至少 1 条;未传时 Service 用下方扁平字段合成一行)") @Valid private List items; /** 导入兼容:扁平单行字段 */ - @Schema(description = "商品规格ID(扁平导入)") private Long productSkuId; - @Schema(description = "规格编码(扁平导入)") private String skuCode; @JsonIgnore - @Schema(hidden = true) private Long shopRelationProductId; - @Schema(description = "链接商品名称(扁平导入)") private String linkProductName; - @Schema(description = "链接规格名称(扁平导入)") private String linkSkuName; - @Schema(description = "数量(扁平导入)") @Positive(message = "数量必须大于0") private Integer quantity; - @Schema(description = "销售单价(扁平导入)") private BigDecimal unitPrice; - @Schema(description = "单件商品成本(扁平导入)") private BigDecimal productCost; - @Schema(description = "单件运费成本(扁平导入)") private BigDecimal shippingCost; - @Schema(description = "单件其他成本(扁平导入)") private BigDecimal otherCost; - @Schema(description = "备注") private String remark; - @Schema(description = "导入任务ID") private Long importTaskId; - @Schema(description = "确认(0-否 1-是)") private Integer confirm; - @Schema(description = "已存在的订单ID(导入时用于更新)") private Long existingOrderId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/CreateOrderItemDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/CreateOrderItemDTO.java index 1e65d0da..34efab86 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/CreateOrderItemDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/CreateOrderItemDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; import lombok.Data; @@ -11,42 +10,30 @@ import java.math.BigDecimal; * 创建/导入订单明细 DTO */ @Data -@Schema(description = "创建订单明细 DTO") public class CreateOrderItemDTO { - @Schema(description = "商品规格ID", example = "1") private Long productSkuId; - @Schema(description = "规格编码", example = "SKU001") private String skuCode; - @Schema(description = "链接商品名称", example = "iPhone 15 Pro") @NotNull(message = "链接商品名称不能为空") private String linkProductName; - @Schema(description = "链接规格名称", example = "256GB") private String linkSkuName; - @Schema(description = "数量", example = "1") @NotNull(message = "数量不能为空") @Positive(message = "数量必须大于0") private Integer quantity; - @Schema(description = "销售单价", example = "9999.00") private BigDecimal unitPrice; - @Schema(description = "行实收/行销售额") private BigDecimal lineAmount; - @Schema(description = "单件商品成本快照") private BigDecimal productCost; - @Schema(description = "单件运费成本快照") private BigDecimal shippingCost; - @Schema(description = "单件其他成本快照") private BigDecimal otherCost; - @Schema(description = "明细备注") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/OrderFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/OrderFilterDTO.java index 64f3074c..2a581299 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/OrderFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/OrderFilterDTO.java @@ -2,7 +2,6 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.dto; import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -12,44 +11,32 @@ import java.time.LocalDateTime; * 订单分页查询过滤 DTO */ @Data -@Schema(description = "订单分页查询过滤DTO") public class OrderFilterDTO { - @Schema(description = "店铺ID") private Long shopId; - @Schema(description = "平台代码(如 pdd/taobao/jd)") private String platformCode; - @Schema(description = "平台订单号(默认前缀匹配;含%/_ 时全模糊)") private String platformOrderNo; - @Schema(description = "订单状态码") private String status; - @Schema(description = "实付金额范围-最小值") @JsonAlias("minReceivedAmount") private BigDecimal minPayAmount; - @Schema(description = "实付金额范围-最大值") @JsonAlias("maxReceivedAmount") private BigDecimal maxPayAmount; - @Schema(description = "下单时间范围-开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime startOrderTime; - @Schema(description = "下单时间范围-结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endOrderTime; - @Schema(description = "导入任务ID") private Long importTaskId; - @Schema(description = "确认(0-否 1-是)") private Integer confirm; - @Schema(description = "商品ID(走明细 EXISTS)") private Long productId; public BigDecimal getMinReceivedAmount() { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/UpdateOrderDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/UpdateOrderDTO.java index 8722384e..bc46beed 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/UpdateOrderDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/dto/UpdateOrderDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -13,55 +12,39 @@ import java.util.List; * 更新订单 DTO */ @Data -@Schema(description = "更新订单DTO") public class UpdateOrderDTO { - @Schema(description = "店铺ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; - @Schema(description = "平台订单号") private String platformOrderNo; - @Schema(description = "订单状态码") private String status; - @Schema(description = "买家实付金额", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "实付金额不能为空") private BigDecimal payAmount; - @Schema(description = "商家实收金额(未传时按 实付-服务费+平台优惠 计算)") private BigDecimal receivedAmount; - @Schema(description = "平台服务费") private BigDecimal serviceFee; - @Schema(description = "下单时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "下单时间不能为空") private LocalDateTime orderTime; - @Schema(description = "平台代码") private String platformCode; - @Schema(description = "来源") private String source; - @Schema(description = "商品金额合计") private BigDecimal goodsAmount; - @Schema(description = "折扣金额合计") private BigDecimal discountAmount; - @Schema(description = "邮费") private BigDecimal postage; - @Schema(description = "平台优惠") private BigDecimal platformDiscount; - @Schema(description = "商家优惠") private BigDecimal sellerDiscount; - @Schema(description = "订单明细(全量替换)") @Valid private List items; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/BatchImportResultVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/BatchImportResultVO.java index 2ea9ddd6..7f45a7b5 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/BatchImportResultVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/BatchImportResultVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; @@ -9,62 +8,52 @@ import java.util.List; * 批量导入结果VO */ @Data -@Schema(description = "批量导入结果VO") public class BatchImportResultVO { /** * 总数量 */ - @Schema(description = "总数量", example = "100") private Integer totalCount; /** * 成功数量 */ - @Schema(description = "成功数量", example = "95") private Integer successCount; /** * 失败数量 */ - @Schema(description = "失败数量", example = "5") private Integer failureCount; /** * 成功创建的订单列表 */ - @Schema(description = "成功创建的订单列表") private List successOrders; /** * 失败记录列表 */ - @Schema(description = "失败记录列表") private List failureRecords; /** * 导入失败记录 */ @Data - @Schema(description = "导入失败记录") public static class ImportFailureRecord { /** * 失败行号(从1开始) */ - @Schema(description = "失败行号", example = "3") private Integer rowNumber; /** * 平台订单号 */ - @Schema(description = "平台订单号", example = "TB202401010003") private String platformOrderNo; /** * 失败原因 */ - @Schema(description = "失败原因", example = "店铺不存在") private String failureReason; } } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderFieldVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderFieldVO.java index c735f39d..be12a8dd 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderFieldVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderFieldVO.java @@ -1,30 +1,22 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 订单字段信息VO */ @Data -@Schema(description = "订单字段信息VO") public class OrderFieldVO { - @Schema(description = "数据库字段名", example = "platform_order_no") private String fieldName; - @Schema(description = "中文字段名", example = "平台订单号") private String fieldLabel; - @Schema(description = "文件字段名", example = "订单号") private String fileFieldName; - @Schema(description = "是否必填", example = "true") private Boolean required; - @Schema(description = "排序", example = "1") private Integer sort; - @Schema(description = "数据类型", example = "string") private String dataType; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderItemVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderItemVO.java index 94008fbb..878d5948 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderItemVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderItemVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import top.xyquan.ecomdmbbackend.modules.ec.product.model.vo.ProductSkuVO; import top.xyquan.ecomdmbbackend.modules.ec.product.model.vo.ProductVO; @@ -11,57 +10,39 @@ import java.math.BigDecimal; * 订单明细 VO */ @Data -@Schema(description = "订单明细 VO") public class OrderItemVO { - @Schema(description = "明细ID") private Long id; - @Schema(description = "行号") private Integer lineNo; - @Schema(description = "商品ID") private Long productId; - @Schema(description = "商品规格ID") private Long productSkuId; - @Schema(description = "规格编码") private String skuCode; - @Schema(description = "链接商品名称") private String linkProductName; - @Schema(description = "链接规格名称") private String linkSkuName; - @Schema(description = "商品图片URL") private String goodsImg; - @Schema(description = "数量") private Integer quantity; - @Schema(description = "销售单价") private BigDecimal unitPrice; - @Schema(description = "行实收/行销售额") private BigDecimal lineAmount; - @Schema(description = "单件商品成本快照") private BigDecimal productCost; - @Schema(description = "单件运费成本快照") private BigDecimal shippingCost; - @Schema(description = "单件其他成本快照") private BigDecimal otherCost; - @Schema(description = "明细备注") private String remark; - @Schema(description = "关联商品") private ProductVO product; - @Schema(description = "关联规格") private ProductSkuVO productSku; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderVO.java index a7ed395e..0f6e745b 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/model/vo/OrderVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import top.xyquan.ecomdmbbackend.modules.ec.shop.model.vo.ShopVO; @@ -12,144 +11,97 @@ import java.util.List; * 订单 VO(主表 + 明细列表) */ @Data -@Schema(description = "订单VO") public class OrderVO { - @Schema(description = "订单ID") private Long id; - @Schema(description = "公司ID") private Long companyId; - @Schema(description = "店铺ID") private Long shopId; - @Schema(description = "店铺名称") private String shopName; - @Schema(description = "平台代码") private String platformCode; - @Schema(description = "平台名称(由 platformCode 解析)") private String platformLabel; - @Schema(description = "平台订单号") private String platformOrderNo; - @Schema(description = "订单状态码") private String status; - @Schema(description = "订单状态名称") private String statusLabel; - @Schema(description = "订单状态颜色") private String statusColor; - @Schema(description = "来源") private String source; - @Schema(description = "买家实付金额") private BigDecimal payAmount; - @Schema(description = "商家实收金额(=实付-服务费+平台优惠)") private BigDecimal receivedAmount; - @Schema(description = "平台服务费") private BigDecimal serviceFee; - @Schema(description = "商品金额合计") private BigDecimal goodsAmount; - @Schema(description = "折扣金额合计") private BigDecimal discountAmount; - @Schema(description = "邮费") private BigDecimal postage; - @Schema(description = "平台优惠") private BigDecimal platformDiscount; - @Schema(description = "商家优惠") private BigDecimal sellerDiscount; - @Schema(description = "快递公司编码") private String logisticsId; - @Schema(description = "快递运单号") private String trackingNumber; - @Schema(description = "下单时间") private LocalDateTime orderTime; - @Schema(description = "支付时间") private LocalDateTime payTime; - @Schema(description = "成交时间") private LocalDateTime confirmTime; - @Schema(description = "发货时间") private LocalDateTime shippingTime; - @Schema(description = "签收时间") private LocalDateTime receiveTime; - @Schema(description = "省份") private String province; - @Schema(description = "城市") private String city; - @Schema(description = "区县") private String town; - @Schema(description = "收件人姓名脱敏") private String receiverNameMask; - @Schema(description = "收件人手机脱敏") private String receiverPhoneMask; - @Schema(description = "收件地址脱敏") private String receiverAddressMask; - @Schema(description = "买家留言") private String buyerMemo; - @Schema(description = "创建时间") private LocalDateTime createTime; - @Schema(description = "更新时间") private LocalDateTime updateTime; - @Schema(description = "创建人ID") private Long createBy; - @Schema(description = "更新人ID") private Long updateBy; - @Schema(description = "备注") private String remark; - @Schema(description = "导入任务ID") private Long importTaskId; - @Schema(description = "确认(0-否 1-是)") private Integer confirm; - @Schema(description = "平台侧订单更新时间") private LocalDateTime platformUpdatedAt; - @Schema(description = "最近一次转换时间") private LocalDateTime lastMappedTime; - @Schema(description = "明细行数(列表汇总)") private Integer itemCount; - @Schema(description = "首行链接商品名(列表汇总)") private String firstLinkProductName; - @Schema(description = "订单明细") private List items; - @Schema(description = "关联店铺") private ShopVO shop; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/status/controller/OrderStatusDictController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/status/controller/OrderStatusDictController.java index 6ca641b6..62a0b59c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/status/controller/OrderStatusDictController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/status/controller/OrderStatusDictController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.status.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -15,12 +13,10 @@ import java.util.List; /** * 订单状态静态字典(无 CRUD)。 */ -@Tag(name = "电商-订单状态字典", description = "订单状态枚举元数据") @RestController @RequestMapping("/ec/order-status") public class OrderStatusDictController { - @Operation(summary = "获取订单状态列表", description = "返回全局固定枚举元数据") @GetMapping("/list") @RequirePermission(value = "ec:order:read", description = "查询订单状态列表", allowSuper = true) public ApiResponse> listOrderStatuses() { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/status/model/vo/OrderStatusMetaVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/status/model/vo/OrderStatusMetaVO.java index 7a3687bd..69d7e7a3 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/status/model/vo/OrderStatusMetaVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/order/status/model/vo/OrderStatusMetaVO.java @@ -1,39 +1,28 @@ package top.xyquan.ecomdmbbackend.modules.ec.order.status.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 订单状态枚举元数据(静态字典,无 DB 主键)。 */ @Data -@Schema(description = "订单状态元数据") public class OrderStatusMetaVO { - @Schema(description = "状态码", example = "PENDING_SHIPMENT") private String code; - @Schema(description = "状态名称", example = "待发货") private String label; - @Schema(description = "展示颜色", example = "#1677ff") private String color; - @Schema(description = "排序", example = "10") private Integer sortOrder; - @Schema(description = "是否计入销售额/单量") private boolean includeSalesAmount; - @Schema(description = "是否计入商品成本") private boolean includeProductCost; - @Schema(description = "是否计入运费成本") private boolean includeFreightCost; - @Schema(description = "是否计入其他成本") private boolean includeOtherCost; - @Schema(description = "是否计入退款") private boolean includeRefund; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/platform/controller/PlatformDictController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/platform/controller/PlatformDictController.java index bc7a60fb..1a5e5f43 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/platform/controller/PlatformDictController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/platform/controller/PlatformDictController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.platform.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -16,12 +14,10 @@ import java.util.List; /** * 电商平台字典:返回静态 code/label/sortOrder,供下拉选择。 */ -@Tag(name = "电商-平台字典", description = "电商平台静态字典") @RestController @RequestMapping("/api/ec/platform") public class PlatformDictController { - @Operation(summary = "获取平台列表", description = "返回全部预置电商平台(code/label/sortOrder)") @GetMapping("/list") @RequirePermission(value = "ec:shop:read", description = "查询平台字典", allowSuper = true) public ApiResponse> listPlatforms() { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/platform/model/vo/PlatformDictVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/platform/model/vo/PlatformDictVO.java index a74ba4f6..4435efca 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/platform/model/vo/PlatformDictVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/platform/model/vo/PlatformDictVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.platform.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; @@ -9,15 +8,11 @@ import lombok.Data; */ @Data @AllArgsConstructor -@Schema(description = "电商平台字典项") public class PlatformDictVO { - @Schema(description = "平台代码", example = "pdd") private String code; - @Schema(description = "平台名称", example = "拼多多") private String label; - @Schema(description = "排序", example = "3") private int sortOrder; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductController.java index 999053cb..84d61074 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -20,7 +17,6 @@ import top.xyquan.ecomdmbbackend.modules.ec.product.service.ProductService; /** * 商品管理控制器 */ -@Tag(name = "电商-商品管理", description = "商品的增删改查接口") @RestController @RequestMapping("/api/ec/product") public class ProductController { @@ -31,7 +27,6 @@ public class ProductController { this.productService = productService; } - @Operation(summary = "创建商品", description = "创建新的商品;响应含 skuIdsCostChangedWithLinkedOrders:新增规格且规格编码非空、商品/运费/其他成本至少一项大于 0、且本公司在库中存在关联订单的规格ID(如同编码合并),用于提示同步成本") @PostMapping("/create") @RequirePermission(value = "ec:product:create", description = "创建商品", allowSuper = true) public ApiResponse createProduct(@Valid @RequestBody CreateProductDTO createProductDTO) { @@ -39,25 +34,22 @@ public class ProductController { return ApiResponse.success("商品创建成功", result); } - @Operation(summary = "更新商品", description = "更新现有商品信息;响应中的 skuIdsCostChangedWithLinkedOrders 为「成本已变更且存在关联订单」的规格ID,用于提示同步成本") @PutMapping("/update/{id}") @RequirePermission(value = "ec:product:update", description = "更新商品", allowSuper = true) public ApiResponse updateProduct(@Valid @RequestBody UpdateProductDTO updateProductDTO, - @Parameter(description = "商品ID") @PathVariable Long id) { +@PathVariable Long id) { UpdateProductResultDTO result = productService.updateProduct(updateProductDTO, id); return ApiResponse.success("商品更新成功", result); } - @Operation(summary = "删除商品", description = "删除指定商品") @DeleteMapping("/delete/{id}") @RequirePermission(value = "ec:product:delete", description = "删除商品", allowSuper = true) public ApiResponse deleteProduct( - @Parameter(description = "商品ID") @PathVariable Long id) { +@PathVariable Long id) { productService.deleteProduct(id); return ApiResponse.success("商品删除成功", null); } - @Operation(summary = "分页获取商品列表", description = "分页获取商品列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "ec:product:read", description = "查询商品列表", allowSuper = true) public ApiResponse> getProductPage( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductSkuController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductSkuController.java index 447b64af..ab57b332 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductSkuController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductSkuController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; @@ -24,7 +21,6 @@ import top.xyquan.ecomdmbbackend.modules.ec.product.service.ProductSkuService.Pr /** * 商品 SKU 管理控制器 */ -@Tag(name = "电商-商品SKU管理", description = "商品SKU的增删改查接口") @RestController @RequestMapping("/api/ec/product-sku") public class ProductSkuController { @@ -38,7 +34,6 @@ public class ProductSkuController { this.currentUserContext = currentUserContext; } - @Operation(summary = "创建商品SKU") @PostMapping("/create") @RequirePermission(value = "ec:product:create", description = "创建商品SKU", allowSuper = true) public ApiResponse createProductSku(@Valid @RequestBody CreateProductSkuDTO dto) { @@ -46,24 +41,21 @@ public class ProductSkuController { return ApiResponse.success("SKU创建成功", vo); } - @Operation(summary = "更新商品SKU") @PutMapping("/update/{id}") @RequirePermission(value = "ec:product:update", description = "更新商品SKU", allowSuper = true) public ApiResponse updateProductSku(@Valid @RequestBody UpdateProductSkuDTO dto, - @Parameter(description = "商品SKU ID") @PathVariable Long id) { +@PathVariable Long id) { ProductSkuVO vo = productSkuService.updateProductSku(dto, id); return ApiResponse.success("SKU更新成功", vo); } - @Operation(summary = "删除商品SKU") @DeleteMapping("/delete/{id}") @RequirePermission(value = "ec:product:delete", description = "删除商品SKU", allowSuper = true) - public ApiResponse deleteProductSku(@Parameter(description = "商品SKU ID") @PathVariable Long id) { + public ApiResponse deleteProductSku(@PathVariable Long id) { productSkuService.deleteProductSku(id); return ApiResponse.success("SKU删除成功", null); } - @Operation(summary = "分页获取商品SKU列表") @PostMapping("/list") @RequirePermission(value = "ec:product:read", description = "查询商品SKU列表", allowSuper = true) public ApiResponse> getProductSkuPage( @@ -72,7 +64,6 @@ public class ProductSkuController { return ApiResponse.success("获取商品SKU列表成功", result); } - @Operation(summary = "根据ID列表批量查询商品SKU") @PostMapping("/batch-get-by-ids") @RequirePermission(value = "ec:product:read", description = "批量查询商品SKU", allowSuper = true) public ApiResponse> batchGetByIds(@RequestBody List skuIds) { @@ -85,17 +76,15 @@ public class ProductSkuController { return ApiResponse.success("批量获取商品SKU成功", result); } - @Operation(summary = "根据商品名称和SKU编码精准查询") @GetMapping("/find-by-product-and-sku/{productName}/{skuCode}") @RequirePermission(value = "ec:product:read", description = "根据商品名称和SKU编码查询", allowSuper = true) public ApiResponse getProductSkuByProductAndSku( - @Parameter(description = "商品名称") @PathVariable String productName, - @Parameter(description = "SKU编码") @PathVariable String skuCode) { +@PathVariable String productName, +@PathVariable String skuCode) { ProductSkuVO vo = productSkuService.getProductSkuByProductAndSku(productName, skuCode); return ApiResponse.success("查询SKU成功", vo); } - @Operation(summary = "批量根据商品名称和SKU编码查询") @PostMapping("/find-by-product-and-skus") @RequirePermission(value = "ec:product:read", description = "批量根据商品名称和SKU编码查询", allowSuper = true) public ApiResponse> getProductSkusByProductAndSkus(@RequestBody List queries) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductSkuCostController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductSkuCostController.java index 938266ba..46c0676c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductSkuCostController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/controller/ProductSkuCostController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -24,7 +21,6 @@ import java.util.List; /** * 商品 SKU 成本:历史、调价、同步到订单 */ -@Tag(name = "电商-商品SKU成本", description = "SKU成本历史、按生效日调价、同步到订单") @RestController @RequestMapping("/api/ec/product/sku/cost") public class ProductSkuCostController { @@ -44,20 +40,18 @@ public class ProductSkuCostController { this.currentUserContext = currentUserContext; } - @Operation(summary = "查询SKU成本历史") @GetMapping("/{skuId}") @RequirePermission(value = "ec:product:read", description = "查询SKU成本历史", allowSuper = true) public ApiResponse> listSkuCosts( - @Parameter(description = "SKU ID") @PathVariable Long skuId) { +@PathVariable Long skuId) { ProductSkuPO sku = requireCompanySku(skuId); return ApiResponse.success("查询成本历史成功", productSkuCostService.listCostHistory(sku.getId())); } - @Operation(summary = "SKU调价(按生效日追加/同日纠错)") @PostMapping("/{skuId}") @RequirePermission(value = "ec:product:update", description = "SKU调价", allowSuper = true) public ApiResponse adjustSkuCost( - @Parameter(description = "SKU ID") @PathVariable Long skuId, +@PathVariable Long skuId, @Valid @RequestBody AdjustSkuCostDTO dto) { ProductSkuPO sku = requireCompanySku(skuId); Long userId = currentUserContext.getCurrentUserId(); @@ -71,7 +65,6 @@ public class ProductSkuCostController { return ApiResponse.success(changed ? "调价成功" : "成本未变化", vo); } - @Operation(summary = "同步SKU成本到历史订单") @PostMapping("/sync-to-orders") @RequirePermission(value = "ec:product:update", description = "同步成本到订单", allowSuper = true) public ApiResponse syncCostsToOrders(@Valid @RequestBody SyncCostDTO syncCostDTO) { @@ -86,7 +79,6 @@ public class ProductSkuCostController { return ApiResponse.success("成本同步成功,共更新" + updatedCount + "条订单", updatedCount); } - @Operation(summary = "统计成本同步将影响的订单数量") @PostMapping("/count-orders-for-sync") @RequirePermission(value = "ec:product:read", description = "统计成本同步订单数", allowSuper = true) public ApiResponse countOrdersForCostSync(@Valid @RequestBody BatchSyncCostDTO batchSyncCostDTO) { @@ -108,7 +100,6 @@ public class ProductSkuCostController { return ApiResponse.success("统计成功", count); } - @Operation(summary = "批量同步SKU当前生效成本到历史订单") @PostMapping("/batch-sync-to-orders") @RequirePermission(value = "ec:product:update", description = "批量同步成本到订单", allowSuper = true) public ApiResponse batchSyncCostsToOrders(@Valid @RequestBody BatchSyncCostDTO batchSyncCostDTO) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/AdjustSkuCostDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/AdjustSkuCostDTO.java index 6b1fb383..90f88928 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/AdjustSkuCostDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/AdjustSkuCostDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -11,23 +10,17 @@ import java.time.LocalDate; * SKU 调价(按生效日追加/同日纠错) */ @Data -@Schema(description = "SKU调价参数") public class AdjustSkuCostDTO { @NotNull(message = "生效起始日不能为空") - @Schema(description = "生效起始日(含)", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDate effectiveFrom; @NotNull(message = "商品成本不能为空") - @Schema(description = "商品成本", requiredMode = Schema.RequiredMode.REQUIRED) private BigDecimal productCost; - @Schema(description = "运费成本") private BigDecimal shippingCost; - @Schema(description = "其他成本") private BigDecimal otherCost; - @Schema(description = "备注(如调价原因)") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/BatchSyncCostDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/BatchSyncCostDTO.java index 97222a28..8a6fa56c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/BatchSyncCostDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/BatchSyncCostDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -12,27 +11,23 @@ import java.util.List; * 批量同步 SKU 成本到订单的请求 DTO */ @Data -@Schema(description = "批量同步SKU成本到订单的请求DTO") public class BatchSyncCostDTO { /** * SKU ID 列表 */ - @Schema(description = "SKU ID列表", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "SKU ID列表不能为空") private List skuIds; /** * 订单开始时间(包含),格式 yyyy-MM-dd HH:mm:ss;按自然日筛选时一般为起日 00:00:00 */ - @Schema(description = "订单开始时间(含)", example = "2024-01-01 00:00:00") @NotNull(message = "开始时间不能为空") private LocalDateTime startTime; /** * 订单结束时间(包含),格式 yyyy-MM-dd HH:mm:ss;按自然日筛选时一般为止日 23:59:59 */ - @Schema(description = "订单结束时间(含)", example = "2024-12-31 23:59:59") @NotNull(message = "结束时间不能为空") private LocalDateTime endTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductDTO.java index 25494318..b675e391 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; @@ -13,52 +12,38 @@ import java.util.List; * 创建商品 DTO */ @Data -@Schema(description = "创建商品DTO") public class CreateProductDTO { - @Schema(description = "商品名称", example = "iPhone 15 Pro", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "商品名称不能为空") private String name; - @Schema(description = "商品编码", example = "IPHONE15PRO001") private String productCode; - @Schema(description = "类目ID", example = "1") private Long categoryId; - @Schema(description = "主图图片ID", example = "1") private Long mainImageId; - @Schema(description = "商品SKU列表") @Valid private List skus; @Data - @Schema(description = "商品SKU DTO") public static class ProductSkuDTO { - @Schema(description = "SKU名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "SKU名称不能为空") private String name; - @Schema(description = "SKU编码", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "SKU编码不能为空") private String skuCode; - @Schema(description = "商品成本", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "商品成本不能为空") private BigDecimal productCost; - @Schema(description = "运费成本") private BigDecimal shippingCost; - @Schema(description = "其他成本") private BigDecimal otherCost; - @Schema(description = "备注") private String remark; - @Schema(description = "SKU 图文件ID(系统上传)") private Long imageId; } } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductResultDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductResultDTO.java index 2bcfb2ad..f0214128 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductResultDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductResultDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import top.xyquan.ecomdmbbackend.modules.ec.product.model.vo.ProductVO; @@ -10,15 +9,12 @@ import java.util.List; * 创建商品成功响应(含新增规格与历史订单关联时可同步成本的提示) */ @Data -@Schema(description = "创建商品成功响应DTO") public class CreateProductResultDTO { - @Schema(description = "创建后的商品完整信息") private ProductVO product; /** * 新增 SKU 中:skuCode 非空、成本至少一项大于 0、且本公司在库中存在关联订单的 SKU ID */ - @Schema(description = "新增SKU(有成本且有关联订单)的SKU ID列表,用于同步成本提示") private List skuIdsCostChangedWithLinkedOrders; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductSkuDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductSkuDTO.java index 53a496eb..09715463 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductSkuDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/CreateProductSkuDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -11,33 +10,24 @@ import java.math.BigDecimal; * 创建商品 SKU DTO */ @Data -@Schema(description = "创建商品SKU DTO") public class CreateProductSkuDTO { - @Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "商品ID不能为空") private Long productId; - @Schema(description = "SKU名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "SKU名称不能为空") private String name; - @Schema(description = "SKU编码") private String skuCode; - @Schema(description = "商品成本", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "商品成本不能为空") private BigDecimal productCost; - @Schema(description = "运费成本") private BigDecimal shippingCost; - @Schema(description = "其他成本") private BigDecimal otherCost; - @Schema(description = "备注") private String remark; - @Schema(description = "SKU 图文件ID(系统上传)") private Long imageId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/ProductFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/ProductFilterDTO.java index b8650d3f..2e479c13 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/ProductFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/ProductFilterDTO.java @@ -1,47 +1,39 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 商品分页查询过滤DTO */ @Data -@Schema(description = "商品分页查询过滤DTO") public class ProductFilterDTO { /** * 商品名称(模糊查询) */ - @Schema(description = "商品名称(模糊查询)", example = "iPhone") private String name; /** * 类目ID(精准查询) */ - @Schema(description = "类目ID(精准查询)", example = "1") private Long categoryId; /** * 商品编码(精准查询) */ - @Schema(description = "商品编码(精准查询)", example = "IPHONE15PRO001") private String productCode; /** * SKU 编码(精准查询) */ - @Schema(description = "SKU编码(精准查询)", example = "SKU001") private String skuCode; /** * SKU 名称(模糊查询) */ - @Schema(description = "SKU名称(模糊查询)", example = "256GB") private String skuName; /** * 关键字(模糊查询商品名称、商品编码、SKU名称、SKU编码) */ - @Schema(description = "关键字(模糊查询商品名称、商品编码、SKU名称、SKU编码)", example = "iPhone 256") private String keywords; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/ProductSkuFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/ProductSkuFilterDTO.java index 3cff9fec..cb5b6243 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/ProductSkuFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/ProductSkuFilterDTO.java @@ -1,27 +1,20 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 商品 SKU 筛选 DTO */ @Data -@Schema(description = "商品SKU筛选DTO") public class ProductSkuFilterDTO { - @Schema(description = "商品ID") private Long productId; - @Schema(description = "SKU ID") private Long id; - @Schema(description = "SKU名称") private String name; - @Schema(description = "SKU编码") private String skuCode; - @Schema(description = "关键字(模糊查询SKU名称、SKU编码)") private String keywords; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/SyncCostDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/SyncCostDTO.java index 88e350d4..0c46da6c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/SyncCostDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/SyncCostDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -11,45 +10,38 @@ import java.time.LocalDateTime; * 同步 SKU 成本到订单的请求 DTO */ @Data -@Schema(description = "同步SKU成本到订单的请求DTO") public class SyncCostDTO { /** * SKU ID */ - @Schema(description = "SKU ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "SKU ID不能为空") private Long skuId; /** * 商品成本 */ - @Schema(description = "商品成本", example = "100.00") private BigDecimal productCost; /** * 运费成本 */ - @Schema(description = "运费成本", example = "10.00") private BigDecimal shippingCost; /** * 其他成本 */ - @Schema(description = "其他成本", example = "5.00") private BigDecimal otherCost; /** * 订单开始时间(包含),格式 yyyy-MM-dd HH:mm:ss */ - @Schema(description = "订单开始时间", example = "2024-01-01 00:00:00") @NotNull(message = "开始时间不能为空") private LocalDateTime startTime; /** * 订单结束时间(包含),格式 yyyy-MM-dd HH:mm:ss */ - @Schema(description = "订单结束时间", example = "2024-12-31 23:59:59") @NotNull(message = "结束时间不能为空") private LocalDateTime endTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductDTO.java index 2bebe4c2..0fa9d702 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; @@ -13,58 +12,42 @@ import java.util.List; * 更新商品 DTO */ @Data -@Schema(description = "更新商品DTO") public class UpdateProductDTO { - @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "商品名称不能为空") private String name; - @Schema(description = "商品编码", example = "IPHONE15PRO001") private String productCode; - @Schema(description = "类目ID", example = "1") private Long categoryId; - @Schema(description = "主图图片ID", example = "1") private Long mainImageId; - @Schema(description = "商品SKU列表:含 id 为更新,不含 id 为新增") @Valid private List skus; - @Schema(description = "本次需删除的 SKU ID 列表(须属于当前商品)") private List removedSkuIds; @Data - @Schema(description = "商品SKU更新DTO") public static class ProductSkuUpdateDTO { - @Schema(description = "SKU ID:有值则更新,为空则新增", example = "1") private Long id; - @Schema(description = "SKU名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "SKU名称不能为空") private String name; - @Schema(description = "SKU编码", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "SKU编码不能为空") private String skuCode; - @Schema(description = "商品成本", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "商品成本不能为空") private BigDecimal productCost; - @Schema(description = "运费成本") private BigDecimal shippingCost; - @Schema(description = "其他成本") private BigDecimal otherCost; - @Schema(description = "备注") private String remark; - @Schema(description = "SKU 图文件ID(系统上传)") private Long imageId; } } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductResultDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductResultDTO.java index 2f42de55..8c61770d 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductResultDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductResultDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import top.xyquan.ecomdmbbackend.modules.ec.product.model.vo.ProductVO; @@ -10,18 +9,15 @@ import java.util.List; * 更新商品成功响应DTO */ @Data -@Schema(description = "更新商品成功响应DTO") public class UpdateProductResultDTO { /** * 需提示同步成本的 SKU:成本已变更且有关联订单;或本次新增 SKU 且有关联订单 */ - @Schema(description = "成本变更或新增SKU(有成本且有关联订单)的SKU ID列表,用于同步成本提示") private List skuIdsCostChangedWithLinkedOrders; /** * 更新后的商品完整信息 */ - @Schema(description = "更新后的商品完整信息") private ProductVO product; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductSkuDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductSkuDTO.java index f6f32157..a7ccb300 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductSkuDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/dto/UpdateProductSkuDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -11,32 +10,23 @@ import java.math.BigDecimal; * 更新商品 SKU DTO */ @Data -@Schema(description = "更新商品SKU DTO") public class UpdateProductSkuDTO { - @Schema(description = "SKU ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "SKU ID不能为空") private Long id; - @Schema(description = "SKU名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "SKU名称不能为空") private String name; - @Schema(description = "SKU编码") private String skuCode; - @Schema(description = "商品成本(已废弃:调价请走 /product-sku/{id}/costs)") private BigDecimal productCost; - @Schema(description = "运费成本(已废弃:调价请走独立成本接口)") private BigDecimal shippingCost; - @Schema(description = "其他成本(已废弃:调价请走独立成本接口)") private BigDecimal otherCost; - @Schema(description = "备注") private String remark; - @Schema(description = "SKU 图文件ID(系统上传)") private Long imageId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductSkuCostHistoryVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductSkuCostHistoryVO.java index e5e8a3c5..67b9eb33 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductSkuCostHistoryVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductSkuCostHistoryVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -11,27 +10,19 @@ import java.time.LocalDateTime; * SKU 成本历史条目 */ @Data -@Schema(description = "SKU成本历史条目") public class ProductSkuCostHistoryVO { - @Schema(description = "成本记录ID") private Long id; - @Schema(description = "生效起始日(含)") private LocalDate effectiveFrom; - @Schema(description = "商品成本") private BigDecimal productCost; - @Schema(description = "运费成本") private BigDecimal shippingCost; - @Schema(description = "其他成本") private BigDecimal otherCost; - @Schema(description = "备注") private String remark; - @Schema(description = "创建时间") private LocalDateTime createTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductSkuVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductSkuVO.java index a8379613..433a17bf 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductSkuVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductSkuVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -11,57 +10,39 @@ import java.time.LocalDateTime; * 商品 SKU VO(含当前生效成本扁平字段) */ @Data -@Schema(description = "商品SKU VO") public class ProductSkuVO { - @Schema(description = "SKU ID") private Long id; - @Schema(description = "公司ID") private Long companyId; - @Schema(description = "商品ID") private Long productId; - @Schema(description = "商品名称") private String productName; - @Schema(description = "SKU名称") private String name; - @Schema(description = "SKU编码") private String skuCode; - @Schema(description = "SKU图URL(有系统图 id 时优先解析系统图)") private String imageUrl; - @Schema(description = "商品成本(当前生效)") private BigDecimal productCost; - @Schema(description = "运费成本(当前生效)") private BigDecimal shippingCost; - @Schema(description = "其他成本(当前生效)") private BigDecimal otherCost; - @Schema(description = "当前成本生效起始日") private LocalDate costEffectiveFrom; - @Schema(description = "备注") private String remark; - @Schema(description = "创建时间") private LocalDateTime createTime; - @Schema(description = "更新时间") private LocalDateTime updateTime; - @Schema(description = "创建人ID") private Long createBy; - @Schema(description = "更新人ID") private Long updateBy; - @Schema(description = "成本是否变更(本次更新中成本字段有变化)") private Boolean costChanged; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductVO.java index 887b3921..f39ec131 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/product/model/vo/ProductVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.product.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -10,78 +9,65 @@ import java.util.List; * 商品VO */ @Data -@Schema(description = "商品VO") public class ProductVO { /** * 商品ID */ - @Schema(description = "商品ID", example = "1") private Long id; /** * 公司ID */ - @Schema(description = "公司ID", example = "1") private Long companyId; /** * 类目ID */ - @Schema(description = "类目ID", example = "1") private Long categoryId; /** * 类目名称 */ - @Schema(description = "类目名称", example = "手机数码") private String categoryName; /** * 商品名称 */ - @Schema(description = "商品名称", example = "iPhone 15 Pro") private String name; /** * 商品编码 */ - @Schema(description = "商品编码", example = "IPHONE15PRO001") private String productCode; /** * 主图URL */ - @Schema(description = "主图URL", example = "https://example.com/product.jpg") private String mainImage; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建人ID */ - @Schema(description = "创建人ID", example = "1") private Long createBy; /** * 更新人ID */ - @Schema(description = "更新人ID", example = "1") private Long updateBy; /** * 商品 SKU 列表 */ - @Schema(description = "商品SKU列表") private List skus; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/controller/ShopController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/controller/ShopController.java index db39f8a3..9150dd90 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/controller/ShopController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/controller/ShopController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -24,7 +21,6 @@ import top.xyquan.ecomdmbbackend.utils.FileUploadUtils; /** * 店铺管理控制器 */ -@Tag(name = "电商-店铺管理", description = "店铺的增删改查接口") @RestController @RequestMapping("/api/ec/shop") public class ShopController { @@ -35,7 +31,6 @@ public class ShopController { this.shopService = shopService; } - @Operation(summary = "创建店铺", description = "创建新的店铺") @PostMapping("/create") @RequirePermission(value = "ec:shop:manage", description = "创建店铺", allowSuper = true) public ApiResponse createShop(@Valid @RequestBody CreateShopDTO createShopDTO) { @@ -43,25 +38,22 @@ public class ShopController { return ApiResponse.success("店铺创建成功", shopVO); } - @Operation(summary = "更新店铺", description = "更新现有店铺信息") @PutMapping("/update/{id}") @RequirePermission(value = "ec:shop:manage", description = "更新店铺", allowSuper = true) public ApiResponse updateShop(@Valid @RequestBody UpdateShopDTO updateShopDTO, - @Parameter(description = "店铺ID") @PathVariable Long id) { +@PathVariable Long id) { ShopVO shopVO = shopService.updateShop(updateShopDTO, id); return ApiResponse.success("店铺更新成功", shopVO); } - @Operation(summary = "删除店铺", description = "删除指定店铺") @DeleteMapping("/delete/{id}") @RequirePermission(value = "ec:shop:manage", description = "删除店铺", allowSuper = true) public ApiResponse deleteShop( - @Parameter(description = "店铺ID") @PathVariable Long id) { +@PathVariable Long id) { shopService.deleteShop(id); return ApiResponse.success("店铺删除成功"); } - @Operation(summary = "分页获取店铺列表", description = "分页获取店铺列表;已绑定外部店时仅附带渠道店简要信息(id/名称/logo 等),详情请调渠道店铺详情接口") @PostMapping("/list") @RequirePermission(value = "ec:shop:read", description = "查询店铺列表", allowSuper = true) public ApiResponse> getShopPage( @@ -70,15 +62,13 @@ public class ShopController { return ApiResponse.success("获取店铺列表成功", result); } - @Operation(summary = "店铺详情", description = "根据内部店铺ID获取详情;按 platformCode 嵌套平台店铺简要信息,完整渠道店/授权请再调渠道店铺详情") @GetMapping("/detail/{id}") @RequirePermission(value = "ec:shop:read", description = "查询店铺详情", allowSuper = true) - public ApiResponse getShopDetail(@Parameter(description = "店铺ID") @PathVariable Long id) { + public ApiResponse getShopDetail(@PathVariable Long id) { ShopVO vo = shopService.getShopDetail(id); return ApiResponse.success("获取成功", vo); } - @Operation(summary = "上传店铺Logo", description = "上传店铺Logo图片,支持跨公司共享") @PostMapping("/upload-logo") @RequirePermission(value = "ec:shop:manage", description = "上传店铺Logo", allowSuper = true) public ApiResponse uploadLogo(@RequestParam("file") MultipartFile file) { @@ -91,7 +81,6 @@ public class ShopController { return ApiResponse.success("Logo上传成功", fileVO); } - @Operation(summary = "分页获取店铺商品信息", description = "通过中间表分页获取店铺商品信息,包含商品基本信息和规格列表") @PostMapping("/products/list") @RequirePermission(value = "ec:shop:read", description = "查询店铺商品列表", allowSuper = true) public ApiResponse> getShopProductPage( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/CreateShopDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/CreateShopDTO.java index d3b7537c..18eae2f6 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/CreateShopDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/CreateShopDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,31 +7,26 @@ import lombok.Data; * 创建店铺DTO */ @Data -@Schema(description = "创建店铺DTO") public class CreateShopDTO { /** * 店铺名称 */ - @Schema(description = "店铺名称", example = "旗舰店", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "店铺名称不能为空") private String name; /** * logo图片ID */ - @Schema(description = "logo图片ID") private Long logoImageId; /** * 平台代码 */ - @Schema(description = "平台代码", example = "pdd") private String platformCode; /** * 外部/平台店铺表主键 ID(如 channel_pdd_shop.id) */ - @Schema(description = "外部/平台店铺表主键ID(如 channel_pdd_shop.id)", example = "1") private Long externalShopId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopFilterDTO.java index efd9aea1..169fd6b1 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopFilterDTO.java @@ -1,24 +1,20 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 店铺分页查询过滤DTO */ @Data -@Schema(description = "店铺分页查询过滤DTO") public class ShopFilterDTO { /** * 店铺名称(模糊查询) */ - @Schema(description = "店铺名称(模糊查询)", example = "旗舰") private String name; /** * 平台代码 */ - @Schema(description = "平台代码", example = "pdd") private String platformCode; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopProductFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopProductFilterDTO.java index 2fe3ae57..89fc860b 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopProductFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopProductFilterDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDate; @@ -9,37 +8,31 @@ import java.time.LocalDate; * 店铺商品分页查询过滤DTO */ @Data -@Schema(description = "店铺商品分页查询过滤DTO") public class ShopProductFilterDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) private Long shopId; /** * 商品名称(模糊查询) */ - @Schema(description = "商品名称(模糊查询)", example = "iPhone") private String productName; /** * 商品编码(模糊查询) */ - @Schema(description = "商品编码(模糊查询)", example = "IPHONE") private String productCode; /** * 开始日期(不传默认为当月1号) */ - @Schema(description = "开始日期(不传默认为当月1号)", example = "2024-01-01") private LocalDate startDate; /** * 结束日期(不传默认为今天) */ - @Schema(description = "结束日期(不传默认为今天)", example = "2024-01-31") private LocalDate endDate; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopProductPageFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopProductPageFilterDTO.java index 7f1a9d05..8c4a9f94 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopProductPageFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/ShopProductPageFilterDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -8,13 +7,11 @@ import lombok.Data; * 店铺商品分页查询过滤DTO */ @Data -@Schema(description = "店铺商品分页查询过滤DTO") public class ShopProductPageFilterDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/UpdateShopDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/UpdateShopDTO.java index a7cf12a4..5f40bbf2 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/UpdateShopDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/dto/UpdateShopDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,31 +7,26 @@ import lombok.Data; * 更新店铺DTO */ @Data -@Schema(description = "更新店铺DTO") public class UpdateShopDTO { /** * 店铺名称 */ - @Schema(description = "店铺名称", example = "旗舰店", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "店铺名称不能为空") private String name; /** * logo图片ID */ - @Schema(description = "logo图片ID") private Long logoImageId; /** * 平台代码 */ - @Schema(description = "平台代码", example = "pdd") private String platformCode; /** * 外部/平台店铺表主键 ID(如 channel_pdd_shop.id) */ - @Schema(description = "外部/平台店铺表主键ID(如 channel_pdd_shop.id)", example = "1") private Long externalShopId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopDetailVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopDetailVO.java index 5b8316ef..01acc822 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopDetailVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopDetailVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; @@ -9,19 +8,16 @@ import java.util.List; * 店铺详情VO */ @Data -@Schema(description = "店铺详情VO") public class ShopDetailVO { /** * 店铺统计信息 */ - @Schema(description = "店铺统计信息") private ShopStatisticsVO statistics; /** * 商品列表 */ - @Schema(description = "商品列表") private List products; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopProductDetailVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopProductDetailVO.java index 9766ec4f..73441d15 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopProductDetailVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopProductDetailVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -10,73 +9,61 @@ import java.time.LocalDateTime; * 店铺商品详细信息VO */ @Data -@Schema(description = "店铺商品详细信息VO") public class ShopProductDetailVO { /** * 商品ID */ - @Schema(description = "商品ID", example = "1") private Long productId; /** * 商品名称 */ - @Schema(description = "商品名称", example = "iPhone 15 Pro") private String productName; /** * 商品编码 */ - @Schema(description = "商品编码", example = "IPHONE15PRO001") private String productCode; /** * 主图URL */ - @Schema(description = "主图URL", example = "https://example.com/product.jpg") private String mainImage; /** * 关联ID */ - @Schema(description = "关联ID", example = "1") private Long relationId; /** * 排序 */ - @Schema(description = "排序", example = "0") private Integer sortOrder; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 销售额(商家实收金额总和) */ - @Schema(description = "销售额", example = "10000.00") private BigDecimal salesAmount; /** * 订单数 */ - @Schema(description = "订单数", example = "10") private Long orderCount; /** * 客单价(销售额/订单数) */ - @Schema(description = "客单价", example = "1000.00") private BigDecimal averageOrderValue; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopStatisticsVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopStatisticsVO.java index 64399cea..4ad1e469 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopStatisticsVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopStatisticsVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -9,49 +8,41 @@ import java.math.BigDecimal; * 店铺统计VO */ @Data -@Schema(description = "店铺统计VO") public class ShopStatisticsVO { /** * 销售额(商家实收金额总和) */ - @Schema(description = "销售额", example = "100000.00") private BigDecimal salesAmount; /** * 订单数 */ - @Schema(description = "订单数", example = "100") private Long orderCount; /** * 客单价(销售额/订单数) */ - @Schema(description = "客单价", example = "1000.00") private BigDecimal averageOrderValue; /** * 成本(成本价*数量总和) */ - @Schema(description = "成本", example = "60000.00") private BigDecimal costAmount; /** * 退款金额(已退款订单的实收金额总和) */ - @Schema(description = "退款金额", example = "5000.00") private BigDecimal refundAmount; /** * 推广费 */ - @Schema(description = "推广费", example = "10000.00") private BigDecimal promotionFee; /** * 费比(推广费/销售额) */ - @Schema(description = "费比", example = "0.10") private BigDecimal feeRatio; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopVO.java index b4251b59..caad3534 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/model/vo/ShopVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import top.xyquan.ecomdmbbackend.modules.channel.pdd.shop.model.vo.PddShopVO; @@ -10,78 +9,65 @@ import java.time.LocalDateTime; * 店铺VO */ @Data -@Schema(description = "店铺VO") public class ShopVO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1") private Long id; /** * 所属公司ID */ - @Schema(description = "所属公司ID", example = "1") private Long companyId; /** * 店铺名称 */ - @Schema(description = "店铺名称", example = "旗舰店") private String name; /** * logo URL(有 logo_image_id 时为系统文件访问地址,否则为 logo_url 外链) */ - @Schema(description = "logo URL(有系统文件 id 时覆盖外链)", example = "https://example.com/logo.jpg") private String logo; /** * 平台代码 */ - @Schema(description = "平台代码", example = "pdd") private String platformCode; /** * 外部/平台店铺表主键 ID(如 channel_pdd_shop.id) */ - @Schema(description = "外部/平台店铺表主键ID(如 channel_pdd_shop.id)", example = "1") private Long externalShopId; /** * 关联的拼多多外部店铺(仅 platform=pdd 且已绑定 externalShopId 时有值) */ - @Schema(description = "关联的拼多多外部店铺(已授权绑定时返回)") private PddShopVO pddShop; /** * 平台名称 */ - @Schema(description = "平台名称", example = "淘宝") private String platformName; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建人ID */ - @Schema(description = "创建人ID", example = "1") private Long createBy; /** * 更新人ID */ - @Schema(description = "更新人ID", example = "1") private Long updateBy; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/controller/ShopMonthlyTargetController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/controller/ShopMonthlyTargetController.java index e9a3d6da..b5e0287c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/controller/ShopMonthlyTargetController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/controller/ShopMonthlyTargetController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.monthlytarget.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -18,7 +15,6 @@ import top.xyquan.ecomdmbbackend.modules.ec.shop.monthlytarget.service.ShopMonth /** * 店铺月销量目标管理控制器 */ -@Tag(name = "电商-店铺月销量目标管理", description = "店铺月销量目标的增删改查接口") @RestController @RequestMapping("/api/ec/shop-monthly-target") public class ShopMonthlyTargetController { @@ -29,7 +25,6 @@ public class ShopMonthlyTargetController { this.shopMonthlyTargetService = shopMonthlyTargetService; } - @Operation(summary = "创建店铺月销量目标", description = "创建新的店铺月销量目标") @PostMapping("/create") @RequirePermission(value = "ec:shop:manage", description = "创建店铺月销量目标", allowSuper = true) public ApiResponse createShopMonthlyTarget(@Valid @RequestBody CreateShopMonthlyTargetDTO createDTO) { @@ -37,25 +32,22 @@ public class ShopMonthlyTargetController { return ApiResponse.success("店铺月销量目标创建成功", vo); } - @Operation(summary = "更新店铺月销量目标", description = "更新现有店铺月销量目标信息") @PutMapping("/update/{id}") @RequirePermission(value = "ec:shop:manage", description = "更新店铺月销量目标", allowSuper = true) public ApiResponse updateShopMonthlyTarget(@Valid @RequestBody UpdateShopMonthlyTargetDTO updateDTO, - @Parameter(description = "目标ID") @PathVariable Long id) { +@PathVariable Long id) { ShopMonthlyTargetVO vo = shopMonthlyTargetService.updateShopMonthlyTarget(updateDTO, id); return ApiResponse.success("店铺月销量目标更新成功", vo); } - @Operation(summary = "删除店铺月销量目标", description = "删除指定店铺月销量目标") @DeleteMapping("/delete/{id}") @RequirePermission(value = "ec:shop:manage", description = "删除店铺月销量目标", allowSuper = true) public ApiResponse deleteShopMonthlyTarget( - @Parameter(description = "目标ID") @PathVariable Long id) { +@PathVariable Long id) { shopMonthlyTargetService.deleteShopMonthlyTarget(id); return ApiResponse.success("店铺月销量目标删除成功"); } - @Operation(summary = "分页获取店铺月销量目标列表", description = "分页获取店铺月销量目标列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "ec:shop:read", description = "查询店铺月销量目标列表", allowSuper = true) public ApiResponse> getShopMonthlyTargetPage( @@ -64,11 +56,10 @@ public class ShopMonthlyTargetController { return ApiResponse.success("获取店铺月销量目标列表成功", result); } - @Operation(summary = "获取店铺月销量目标详情", description = "根据ID获取店铺月销量目标详情") @GetMapping("/detail/{id}") @RequirePermission(value = "ec:shop:read", description = "查询店铺月销量目标详情", allowSuper = true) public ApiResponse getShopMonthlyTargetById( - @Parameter(description = "目标ID") @PathVariable Long id) { +@PathVariable Long id) { ShopMonthlyTargetVO vo = shopMonthlyTargetService.getShopMonthlyTargetById(id); return ApiResponse.success("获取店铺月销量目标详情成功", vo); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/CreateShopMonthlyTargetDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/CreateShopMonthlyTargetDTO.java index 8401098a..af918279 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/CreateShopMonthlyTargetDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/CreateShopMonthlyTargetDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.monthlytarget.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.PositiveOrZero; import lombok.Data; @@ -12,27 +11,23 @@ import java.time.LocalDate; * 创建店铺月销量目标DTO */ @Data -@Schema(description = "创建店铺月销量目标DTO") public class CreateShopMonthlyTargetDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "店铺ID不能为空") private Long shopId; /** * 目标月份(格式:YYYY-MM-01) */ - @Schema(description = "目标月份", example = "2024-01-01", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "目标月份不能为空") private LocalDate targetMonth; /** * 目标销售额 */ - @Schema(description = "目标销售额", example = "100000.00", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "目标销售额不能为空") @PositiveOrZero(message = "目标销售额必须大于等于0") private BigDecimal targetAmount; @@ -40,7 +35,6 @@ public class CreateShopMonthlyTargetDTO { /** * 目标订单数 */ - @Schema(description = "目标订单数", example = "1000", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "目标订单数不能为空") @PositiveOrZero(message = "目标订单数必须大于等于0") private Integer targetOrderCount; @@ -48,7 +42,6 @@ public class CreateShopMonthlyTargetDTO { /** * 备注 */ - @Schema(description = "备注", example = "1月目标") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/ShopMonthlyTargetFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/ShopMonthlyTargetFilterDTO.java index a59246ac..f2692e61 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/ShopMonthlyTargetFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/ShopMonthlyTargetFilterDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.monthlytarget.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDate; @@ -9,25 +8,21 @@ import java.time.LocalDate; * 店铺月销量目标分页查询过滤DTO */ @Data -@Schema(description = "店铺月销量目标分页查询过滤DTO") public class ShopMonthlyTargetFilterDTO { /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1") private Long shopId; /** * 目标月份范围-开始月份 */ - @Schema(description = "目标月份范围-开始月份", example = "2024-01-01") private LocalDate startTargetMonth; /** * 目标月份范围-结束月份 */ - @Schema(description = "目标月份范围-结束月份", example = "2024-12-01") private LocalDate endTargetMonth; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/UpdateShopMonthlyTargetDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/UpdateShopMonthlyTargetDTO.java index 7c6c3d34..039f933c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/UpdateShopMonthlyTargetDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/dto/UpdateShopMonthlyTargetDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.monthlytarget.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.PositiveOrZero; import lombok.Data; @@ -12,20 +11,17 @@ import java.time.LocalDate; * 更新店铺月销量目标DTO */ @Data -@Schema(description = "更新店铺月销量目标DTO") public class UpdateShopMonthlyTargetDTO { /** * 目标月份(格式:YYYY-MM-01) */ - @Schema(description = "目标月份", example = "2024-01-01", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "目标月份不能为空") private LocalDate targetMonth; /** * 目标销售额 */ - @Schema(description = "目标销售额", example = "100000.00", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "目标销售额不能为空") @PositiveOrZero(message = "目标销售额必须大于等于0") private BigDecimal targetAmount; @@ -33,7 +29,6 @@ public class UpdateShopMonthlyTargetDTO { /** * 目标订单数 */ - @Schema(description = "目标订单数", example = "1000", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "目标订单数不能为空") @PositiveOrZero(message = "目标订单数必须大于等于0") private Integer targetOrderCount; @@ -41,7 +36,6 @@ public class UpdateShopMonthlyTargetDTO { /** * 备注 */ - @Schema(description = "备注", example = "1月目标") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/vo/ShopMonthlyTargetVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/vo/ShopMonthlyTargetVO.java index 79713fc2..73faf212 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/vo/ShopMonthlyTargetVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ec/shop/monthlytarget/model/vo/ShopMonthlyTargetVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.ec.shop.monthlytarget.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @@ -11,79 +10,66 @@ import java.time.LocalDateTime; * 店铺月销量目标VO */ @Data -@Schema(description = "店铺月销量目标VO") public class ShopMonthlyTargetVO { /** * 目标ID */ - @Schema(description = "目标ID", example = "1") private Long id; /** * 公司ID */ - @Schema(description = "公司ID", example = "1") private Long companyId; /** * 店铺ID */ - @Schema(description = "店铺ID", example = "1") private Long shopId; /** * 店铺名称 */ - @Schema(description = "店铺名称", example = "旗舰店") private String shopName; /** * 目标月份 */ - @Schema(description = "目标月份", example = "2024-01-01") private LocalDate targetMonth; /** * 目标销售额 */ - @Schema(description = "目标销售额", example = "100000.00") private BigDecimal targetAmount; /** * 目标订单数 */ - @Schema(description = "目标订单数", example = "1000") private Integer targetOrderCount; /** * 备注 */ - @Schema(description = "备注", example = "1月目标") private String remark; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建人ID */ - @Schema(description = "创建人ID", example = "1") private Long createBy; /** * 更新人ID */ - @Schema(description = "更新人ID", example = "1") private Long updateBy; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/notify/sse/controller/RealtimeSseController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/notify/sse/controller/RealtimeSseController.java index f34142fe..c136254c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/notify/sse/controller/RealtimeSseController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/notify/sse/controller/RealtimeSseController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.notify.sse.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -14,7 +12,6 @@ import top.xyquan.ecomdmbbackend.utils.CurrentUserContext; /** * 用户级实时通道:登录即可连接,业务事件按类型分发。 */ -@Tag(name = "实时通知SSE", description = "用户级实时推送(导入/同步等)") @RestController @RequestMapping("/api/notify/sse") public class RealtimeSseController { @@ -28,7 +25,6 @@ public class RealtimeSseController { this.currentUserContext = currentUserContext; } - @Operation(summary = "建立SSE连接", description = "登录后建立用户级 SSE;支持多设备/多标签页(deviceId)") @GetMapping(value = "/connect", produces = MediaType.TEXT_EVENT_STREAM_VALUE) public SseEmitter connect( @RequestParam(value = "deviceId", required = false) String deviceId) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenExtensionFeatureController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenExtensionFeatureController.java index 7f87818d..f95ac9ec 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenExtensionFeatureController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenExtensionFeatureController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.open.api.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -21,21 +19,18 @@ import top.xyquan.ecomdmbbackend.modules.open.api.service.ExtensionFeatureServic @RestController @RequestMapping("/api/open/v1/extension/features") @RequiredArgsConstructor -@Tag(name = "开放接口-浏览器扩展功能", description = "API Key 认证;清单为静态 JSON,脚本同目录按需下载") public class OpenExtensionFeatureController { private final ExtensionFeatureService extensionFeatureService; @GetMapping @RequireOpenScope(value = OpenApiScopeConstants.EXTENSION_FEATURE_READ, description = "查询浏览器扩展功能清单") - @Operation(summary = "获取功能清单", description = "读取 static/extension-features/manifest.json") public ApiResponse listFeatures() { return ApiResponse.success("获取扩展功能清单成功", extensionFeatureService.getManifest()); } @GetMapping("/{featureId}/script") @RequireOpenScope(value = OpenApiScopeConstants.EXTENSION_FEATURE_READ, description = "下载浏览器扩展功能脚本") - @Operation(summary = "下载功能脚本", description = "按清单 entry 读取同目录 JS,返回 content 文本") public ApiResponse getScript(@PathVariable String featureId) { return ApiResponse.success("获取扩展功能脚本成功", extensionFeatureService.getScript(featureId)); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenMetaController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenMetaController.java index 963fdfa7..d956da29 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenMetaController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenMetaController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.open.api.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -21,14 +19,12 @@ import java.util.List; @RestController @RequestMapping("/api/open/v1/ec") @RequiredArgsConstructor -@Tag(name = "开放接口-元数据", description = "API Key 认证,Agent 辅助元数据") public class OpenMetaController { private final ShopService shopService; @PostMapping("/shop/list") @RequireOpenScope(value = OpenApiScopeConstants.META_READ, description = "查询店铺列表") - @Operation(summary = "分页查询店铺列表", description = "镜像 POST /ec/shop/list") public ApiResponse> getShopPage( @Valid @RequestBody PageQueryDTO pageQueryDTO) { PageResultVO result = shopService.getShopPage(pageQueryDTO); @@ -37,7 +33,6 @@ public class OpenMetaController { @GetMapping("/order-status/list") @RequireOpenScope(value = OpenApiScopeConstants.META_READ, description = "查询订单状态列表") - @Operation(summary = "获取订单状态列表", description = "镜像 GET /ec/order-status/list") public ApiResponse> getAllOrderStatuses() { return ApiResponse.success("获取订单状态列表成功", OrderStatusMetaSupport.allMeta()); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenOrderController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenOrderController.java index f8d31b33..06973ce5 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenOrderController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenOrderController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.open.api.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -20,14 +18,12 @@ import java.util.List; @RestController @RequestMapping("/api/open/v1/ec/order") @RequiredArgsConstructor -@Tag(name = "开放接口-订单", description = "API Key 认证,镜像 /ec/order") public class OpenOrderController { private final OrderService orderService; @GetMapping("/fields") @RequireOpenScope(value = OpenApiScopeConstants.ORDER_READ, description = "查询订单字段") - @Operation(summary = "获取订单导入字段定义") public ApiResponse> getOrderFieldDefs() { return ApiResponse.success("获取订单字段成功", OrderFieldConstants.FIELDS); } @@ -35,7 +31,6 @@ public class OpenOrderController { @PostMapping("/batch-import") @LicenseRequired @RequireOpenScope(value = OpenApiScopeConstants.ORDER_IMPORT, description = "批量导入订单") - @Operation(summary = "批量导入订单") public ApiResponse batchImportOrders(@Valid @RequestBody BatchImportOrderDTO dto) { BatchImportResultVO result = orderService.batchImportOrders(dto); return ApiResponse.success("批量导入订单成功", result); diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenPddGoodsAdFeeController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenPddGoodsAdFeeController.java index de9e40ac..b7d59b36 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenPddGoodsAdFeeController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenPddGoodsAdFeeController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.open.api.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; @@ -18,16 +16,12 @@ import top.xyquan.ecomdmbbackend.modules.open.api.constants.OpenApiScopeConstant @RestController @RequestMapping("/api/open/v1/channel/pdd/goods/adfee") @RequiredArgsConstructor -@Tag(name = "开放接口-拼多多商品广告费", description = "API Key 认证,批量写入按日广告费") public class OpenPddGoodsAdFeeController { private final PddGoodsAdFeeService pddGoodsAdFeeService; @PostMapping("/batch-import") @RequireOpenScope(value = OpenApiScopeConstants.PDD_GOODS_AD_FEE_IMPORT, description = "批量导入拼多多商品广告费") - @Operation(summary = "批量导入拼多多商品广告费", - description = "每条需 channelShopId、feeDate、goodsId、feeAmount(须大于0);" - + "同店同商品同日金额无变化则跳过更新;新增/变更后异步转为内部广告费") public ApiResponse batchImport( @Valid @RequestBody BatchImportPddGoodsAdFeeDTO dto) { return ApiResponse.success("批量导入完成", pddGoodsAdFeeService.batchImport(dto)); diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenPddShopController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenPddShopController.java index 1d2949c5..498664ef 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenPddShopController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/controller/OpenPddShopController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.open.api.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; @@ -20,14 +18,12 @@ import top.xyquan.ecomdmbbackend.modules.open.api.constants.OpenApiScopeConstant @RestController @RequestMapping("/api/open/v1/channel/pdd/shop") @RequiredArgsConstructor -@Tag(name = "开放接口-拼多多渠道店铺", description = "API Key 认证,查询本公司渠道店铺") public class OpenPddShopController { private final PddShopService pddShopService; @PostMapping("/list") @RequireOpenScope(value = OpenApiScopeConstants.PDD_SHOP_READ, description = "查询拼多多渠道店铺列表") - @Operation(summary = "分页查询拼多多渠道店铺", description = "镜像 POST /channel/pdd/shop/list,返回 id(channel_shop_id)、mallId、mallName 等") public ApiResponse> getPddShopPage( @Valid @RequestBody PageQueryDTO pageQueryDTO) { PageResultVO result = pddShopService.getPddShopPage(pageQueryDTO); diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureItemVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureItemVO.java index 7e39a82c..5776a5a3 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureItemVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureItemVO.java @@ -1,13 +1,11 @@ package top.xyquan.ecomdmbbackend.modules.open.api.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.ArrayList; import java.util.List; @Data -@Schema(description = "浏览器扩展单个功能项") public class ExtensionFeatureItemVO { private String id; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureManifestVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureManifestVO.java index 394888cd..6ee526a1 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureManifestVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureManifestVO.java @@ -1,13 +1,11 @@ package top.xyquan.ecomdmbbackend.modules.open.api.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.ArrayList; import java.util.List; @Data -@Schema(description = "浏览器扩展功能清单(对应静态目录 manifest.json)") public class ExtensionFeatureManifestVO { private Integer schemaVersion; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureScriptVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureScriptVO.java index 3024a37d..1c42704e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureScriptVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/api/model/vo/ExtensionFeatureScriptVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.open.api.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -8,7 +7,6 @@ import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor -@Schema(description = "浏览器扩展功能脚本内容") public class ExtensionFeatureScriptVO { private String featureId; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/controller/OpenApiKeyController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/controller/OpenApiKeyController.java index d15b65c7..62791dca 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/controller/OpenApiKeyController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/controller/OpenApiKeyController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.open.key.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -20,7 +17,6 @@ import java.util.List; /** * API Key 管理(JWT 保护) */ -@Tag(name = "开放接口-API Key 管理", description = "公司拥有者管理本公司 API Key") @RestController @RequestMapping("/api/sys/open-api-key") @RequiredArgsConstructor @@ -28,7 +24,6 @@ public class OpenApiKeyController { private final OpenApiKeyService openApiKeyService; - @Operation(summary = "创建 API Key", description = "明文 Key 仅创建时返回一次") @PostMapping("/create") @RequirePermission(value = "open:api-key:manage", description = "创建 API Key", allowSuper = true) public ApiResponse createKey(@Valid @RequestBody CreateOpenApiKeyDTO dto) { @@ -36,7 +31,6 @@ public class OpenApiKeyController { return ApiResponse.success("API Key 创建成功", result); } - @Operation(summary = "查询 API Key 列表") @GetMapping("/list") @RequirePermission(value = "open:api-key:manage", description = "查询 API Key 列表", allowSuper = true) public ApiResponse> listKeys(OpenApiKeyFilterDTO filter) { @@ -44,33 +38,29 @@ public class OpenApiKeyController { return ApiResponse.success("获取 API Key 列表成功", list); } - @Operation(summary = "获取当前公司可绑定的开放权限") @GetMapping("/available-permissions") @RequirePermission(value = "open:api-key:manage", description = "查询可绑定开放权限", allowSuper = true) public ApiResponse> getAvailablePermissions() { return ApiResponse.success("获取可绑定权限成功", openApiKeyService.getAvailablePermissions()); } - @Operation(summary = "停用 API Key") @PutMapping("/{id}/disable") @RequirePermission(value = "open:api-key:manage", description = "停用 API Key", allowSuper = true) - public ApiResponse disableKey(@Parameter(description = "Key ID") @PathVariable Long id) { + public ApiResponse disableKey(@PathVariable Long id) { openApiKeyService.disableKey(id); return ApiResponse.success("API Key 已停用"); } - @Operation(summary = "启用 API Key") @PutMapping("/{id}/enable") @RequirePermission(value = "open:api-key:manage", description = "启用 API Key", allowSuper = true) - public ApiResponse enableKey(@Parameter(description = "Key ID") @PathVariable Long id) { + public ApiResponse enableKey(@PathVariable Long id) { openApiKeyService.enableKey(id); return ApiResponse.success("API Key 已启用"); } - @Operation(summary = "删除 API Key") @DeleteMapping("/{id}") @RequirePermission(value = "open:api-key:manage", description = "删除 API Key", allowSuper = true) - public ApiResponse deleteKey(@Parameter(description = "Key ID") @PathVariable Long id) { + public ApiResponse deleteKey(@PathVariable Long id) { openApiKeyService.deleteKey(id); return ApiResponse.success("API Key 已删除"); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/dto/CreateOpenApiKeyDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/dto/CreateOpenApiKeyDTO.java index 1631b4d2..69aebed5 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/dto/CreateOpenApiKeyDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/dto/CreateOpenApiKeyDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.open.key.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Size; @@ -10,24 +9,18 @@ import java.time.LocalDateTime; import java.util.List; @Data -@Schema(description = "创建 API Key 请求") public class CreateOpenApiKeyDTO { @NotBlank(message = "Key名称不能为空") @Size(max = 100, message = "Key名称长度不能超过100") - @Schema(description = "Key名称/用途", example = "Agent-订单导入") private String name; @NotEmpty(message = "权限不能为空") - @Schema(description = "公司权限关联ID列表(org_company_permission.id)") private List companyPermissionIds; - @Schema(description = "过期时间,空表示永不过期") private LocalDateTime expireAt; - @Schema(description = "IP白名单,空表示不限制") private List ipWhitelist; - @Schema(description = "每分钟请求上限,默认60") private Integer rateLimit = 60; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/dto/OpenApiKeyFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/dto/OpenApiKeyFilterDTO.java index 81d16ee5..38451d97 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/dto/OpenApiKeyFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/dto/OpenApiKeyFilterDTO.java @@ -1,15 +1,11 @@ package top.xyquan.ecomdmbbackend.modules.open.key.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data -@Schema(description = "API Key 列表过滤") public class OpenApiKeyFilterDTO { - @Schema(description = "Key名称(模糊)") private String name; - @Schema(description = "状态:0=停用 1=正常") private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/CreateOpenApiKeyResultVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/CreateOpenApiKeyResultVO.java index b79771f6..1e21979a 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/CreateOpenApiKeyResultVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/CreateOpenApiKeyResultVO.java @@ -1,14 +1,11 @@ package top.xyquan.ecomdmbbackend.modules.open.key.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = true) -@Schema(description = "创建 API Key 结果(明文 Key 仅返回一次)") public class CreateOpenApiKeyResultVO extends OpenApiKeyVO { - @Schema(description = "明文 API Key,仅创建时返回一次") private String plainKey; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/OpenApiAvailablePermissionVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/OpenApiAvailablePermissionVO.java index 545bae54..d6b38671 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/OpenApiAvailablePermissionVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/OpenApiAvailablePermissionVO.java @@ -1,21 +1,15 @@ package top.xyquan.ecomdmbbackend.modules.open.key.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data -@Schema(description = "Key 可绑定的公司开放权限") public class OpenApiAvailablePermissionVO { - @Schema(description = "公司权限关联ID(org_company_permission.id)") private Long companyPermissionId; - @Schema(description = "权限ID") private Long permissionId; - @Schema(description = "权限码") private String code; - @Schema(description = "权限名称") private String name; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/OpenApiKeyVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/OpenApiKeyVO.java index 39d16e68..b27b6320 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/OpenApiKeyVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/open/key/model/vo/OpenApiKeyVO.java @@ -1,13 +1,11 @@ package top.xyquan.ecomdmbbackend.modules.open.key.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; import java.util.List; @Data -@Schema(description = "API Key 信息") public class OpenApiKeyVO { private Long id; diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/controller/AccountController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/controller/AccountController.java index 0edde379..48a382be 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/controller/AccountController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/controller/AccountController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.account.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -20,7 +17,6 @@ import top.xyquan.ecomdmbbackend.modules.org.company.account.service.AccountServ *

* 供公司拥有者管理本公司成员账户;需 org:company:manage 权限,超管可访问全部接口。 */ -@Tag(name = "组织-账户管理", description = "公司拥有者管理本公司账户") @RestController @RequestMapping("/api/company/account") public class AccountController { @@ -32,7 +28,6 @@ public class AccountController { } /** 创建账户:手机号已注册则拉入公司,未注册则新建用户(密码必填) */ - @Operation(summary = "创建账户(拥有者)", description = "公司拥有者创建本公司账户;手机号已存在时将用户拉入本公司,不存在则新建用户") @PostMapping("/create") @RequirePermission(value = "org:company:manage", description = "创建账户", allowSuper = true) public ApiResponse createAccountForCompany(@Valid @RequestBody CreateAccountDTO createAccountDTO) { @@ -41,7 +36,6 @@ public class AccountController { } /** 分页查询当前公司成员对应的账户列表 */ - @Operation(summary = "分页查询账户(拥有者)", description = "公司拥有者分页查询本公司账户") @PostMapping("/list") @RequirePermission(value = "org:company:manage", description = "查询账户列表", allowSuper = true) public ApiResponse> getAccountPageForCompany(@Valid @RequestBody PageQueryDTO pageQuery) { @@ -50,31 +44,28 @@ public class AccountController { } /** 更新账户基本信息及职位、部门关联 */ - @Operation(summary = "更新账户信息", description = "公司拥有者更新本公司账户信息") @PutMapping("/update/{accountId}") @RequirePermission(value = "org:company:manage", description = "更新账户", allowSuper = true) public ApiResponse updateAccount( - @Parameter(description = "账户ID", example = "1") @PathVariable Long accountId, +@PathVariable Long accountId, @Valid @RequestBody UpdateAccountDTO updateAccountDTO) { CompanyAccountVO accountVO = accountService.updateAccountForCompany(updateAccountDTO, accountId); return ApiResponse.success("账户更新成功", accountVO); } /** 逻辑删除:停用 sys_user 并移除公司/部门成员关系 */ - @Operation(summary = "删除账户", description = "逻辑删除账户") @DeleteMapping("/delete/{accountId}") @RequirePermission(value = "org:company:manage", description = "删除账户", allowSuper = true) public ApiResponse deleteAccount( - @Parameter(description = "账户ID", example = "1") @PathVariable Long accountId) { +@PathVariable Long accountId) { accountService.deleteAccount(accountId); return ApiResponse.success("账户删除成功"); } - @Operation(summary = "获取账户详情", description = "获取账户详细信息") @GetMapping("/detail/{accountId}") @RequirePermission(value = "org:company:manage", description = "获取账户详情", allowSuper = true) public ApiResponse getAccountDetail( - @Parameter(description = "账户ID", example = "1") @PathVariable Long accountId) { +@PathVariable Long accountId) { CompanyAccountVO accountVO = accountService.getAccountDetail(accountId); return ApiResponse.success("获取账户详情成功", accountVO); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/controller/SuperAccountController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/controller/SuperAccountController.java index 89f8f23f..8f6ceb47 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/controller/SuperAccountController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/controller/SuperAccountController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.account.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -18,7 +15,6 @@ import top.xyquan.ecomdmbbackend.modules.org.company.account.service.SuperAccoun /** * 超级管理员账户管理控制器 */ -@Tag(name = "超级管理员-账户管理", description = "超级管理员账户管理相关接口") @RestController @RequestMapping("/api/super/account") public class SuperAccountController { @@ -29,7 +25,6 @@ public class SuperAccountController { this.superAccountService = superAccountService; } - @Operation(summary = "创建账户", description = "超级管理员创建账户,可指定公司") @PostMapping("/create") @RequirePermission(value = "org:company:manage", description = "创建账户", allowSuper = true) public ApiResponse createAccount(@Valid @RequestBody SuperCreateAccountDTO superCreateAccountDTO) { @@ -37,7 +32,6 @@ public class SuperAccountController { return ApiResponse.success("账户创建成功", accountVO); } - @Operation(summary = "分页查询账户", description = "超级管理员分页查询所有账户") @PostMapping("/list") @RequirePermission(value = "org:company:manage", description = "查询账户列表", allowSuper = true) public ApiResponse> getAccountPage(@Valid @RequestBody PageQueryDTO pageQuery) { @@ -45,30 +39,27 @@ public class SuperAccountController { return ApiResponse.success("获取账户列表成功", pageResult); } - @Operation(summary = "更新账户信息", description = "超级管理员更新账户信息") @PutMapping("/update/{accountId}") @RequirePermission(value = "org:company:manage", description = "更新账户", allowSuper = true) public ApiResponse updateAccount( - @Parameter(description = "账户ID", example = "1") @PathVariable Long accountId, +@PathVariable Long accountId, @Valid @RequestBody SuperUpdateAccountDTO superUpdateAccountDTO) { CompanyAccountVO accountVO = superAccountService.updateAccount(superUpdateAccountDTO, accountId); return ApiResponse.success("账户更新成功", accountVO); } - @Operation(summary = "删除账户", description = "超级管理员逻辑删除账户") @DeleteMapping("/delete/{accountId}") @RequirePermission(value = "org:company:manage", description = "删除账户", allowSuper = true) public ApiResponse deleteAccount( - @Parameter(description = "账户ID", example = "1") @PathVariable Long accountId) { +@PathVariable Long accountId) { superAccountService.deleteAccount(accountId); return ApiResponse.success("账户删除成功"); } - @Operation(summary = "获取账户详情", description = "超级管理员获取账户详细信息") @GetMapping("/detail/{accountId}") @RequirePermission(value = "org:company:manage", description = "查询账户详情", allowSuper = true) public ApiResponse getAccountDetail( - @Parameter(description = "账户ID", example = "1") @PathVariable Long accountId) { +@PathVariable Long accountId) { CompanyAccountVO accountVO = superAccountService.getAccountDetail(accountId); return ApiResponse.success("获取账户详情成功", accountVO); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/AccountFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/AccountFilterDTO.java index a2006437..adedd14f 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/AccountFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/AccountFilterDTO.java @@ -1,39 +1,28 @@ package top.xyquan.ecomdmbbackend.modules.org.company.account.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 账户查询过滤DTO */ @Data -@Schema(description = "账户查询过滤条件") public class AccountFilterDTO { - @Schema(description = "登录账号", example = "admin") private String loginCode; - @Schema(description = "用户姓名", example = "张三") private String realName; - @Schema(description = "手机号码", example = "13800138000") private String phone; - @Schema(description = "公司ID", example = "1") private Long companyId; - @Schema(description = "部门ID", example = "1") private Long departmentId; - @Schema(description = "岗位ID", example = "1") private Long positionId; - @Schema(description = "用户ID列表", example = "[1,2,3]") private java.util.List userIds; - @Schema(description = "是否超级管理员", example = "0") private Integer isSuper; - @Schema(description = "状态(0-正常 1-删除 2-停用 3-冻结)", example = "0") private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/CreateAccountDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/CreateAccountDTO.java index ea94b00c..5ede1158 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/CreateAccountDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/CreateAccountDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.account.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Size; @@ -12,7 +11,6 @@ import lombok.Data; * 由公司拥有者调用;手机号决定走「拉入已有用户」还是「新建用户」分支。 */ @Data -@Schema(description = "创建账户请求") public class CreateAccountDTO { /** @@ -20,33 +18,26 @@ public class CreateAccountDTO { * 仅手机号未注册时必填;已注册用户加入公司时可留空 */ @Size(min = 6, max = 20, message = "密码长度为6-20个字符") - @Schema(description = "登录密码(手机号未注册时必填)", example = "123456") private String password; /** 手机号,同时作为新用户的登录账号(login_code) */ @NotBlank(message = "手机号不能为空") - @Schema(description = "手机号码", example = "13800138000") private String phone; @NotBlank(message = "用户姓名不能为空") - @Schema(description = "用户姓名", example = "张三") private String realName; /** * 加入公司后的成员角色,默认 member * owner=公司拥有者,member=普通成员 */ - @Schema(description = "公司成员角色: owner=公司拥有者, member=成员", example = "member") @Pattern(regexp = "^(owner|member)$", message = "公司成员角色必须是 owner 或 member") private String companyRole = "member"; - @Schema(description = "部门ID", example = "1") private Long departmentId; - @Schema(description = "岗位ID", example = "1") private Long positionId; - @Schema(description = "备注信息", example = "新员工账户") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/SuperCreateAccountDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/SuperCreateAccountDTO.java index a70b951b..b68335c7 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/SuperCreateAccountDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/SuperCreateAccountDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.account.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; @@ -11,46 +10,35 @@ import lombok.Data; * 超级管理员创建账户DTO */ @Data -@Schema(description = "超级管理员创建账户请求") public class SuperCreateAccountDTO { @NotBlank(message = "登录账号不能为空") @Size(min = 3, max = 20, message = "登录账号长度必须在3-20个字符之间") @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "登录账号只能包含字母、数字和下划线") - @Schema(description = "登录账号", example = "admin") private String loginCode; @NotBlank(message = "密码不能为空") @Size(min = 8, max = 20, message = "密码长度必须在8-20个字符之间") - @Schema(description = "密码", example = "12345678") private String password; @NotBlank(message = "用户姓名不能为空") @Size(max = 50, message = "用户姓名长度不能超过50个字符") - @Schema(description = "用户姓名", example = "张三") private String realName; @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码格式不正确") - @Schema(description = "手机号码", example = "13800138000") private String phone; @NotNull(message = "公司ID不能为空") - @Schema(description = "公司ID", example = "1") private Long companyId; - @Schema(description = "部门ID", example = "1") private Long departmentId; - @Schema(description = "岗位ID", example = "1") private Long positionId; @NotNull(message = "是否超管不能为空") - @Schema(description = "是否超级管理员 (0-否 1-是)", example = "0", allowableValues = {"0", "1"}) private Integer isSuper; - @Schema(description = "头像图片ID", example = "1") private Long avatarImageId; - @Schema(description = "备注", example = "备注信息") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/SuperUpdateAccountDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/SuperUpdateAccountDTO.java index 714f2969..01ea286d 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/SuperUpdateAccountDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/SuperUpdateAccountDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.account.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Size; import lombok.Data; @@ -9,40 +8,29 @@ import lombok.Data; * 超级管理员更新账户DTO */ @Data -@Schema(description = "超级管理员更新账户请求") public class SuperUpdateAccountDTO { @Size(min = 3, max = 20, message = "登录账号长度必须在3-20个字符之间") @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "登录账号只能包含字母、数字和下划线") - @Schema(description = "登录账号", example = "admin") private String loginCode; @Size(max = 50, message = "用户姓名长度不能超过50个字符") - @Schema(description = "用户姓名", example = "张三") private String realName; @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码格式不正确") - @Schema(description = "手机号码", example = "13800138000") private String phone; - @Schema(description = "公司ID", example = "1") private Long companyId; - @Schema(description = "部门ID", example = "1") private Long departmentId; - @Schema(description = "岗位ID", example = "1") private Long positionId; - @Schema(description = "是否超级管理员 (0-否 1-是)", example = "0", allowableValues = {"0", "1"}) private Integer isSuper; - @Schema(description = "头像图片ID", example = "1") private Long avatarImageId; - @Schema(description = "状态(0-正常 1-删除 2-停用 3-冻结)", example = "0") private Integer status; - @Schema(description = "备注", example = "备注信息") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/UpdateAccountDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/UpdateAccountDTO.java index 1a7f83db..c321c5ba 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/UpdateAccountDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/dto/UpdateAccountDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.account.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Pattern; import lombok.Data; @@ -8,25 +7,18 @@ import lombok.Data; * 更新账户DTO */ @Data -@Schema(description = "更新账户请求") public class UpdateAccountDTO { @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码格式不正确") - @Schema(description = "手机号码", example = "13800138000") private String phone; - @Schema(description = "用户姓名", example = "张三") private String realName; - @Schema(description = "部门ID", example = "1") private Long departmentId; - @Schema(description = "岗位ID", example = "1") private Long positionId; - @Schema(description = "状态(0-正常 1-删除 2-停用 3-冻结)", example = "0") private Integer status; - @Schema(description = "备注信息", example = "更新后的员工账户") private String remark; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/vo/AccountPageVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/vo/AccountPageVO.java index 651b35fc..ccb9eb35 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/vo/AccountPageVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/vo/AccountPageVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.account.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; @@ -9,21 +8,15 @@ import java.util.List; * 账户分页响应VO */ @Data -@Schema(description = "账户分页响应") public class AccountPageVO { - @Schema(description = "账户列表") private List records; - @Schema(description = "总记录数", example = "100") private Long total; - @Schema(description = "当前页码", example = "1") private Long current; - @Schema(description = "每页大小", example = "10") private Long size; - @Schema(description = "总页数", example = "10") private Long pages; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/vo/CompanyAccountVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/vo/CompanyAccountVO.java index b5bce716..3bb86c90 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/vo/CompanyAccountVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/account/model/vo/CompanyAccountVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.account.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,87 +8,59 @@ import java.time.LocalDateTime; * 账户信息VO */ @Data -@Schema(description = "账户信息") public class CompanyAccountVO { - @Schema(description = "用户ID", example = "1") private Long id; - @Schema(description = "公司ID", example = "1") private Long companyId; - @Schema(description = "公司名称", example = "测试公司") private String companyName; - @Schema(description = "部门ID", example = "1") private Long departmentId; - @Schema(description = "部门名称(多个用逗号分隔)", example = "技术部,研发部") private String departmentName; - @Schema(description = "岗位ID", example = "1") private Long positionId; - @Schema(description = "岗位名称", example = "软件工程师") private String positionName; - @Schema(description = "登录账号", example = "admin001") private String loginCode; - @Schema(description = "手机号码", example = "13800138000") private String phone; - @Schema(description = "用户姓名", example = "张三") private String realName; - @Schema(description = "头像路径", example = "https://example.com/avatar.jpg") private String avatar; - @Schema(description = "头像图片ID", example = "1") private Long avatarImageId; - @Schema(description = "是否超级管理员", example = "0") private Integer isSuper; - @Schema(description = "是否超级管理员名称", example = "普通用户") private String isSuperName; - @Schema(description = "密码安全级别", example = "3") private Integer pwdSecurityLevel; - @Schema(description = "密码最后更新时间", example = "2023-12-01T10:00:00") private LocalDateTime pwdUpdateTime; - @Schema(description = "最后登录IP", example = "192.168.1.1") private String lastLoginIp; - @Schema(description = "最后登录时间", example = "2023-12-01T10:00:00") private LocalDateTime lastLoginDate; - @Schema(description = "冻结时间", example = "2023-12-01T10:00:00") private LocalDateTime freezeDate; - @Schema(description = "冻结原因", example = "违规操作") private String freezeCause; - @Schema(description = "状态", example = "0") private Integer status; - @Schema(description = "状态名称", example = "正常") private String statusName; - @Schema(description = "备注信息", example = "新员工账户") private String remark; - @Schema(description = "创建时间", example = "2023-12-01T10:00:00") private LocalDateTime createTime; - @Schema(description = "更新时间", example = "2023-12-01T10:00:00") private LocalDateTime updateTime; - @Schema(description = "创建者", example = "拥有者") private String createByName; - @Schema(description = "更新者", example = "拥有者") private String updateByName; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/controller/CompanyController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/controller/CompanyController.java index b753451c..3e2269f3 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/controller/CompanyController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/controller/CompanyController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -20,7 +17,6 @@ import top.xyquan.ecomdmbbackend.utils.FileUploadUtils; /** * 公司管理控制器 */ -@Tag(name = "组织-公司管理", description = "公司的增删改查接口") @RestController @RequestMapping("/api/company") public class CompanyController { @@ -31,7 +27,6 @@ public class CompanyController { this.companyService = companyService; } - @Operation(summary = "创建公司", description = "创建新的公司") @PostMapping("/create") @RequirePermission(value = "org:company:create", description = "创建公司", allowSuper = true) public ApiResponse createCompany(@Valid @RequestBody CreateCompanyDTO createCompanyDTO) { @@ -39,7 +34,6 @@ public class CompanyController { return ApiResponse.success("公司创建成功", companyVO); } - @Operation(summary = "更新公司", description = "更新现有公司信息") @PutMapping("/update/{id}") @RequirePermission(value = "org:company:update", description = "更新公司", allowSuper = true) public ApiResponse updateCompany(@Valid @RequestBody UpdateCompanyDTO updateCompanyDTO, @@ -48,16 +42,14 @@ public class CompanyController { return ApiResponse.success("公司更新成功", companyVO); } - @Operation(summary = "删除公司", description = "删除指定公司") @DeleteMapping("/delete/{id}") @RequirePermission(value = "org:company:delete", description = "删除公司", allowSuper = true) public ApiResponse deleteCompany( - @Parameter(description = "公司ID") @PathVariable Long id) { +@PathVariable Long id) { companyService.deleteCompany(id); return ApiResponse.success("公司删除成功"); } - @Operation(summary = "分页查询公司列表", description = "分页查询公司列表,支持多种过滤条件") @PostMapping("/list") @RequirePermission(value = "org:company:read", description = "查询公司列表", allowSuper = true) public ApiResponse> getCompanyPage( @@ -66,7 +58,6 @@ public class CompanyController { return ApiResponse.success("获取公司列表成功", pageResult); } - @Operation(summary = "上传公司Logo", description = "上传公司Logo图片") @PostMapping("/upload-logo") @RequirePermission(value = "org:company:update", description = "上传公司Logo", allowSuper = true) public ApiResponse uploadLogo(@RequestParam("file") MultipartFile file) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/controller/CompanyMemberController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/controller/CompanyMemberController.java index 057849f9..e8992431 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/controller/CompanyMemberController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/controller/CompanyMemberController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.member.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -18,7 +15,6 @@ import java.util.List; /** * 公司成员控制器 */ -@Tag(name = "组织-公司成员管理", description = "公司成员的增删改查接口") @RestController @RequestMapping("/api/company-member") public class CompanyMemberController { @@ -32,7 +28,6 @@ public class CompanyMemberController { this.currentUserContext = currentUserContext; } - @Operation(summary = "创建公司成员", description = "创建新的公司成员") @PostMapping("/create") @RequirePermission(value = "org:member:manage", description = "创建公司成员", allowSuper = true) public ApiResponse create(@Valid @RequestBody CreateCompanyMemberDTO dto) { @@ -40,53 +35,47 @@ public class CompanyMemberController { return ApiResponse.success("公司成员创建成功", vo); } - @Operation(summary = "更新成员职位", description = "更新成员的职位") @PutMapping("/update-position/{memberId}") @RequirePermission(value = "org:member:manage", description = "更新成员职位", allowSuper = true) public ApiResponse updatePosition( - @Parameter(description = "成员ID") @PathVariable Long memberId, +@PathVariable Long memberId, @RequestParam Long positionId) { CompanyMemberVO vo = companyMemberService.updatePosition(memberId, positionId); return ApiResponse.success("成员职位更新成功", vo); } - @Operation(summary = "变更成员角色", description = "变更成员的角色") @PutMapping("/change-role/{memberId}") @RequirePermission(value = "org:member:manage", description = "变更成员角色", allowSuper = true) public ApiResponse changeRole( - @Parameter(description = "成员ID") @PathVariable Long memberId, +@PathVariable Long memberId, @RequestParam String role) { CompanyMemberVO vo = companyMemberService.changeRole(memberId, CompanyMemberRole.fromCode(role)); return ApiResponse.success("成员角色变更成功", vo); } - @Operation(summary = "移除成员", description = "移除公司成员") @DeleteMapping("/remove/{memberId}") @RequirePermission(value = "org:member:manage", description = "移除成员", allowSuper = true) - public ApiResponse remove(@Parameter(description = "成员ID") @PathVariable Long memberId) { + public ApiResponse remove(@PathVariable Long memberId) { companyMemberService.remove(memberId); return ApiResponse.success("成员移除成功"); } - @Operation(summary = "获取公司所有成员", description = "获取指定公司的所有成员(含用户信息、职位名称)") @GetMapping("/company/{companyId}") @RequirePermission(value = "org:member:read", description = "查询公司成员", allowSuper = true) public ApiResponse> getByCompanyId( - @Parameter(description = "公司ID") @PathVariable Long companyId) { +@PathVariable Long companyId) { List list = companyMemberService.getByCompanyId(companyId); return ApiResponse.success("获取公司成员列表成功", list); } - @Operation(summary = "获取用户所属公司列表", description = "获取当前用户所属的所有公司列表") @GetMapping("/user/{userId}") @RequirePermission(value = "org:member:read", description = "查询用户公司列表", allowSuper = true) public ApiResponse> getByUserId( - @Parameter(description = "用户ID") @PathVariable Long userId) { +@PathVariable Long userId) { List list = companyMemberService.getByUserId(userId); return ApiResponse.success("获取用户公司列表成功", list); } - @Operation(summary = "获取当前用户的公司成员信息", description = "获取当前用户在公司中的成员信息") @GetMapping("/current") public ApiResponse getCurrentMember() { Long userId = currentUserContext.getCurrentUserId(); @@ -98,7 +87,6 @@ public class CompanyMemberController { return ApiResponse.fail("用户不属于当前公司"); } - @Operation(summary = "获取当前用户所有公司成员信息", description = "获取当前用户所有公司成员信息") @GetMapping("/current/all") public ApiResponse> getCurrentUserAllMembers() { Long userId = currentUserContext.getCurrentUserId(); diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/dto/CreateCompanyMemberDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/dto/CreateCompanyMemberDTO.java index d823efcf..134341b5 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/dto/CreateCompanyMemberDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/dto/CreateCompanyMemberDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.member.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; import lombok.Data; @@ -9,21 +8,16 @@ import lombok.Data; * 创建公司成员DTO */ @Data -@Schema(description = "创建公司成员DTO") public class CreateCompanyMemberDTO { - @Schema(description = "用户ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "用户ID不能为空") private Long userId; - @Schema(description = "公司ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "公司ID不能为空") private Long companyId; - @Schema(description = "角色: owner=公司拥有者, member=成员", example = "member") @Pattern(regexp = "^(owner|member)$", message = "角色必须是owner或member") private String role = "member"; - @Schema(description = "职位ID", example = "1") private Long positionId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/dto/UpdateCompanyMemberDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/dto/UpdateCompanyMemberDTO.java index 9fe1bc67..c1c52f25 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/dto/UpdateCompanyMemberDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/dto/UpdateCompanyMemberDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.member.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Pattern; import lombok.Data; @@ -8,16 +7,12 @@ import lombok.Data; * 更新公司成员DTO */ @Data -@Schema(description = "更新公司成员DTO") public class UpdateCompanyMemberDTO { - @Schema(description = "职位ID", example = "1") private Long positionId; - @Schema(description = "角色: owner=公司拥有者, member=成员", example = "member") @Pattern(regexp = "^(owner|member)$", message = "角色必须是owner或member") private String role; - @Schema(description = "状态: 0=禁用, 1=正常", example = "1") private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/vo/CompanyMemberVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/vo/CompanyMemberVO.java index 6025c476..73ff3a43 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/vo/CompanyMemberVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/member/model/vo/CompanyMemberVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.member.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,51 +8,35 @@ import java.time.LocalDateTime; * 公司成员VO */ @Data -@Schema(description = "公司成员VO") public class CompanyMemberVO { - @Schema(description = "成员ID", example = "1") private Long id; - @Schema(description = "用户ID", example = "1") private Long userId; - @Schema(description = "公司ID", example = "1") private Long companyId; - @Schema(description = "公司名称", example = "测试公司") private String companyName; - @Schema(description = "角色: owner=公司拥有者, member=成员", example = "owner") private String role; - @Schema(description = "角色名称", example = "公司拥有者") private String roleName; - @Schema(description = "职位ID", example = "1") private Long positionId; - @Schema(description = "职位名称", example = "技术总监") private String positionName; - @Schema(description = "状态: 0=禁用, 1=正常", example = "1") private Integer status; - @Schema(description = "状态名称", example = "正常") private String statusName; - @Schema(description = "用户姓名", example = "张三") private String realName; - @Schema(description = "手机号码", example = "13800138000") private String phone; - @Schema(description = "登录账号", example = "admin001") private String loginCode; - @Schema(description = "创建时间") private LocalDateTime createTime; - @Schema(description = "更新时间") private LocalDateTime updateTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/controller/CompanyMenuController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/controller/CompanyMenuController.java index 9d90f721..5fab9c3b 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/controller/CompanyMenuController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/controller/CompanyMenuController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.menu.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; import top.xyquan.ecomdmbbackend.common.response.ApiResponse; @@ -14,7 +11,6 @@ import java.util.List; /** * 公司菜单管理控制器 */ -@Tag(name = "组织-公司菜单管理", description = "公司菜单的增删改查接口") @RestController @RequestMapping("/api/company-menu") public class CompanyMenuController { @@ -25,26 +21,23 @@ public class CompanyMenuController { this.companyMenuService = companyMenuService; } - @Operation(summary = "获取公司所有菜单ID(超管)", description = "获取指定公司的所有菜单ID列表") @GetMapping("/menu-ids/{id}") @RequirePermission(value = "org:company-menu:assign", description = "获取公司菜单ID", allowSuper = true) public ApiResponse> getCompanyMenuIds( - @Parameter(description = "公司ID") @PathVariable Long id) { +@PathVariable Long id) { List menuIds = companyMenuService.getCompanyMenuIds(id); return ApiResponse.success("获取公司菜单ID列表成功", menuIds); } - @Operation(summary = "批量更新公司菜单(超管)", description = "批量更新公司菜单状态,新增缺失的菜单,停用多余的菜单,启用已有的菜单") @PostMapping("/batch-update/{id}") @RequirePermission(value = "org:company-menu:assign", description = "批量更新公司菜单", allowSuper = true) public ApiResponse batchUpdateCompanyMenus( - @Parameter(description = "公司ID") @PathVariable Long id, - @Parameter(description = "菜单ID列表") @RequestBody List menuIds) { +@PathVariable Long id, +@RequestBody List menuIds) { companyMenuService.batchUpdateCompanyMenus(id, menuIds); return ApiResponse.success("公司菜单更新成功"); } - @Operation(summary = "获取公司所有菜单列表", description = "获取当前用户公司的所有菜单列表,包含公司菜单中间表ID,中间表只作为过滤条件,不覆盖系统菜单字段") @GetMapping("/menus") @RequirePermission(value = "org:company-menu:assign", description = "获取公司菜单列表", allowSuper = true) public ApiResponse> getCompanyMenus() { @@ -52,7 +45,6 @@ public class CompanyMenuController { return ApiResponse.success("获取公司菜单列表成功", menus); } - @Operation(summary = "获取公司完整菜单树", description = "获取当前用户公司的完整菜单树结构,包含公司菜单中间表ID,中间表只作为过滤条件,不覆盖系统菜单字段") @GetMapping("/menu-tree") @RequirePermission(value = "org:company-menu:assign", description = "获取公司菜单树", allowSuper = true) public ApiResponse> getCompanyMenuTree() { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/BatchCompanyMenuDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/BatchCompanyMenuDTO.java index 60780eb8..f8906c02 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/BatchCompanyMenuDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/BatchCompanyMenuDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.menu.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -11,20 +10,17 @@ import java.util.List; * 批量操作公司菜单DTO */ @Data -@Schema(description = "批量操作公司菜单DTO") public class BatchCompanyMenuDTO { /** * 公司ID */ - @Schema(description = "公司ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "公司ID不能为空") private Long companyId; /** * 菜单ID列表 */ - @Schema(description = "菜单ID列表", example = "[1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "菜单ID列表不能为空") private List menuIds; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/CompanyMenuDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/CompanyMenuDTO.java index ea9f135e..3e85df25 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/CompanyMenuDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/CompanyMenuDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.menu.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -9,32 +8,27 @@ import lombok.Data; * 简化版:只保留公司ID、菜单ID和状态 */ @Data -@Schema(description = "公司菜单DTO") public class CompanyMenuDTO { /** * 关联ID(公司菜单记录ID) */ - @Schema(description = "关联ID", example = "1") private Long id; /** * 公司ID */ - @Schema(description = "公司ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "公司ID不能为空") private Long companyId; /** * 菜单ID */ - @Schema(description = "菜单ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "菜单ID不能为空") private Long menuId; /** * 状态 (0-禁用 1-启用) */ - @Schema(description = "菜单状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/CreateCompanyMenuDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/CreateCompanyMenuDTO.java index 8ff07195..35949423 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/CreateCompanyMenuDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/CreateCompanyMenuDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.menu.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -9,26 +8,22 @@ import lombok.Data; * 简化版:只保留公司ID和菜单ID */ @Data -@Schema(description = "创建公司菜单DTO") public class CreateCompanyMenuDTO { /** * 公司ID */ - @Schema(description = "公司ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "公司ID不能为空") private Long companyId; /** * 菜单ID */ - @Schema(description = "菜单ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "菜单ID不能为空") private Long menuId; /** * 状态 (0-禁用 1-启用) */ - @Schema(description = "菜单状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/UpdateCompanyMenuDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/UpdateCompanyMenuDTO.java index 1775f259..63aa9587 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/UpdateCompanyMenuDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/menu/model/dto/UpdateCompanyMenuDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.menu.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -9,33 +8,28 @@ import lombok.Data; * 简化版:只保留公司ID、菜单ID和状态 */ @Data -@Schema(description = "更新公司菜单DTO") public class UpdateCompanyMenuDTO { /** * 关联ID(公司菜单记录ID) */ - @Schema(description = "关联ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "关联ID不能为空") private Long id; /** * 公司ID */ - @Schema(description = "公司ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "公司ID不能为空") private Long companyId; /** * 菜单ID */ - @Schema(description = "菜单ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "菜单ID不能为空") private Long menuId; /** * 状态 (0-禁用 1-启用) */ - @Schema(description = "菜单状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CompanyDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CompanyDTO.java index 2fe2af0f..70e2bf38 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CompanyDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CompanyDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -10,53 +9,41 @@ import java.time.LocalDateTime; * 公司DTO */ @Data -@Schema(description = "公司DTO") public class CompanyDTO { /** * 公司ID(更新时使用) */ - @Schema(description = "公司ID(更新时使用)", example = "1") private Long id; /** * 公司名称 */ - @Schema(description = "公司名称", example = "某某科技有限公司", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "公司名称不能为空") private String name; /** * 公司地址 */ - @Schema(description = "公司地址", example = "北京市朝阳区xxx街道xxx号") private String address; - - - - /** * 邮箱 */ - @Schema(description = "邮箱", example = "contact@company.com") private String email; /** * logo */ - @Schema(description = "公司logo", example = "https://example.com/logo.png") private String logo; /** * 状态 (0-禁用 1-正常) */ - @Schema(description = "公司状态", example = "1", allowableValues = { "0", "1" }) private Integer status; /** * 订阅到期时间 */ - @Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59") private LocalDateTime expireTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CompanyFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CompanyFilterDTO.java index 1455e9e4..92cd8a14 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CompanyFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CompanyFilterDTO.java @@ -1,48 +1,40 @@ package top.xyquan.ecomdmbbackend.modules.org.company.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 公司分页查询过滤DTO */ @Data -@Schema(description = "公司分页查询过滤DTO") public class CompanyFilterDTO { /** * 公司名称(模糊查询) */ - @Schema(description = "公司名称(模糊查询)", example = "科技") private String name; /** * 联系人(模糊查询) */ - @Schema(description = "联系人(模糊查询)", example = "张") private String contactPerson; /** * 联系电话(精确查询) */ - @Schema(description = "联系电话(精确查询)", example = "13800138000") private String contactPhone; /** * 邮箱(精确查询) */ - @Schema(description = "邮箱(精确查询)", example = "contact@company.com") private String email; /** * 状态查询 */ - @Schema(description = "公司状态", example = "1", allowableValues = { "0", "1" }) private Integer status; /** * 过期状态查询 */ - @Schema(description = "是否过期", example = "false", allowableValues = { "true", "false" }) private Boolean expired; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CreateCompanyDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CreateCompanyDTO.java index c134ce91..df4a126c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CreateCompanyDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/CreateCompanyDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -10,39 +9,33 @@ import java.time.LocalDateTime; * 创建公司DTO */ @Data -@Schema(description = "创建公司DTO") public class CreateCompanyDTO { /** * 公司名称 */ - @Schema(description = "公司名称", example = "某某科技有限公司", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "公司名称不能为空") private String name; /** * 公司地址 */ - @Schema(description = "公司地址", example = "北京市朝阳区xxx街道xxx号") private String address; /** * 邮箱 */ - @Schema(description = "邮箱", example = "contact@company.com") private String email; /** * 公司拥有者姓名 */ - @Schema(description = "公司拥有者姓名", example = "张三", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "公司拥有者姓名不能为空") private String ownerName; /** * 公司拥有者电话(作为登录账号) */ - @Schema(description = "公司拥有者电话", example = "13800138000", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "公司拥有者电话不能为空") private String ownerPhone; @@ -52,12 +45,10 @@ public class CreateCompanyDTO { /** * 状态 (0-禁用 1-正常) */ - @Schema(description = "公司状态", example = "1", allowableValues = { "0", "1" }) private Integer status; /** * 订阅到期时间 */ - @Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59") private LocalDateTime expireTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/UpdateCompanyDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/UpdateCompanyDTO.java index 7773f54d..cf0389d9 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/UpdateCompanyDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/dto/UpdateCompanyDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -10,30 +9,22 @@ import java.time.LocalDateTime; * 更新公司DTO */ @Data -@Schema(description = "更新公司DTO") public class UpdateCompanyDTO { /** * 公司名称 */ - @Schema(description = "公司名称", example = "某某科技有限公司", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "公司名称不能为空") private String name; /** * 公司地址 */ - @Schema(description = "公司地址", example = "北京市朝阳区xxx街道xxx号") private String address; - - - - /** * 邮箱 */ - @Schema(description = "邮箱", example = "contact@company.com") private String email; /** @@ -42,12 +33,10 @@ public class UpdateCompanyDTO { /** * 状态 (0-禁用 1-正常) */ - @Schema(description = "公司状态", example = "1", allowableValues = { "0", "1" }) private Integer status; /** * 订阅到期时间 */ - @Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59") private LocalDateTime expireTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/vo/CompanyVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/vo/CompanyVO.java index fe26186f..8976e5a2 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/vo/CompanyVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/model/vo/CompanyVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,88 +8,70 @@ import java.time.LocalDateTime; * 公司VO */ @Data -@Schema(description = "公司VO") public class CompanyVO { /** * 公司ID */ - @Schema(description = "公司ID", example = "1") private Long id; /** * 公司名称 */ - @Schema(description = "公司名称", example = "某某科技有限公司") private String name; /** * 订阅到期时间 */ - @Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59") private LocalDateTime expiration; /** * 公司地址 */ - @Schema(description = "公司地址", example = "北京市朝阳区xxx街道xxx号") private String address; /** * 公司拥有者姓名 */ - @Schema(description = "公司拥有者姓名", example = "张三") private String ownerName; /** * 公司拥有者电话 */ - @Schema(description = "公司拥有者电话", example = "13800138000") private String ownerPhone; - - - - /** * 邮箱 */ - @Schema(description = "邮箱", example = "contact@company.com") private String email; /** * logo */ - @Schema(description = "公司logo", example = "https://example.com/logo.png") private String logo; /** * 状态 (0-禁用 1-正常) */ - @Schema(description = "公司状态", example = "1", allowableValues = { "0", "1" }) private Integer status; /** * 订阅到期时间 */ - @Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59") private LocalDateTime expireTime; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01 10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01 10:00:00") private LocalDateTime updateTime; /** * 是否过期 */ - @Schema(description = "是否过期", example = "false") private Boolean expired; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/permission/controller/CompanyPermissionController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/permission/controller/CompanyPermissionController.java index 3e65847b..73104422 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/permission/controller/CompanyPermissionController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/company/permission/controller/CompanyPermissionController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.company.permission.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -16,7 +13,6 @@ import java.util.List; /** * 公司权限管理控制器 */ -@Tag(name = "组织-公司权限管理", description = "公司权限的分配和管理接口") @RestController @RequestMapping("/api/company-permission") public class CompanyPermissionController { @@ -27,7 +23,6 @@ public class CompanyPermissionController { this.companyPermissionService = companyPermissionService; } - @Operation(summary = "批量分配公司权限(超管)", description = "批量分配公司权限,覆盖原有的权限分配") @PostMapping("/batch-assign") @RequirePermission(value = "org:company-permission:assign", description = "批量分配公司权限", allowSuper = true) public ApiResponse batchAssignCompanyPermissions( @@ -36,29 +31,26 @@ public class CompanyPermissionController { return ApiResponse.success("公司权限分配成功"); } - @Operation(summary = "获取公司权限列表(超管)", description = "获取指定公司的所有权限列表") @GetMapping("/company/{companyId}") @RequirePermission(value = "org:company-permission:assign", description = "查看公司权限", allowSuper = true) public ApiResponse> getCompanyPermissions( - @Parameter(description = "公司ID") @PathVariable Long companyId) { +@PathVariable Long companyId) { List permissions = companyPermissionService.getPermissionsByCompanyId(companyId); return ApiResponse.success("获取公司权限列表成功", permissions); } - @Operation(summary = "获取公司权限ID列表(超管)", description = "获取指定公司的所有权限ID列表") @GetMapping("/company/{companyId}/ids") @RequirePermission(value = "org:company-permission:assign", description = "查看公司权限", allowSuper = true) public ApiResponse> getCompanyPermissionIds( - @Parameter(description = "公司ID") @PathVariable Long companyId) { +@PathVariable Long companyId) { List permissionIds = companyPermissionService.getCompanyPermissionIds(companyId); return ApiResponse.success("获取公司权限ID列表成功", permissionIds); } - @Operation(summary = "批量更新公司权限(超管)", description = "批量更新公司权限") @PostMapping("/company/{companyId}/batch-update") @RequirePermission(value = "org:company-permission:assign", description = "批量更新公司权限", allowSuper = true) public ApiResponse batchUpdateCompanyPermissions( - @Parameter(description = "公司ID") @PathVariable Long companyId, +@PathVariable Long companyId, @RequestBody List permissionIds) { companyPermissionService.batchUpdateCompanyPermissions(companyId, permissionIds); return ApiResponse.success("公司权限更新成功"); diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/controller/DepartmentController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/controller/DepartmentController.java index 3f9a1fac..6312cc73 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/controller/DepartmentController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/controller/DepartmentController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.department.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -20,7 +17,6 @@ import java.util.List; /** * 部门管理控制器 */ -@Tag(name = "组织-部门管理", description = "部门的增删改查接口") @RestController @RequestMapping("/api/department") public class DepartmentController { @@ -31,7 +27,6 @@ public class DepartmentController { this.departmentService = departmentService; } - @Operation(summary = "创建部门", description = "创建新的部门") @PostMapping("/create") @RequirePermission(value = "org:department:manage", description = "创建部门", allowSuper = true) public ApiResponse createDepartment(@Valid @RequestBody CreateDepartmentDTO createDepartmentDTO) { @@ -39,7 +34,6 @@ public class DepartmentController { return ApiResponse.success("部门创建成功", departmentVO); } - @Operation(summary = "更新部门", description = "更新现有部门信息") @PutMapping("/update/{id}") @RequirePermission(value = "org:department:manage", description = "更新部门", allowSuper = true) public ApiResponse updateDepartment(@Valid @RequestBody UpdateDepartmentDTO updateDepartmentDTO, @@ -48,16 +42,14 @@ public class DepartmentController { return ApiResponse.success("部门更新成功", departmentVO); } - @Operation(summary = "删除部门", description = "删除指定部门") @DeleteMapping("/delete/{id}") @RequirePermission(value = "org:department:manage", description = "删除部门", allowSuper = true) public ApiResponse deleteDepartment( - @Parameter(description = "部门ID") @PathVariable Long id) { +@PathVariable Long id) { departmentService.deleteDepartment(id); return ApiResponse.success("部门删除成功"); } - @Operation(summary = "分页获取部门列表", description = "分页获取部门列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "org:department:read", description = "查询部门列表", allowSuper = true) public ApiResponse> getDepartmentPage( @@ -66,7 +58,6 @@ public class DepartmentController { return ApiResponse.success("获取部门列表成功", result); } - @Operation(summary = "获取全部部门", description = "获取当前公司全部部门列表") @GetMapping("/all") @RequirePermission(value = "org:department:read", description = "查询全部部门", allowSuper = true) public ApiResponse> getAllDepartments() { @@ -74,7 +65,6 @@ public class DepartmentController { return ApiResponse.success("获取全部部门成功", result); } - @Operation(summary = "获取部门树", description = "获取当前公司部门树形结构") @GetMapping("/tree") @RequirePermission(value = "org:department:read", description = "查询部门树", allowSuper = true) public ApiResponse> getDepartmentTree() { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/controller/DepartmentMemberController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/controller/DepartmentMemberController.java index ed17e663..8c7566d2 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/controller/DepartmentMemberController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/controller/DepartmentMemberController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.department.member.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -17,7 +14,6 @@ import java.util.List; /** * 部门成员控制器 */ -@Tag(name = "组织-部门成员管理", description = "部门成员的增删改查接口") @RestController @RequestMapping("/api/department-member") public class DepartmentMemberController { @@ -28,7 +24,6 @@ public class DepartmentMemberController { this.departmentMemberService = departmentMemberService; } - @Operation(summary = "添加部门成员", description = "添加成员到部门") @PostMapping("/add") @RequirePermission(value = "org:department:manage", description = "添加部门成员", allowSuper = true) public ApiResponse addMember(@Valid @RequestBody AddDepartmentMemberDTO dto) { @@ -36,7 +31,6 @@ public class DepartmentMemberController { return ApiResponse.success("部门成员添加成功", vo); } - @Operation(summary = "移除部门成员", description = "从部门移除成员") @PostMapping("/remove") @RequirePermission(value = "org:department:manage", description = "移除部门成员", allowSuper = true) public ApiResponse removeMember(@Valid @RequestBody RemoveDepartmentMemberDTO dto) { @@ -44,20 +38,18 @@ public class DepartmentMemberController { return ApiResponse.success("部门成员移除成功"); } - @Operation(summary = "获取部门所有成员", description = "获取指定部门的所有成员(含用户信息)") @GetMapping("/department/{departmentId}") @RequirePermission(value = "org:department:read", description = "查询部门成员", allowSuper = true) public ApiResponse> getByDepartmentId( - @Parameter(description = "部门ID") @PathVariable Long departmentId) { +@PathVariable Long departmentId) { List list = departmentMemberService.getByDepartmentId(departmentId); return ApiResponse.success("获取部门成员列表成功", list); } - @Operation(summary = "获取用户所属部门列表", description = "获取用户所属的所有部门列表") @GetMapping("/user/{userId}") @RequirePermission(value = "org:department:read", description = "查询用户部门列表", allowSuper = true) public ApiResponse> getByUserId( - @Parameter(description = "用户ID") @PathVariable Long userId) { +@PathVariable Long userId) { List list = departmentMemberService.getByUserId(userId); return ApiResponse.success("获取用户部门列表成功", list); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/dto/AddDepartmentMemberDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/dto/AddDepartmentMemberDTO.java index 8e57b938..ed03b060 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/dto/AddDepartmentMemberDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/dto/AddDepartmentMemberDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.department.member.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -8,14 +7,11 @@ import lombok.Data; * 添加部门成员DTO */ @Data -@Schema(description = "添加部门成员DTO") public class AddDepartmentMemberDTO { - @Schema(description = "部门ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "部门ID不能为空") private Long departmentId; - @Schema(description = "用户ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "用户ID不能为空") private Long userId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/dto/RemoveDepartmentMemberDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/dto/RemoveDepartmentMemberDTO.java index dff17e83..4b055fcd 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/dto/RemoveDepartmentMemberDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/dto/RemoveDepartmentMemberDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.department.member.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -8,14 +7,11 @@ import lombok.Data; * 移除部门成员DTO */ @Data -@Schema(description = "移除部门成员DTO") public class RemoveDepartmentMemberDTO { - @Schema(description = "部门ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "部门ID不能为空") private Long departmentId; - @Schema(description = "用户ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "用户ID不能为空") private Long userId; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/vo/DepartmentMemberVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/vo/DepartmentMemberVO.java index d78fbfd5..a1375264 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/vo/DepartmentMemberVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/member/model/vo/DepartmentMemberVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.department.member.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,39 +8,27 @@ import java.time.LocalDateTime; * 部门成员VO */ @Data -@Schema(description = "部门成员VO") public class DepartmentMemberVO { - @Schema(description = "成员ID", example = "1") private Long id; - @Schema(description = "用户ID", example = "1") private Long userId; - @Schema(description = "部门ID", example = "1") private Long departmentId; - @Schema(description = "部门名称", example = "技术部") private String departmentName; - @Schema(description = "状态: 0=禁用, 1=正常", example = "1") private Integer status; - @Schema(description = "状态名称", example = "正常") private String statusName; - @Schema(description = "用户姓名", example = "张三") private String realName; - @Schema(description = "手机号码", example = "13800138000") private String phone; - @Schema(description = "登录账号", example = "admin001") private String loginCode; - @Schema(description = "创建时间") private LocalDateTime createTime; - @Schema(description = "更新时间") private LocalDateTime updateTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/CreateDepartmentDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/CreateDepartmentDTO.java index cdfc43a2..8f438c37 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/CreateDepartmentDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/CreateDepartmentDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.department.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,31 +7,26 @@ import lombok.Data; * 创建部门DTO */ @Data -@Schema(description = "创建部门DTO") public class CreateDepartmentDTO { /** * 部门名称 */ - @Schema(description = "部门名称", example = "技术部", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "部门名称不能为空") private String name; /** * 部门父级ID */ - @Schema(description = "部门父级ID", example = "1") private Long parentId; /** * 描述 */ - @Schema(description = "部门描述", example = "负责公司技术研发工作") private String remark; /** * 状态 */ - @Schema(description = "部门状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/DepartmentDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/DepartmentDTO.java index b6a99c2d..c6c74649 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/DepartmentDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/DepartmentDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.department.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -9,44 +8,37 @@ import lombok.Data; * 部门DTO */ @Data -@Schema(description = "部门DTO") public class DepartmentDTO { /** * 部门ID(更新时使用) */ - @Schema(description = "部门ID(更新时使用)", example = "1") private Long id; /** * 部门名称 */ - @Schema(description = "部门名称", example = "技术部", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "部门名称不能为空") private String name; /** * 部门父级ID */ - @Schema(description = "部门父级ID", example = "1") private Long parentId; /** * 公司ID */ - @Schema(description = "公司ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "公司ID不能为空") private Long companyId; /** * 描述 */ - @Schema(description = "部门描述", example = "负责公司技术研发工作") private String remark; /** * 状态 */ - @Schema(description = "部门状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/DepartmentFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/DepartmentFilterDTO.java index da32d21a..e4606d94 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/DepartmentFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/DepartmentFilterDTO.java @@ -1,30 +1,25 @@ package top.xyquan.ecomdmbbackend.modules.org.department.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 部门分页查询过滤DTO */ @Data -@Schema(description = "部门分页查询过滤DTO") public class DepartmentFilterDTO { /** * 部门名称(模糊查询) */ - @Schema(description = "部门名称(模糊查询)", example = "技术") private String name; /** * 父级部门ID */ - @Schema(description = "父级部门ID", example = "1") private Long parentId; /** * 状态 */ - @Schema(description = "部门状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/UpdateDepartmentDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/UpdateDepartmentDTO.java index ba7bbeed..3a597e8b 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/UpdateDepartmentDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/dto/UpdateDepartmentDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.department.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,31 +7,26 @@ import lombok.Data; * 更新部门DTO */ @Data -@Schema(description = "更新部门DTO") public class UpdateDepartmentDTO { /** * 部门名称 */ - @Schema(description = "部门名称", example = "技术部", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "部门名称不能为空") private String name; /** * 部门父级ID */ - @Schema(description = "部门父级ID", example = "1") private Long parentId; /** * 描述 */ - @Schema(description = "部门描述", example = "负责公司技术研发工作") private String remark; /** * 状态 */ - @Schema(description = "部门状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/vo/DepartmentVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/vo/DepartmentVO.java index 3e4e7dcb..303e3e5e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/vo/DepartmentVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/department/model/vo/DepartmentVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.department.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -10,67 +9,56 @@ import java.util.List; * 部门VO */ @Data -@Schema(description = "部门VO") public class DepartmentVO { /** * 部门ID */ - @Schema(description = "部门ID", example = "1") private Long id; /** * 部门名称 */ - @Schema(description = "部门名称", example = "技术部") private String name; /** * 部门父级ID */ - @Schema(description = "部门父级ID", example = "1") private Long parentId; /** * 公司ID */ - @Schema(description = "公司ID", example = "1") private Long companyId; /** * 描述 */ - @Schema(description = "部门描述", example = "负责公司技术研发工作") private String remark; /** * 状态 */ - @Schema(description = "部门状态", example = "1", allowableValues = { "0", "1" }) private Integer status; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建人 */ - @Schema(description = "创建人ID", example = "1") private Long createBy; /** * 更新人 */ - @Schema(description = "更新人ID", example = "1") private Long updateBy; /** diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/controller/PositionController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/controller/PositionController.java index 7dd3e589..e226c7ba 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/controller/PositionController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/controller/PositionController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.position.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -18,7 +15,6 @@ import top.xyquan.ecomdmbbackend.modules.org.position.service.PositionService; /** * 岗位管理控制器 */ -@Tag(name = "组织-岗位管理", description = "岗位的增删改查接口") @RestController @RequestMapping("/api/position") public class PositionController { @@ -29,7 +25,6 @@ public class PositionController { this.positionService = positionService; } - @Operation(summary = "创建岗位", description = "创建新的岗位") @PostMapping("/create") @RequirePermission(value = "org:position:manage", description = "创建岗位", allowSuper = true) public ApiResponse createPosition(@Valid @RequestBody CreatePositionDTO createPositionDTO) { @@ -37,7 +32,6 @@ public class PositionController { return ApiResponse.success("岗位创建成功", positionVO); } - @Operation(summary = "更新岗位", description = "更新现有岗位信息") @PutMapping("/update/{id}") @RequirePermission(value = "org:position:manage", description = "更新岗位", allowSuper = true) public ApiResponse updatePosition(@Valid @RequestBody UpdatePositionDTO updatePositionDTO, @@ -46,16 +40,14 @@ public class PositionController { return ApiResponse.success("岗位更新成功", positionVO); } - @Operation(summary = "删除岗位", description = "删除指定岗位") @DeleteMapping("/delete/{id}") @RequirePermission(value = "org:position:manage", description = "删除岗位", allowSuper = true) public ApiResponse deletePosition( - @Parameter(description = "岗位ID") @PathVariable Long id) { +@PathVariable Long id) { positionService.deletePosition(id); return ApiResponse.success("岗位删除成功"); } - @Operation(summary = "分页获取岗位列表", description = "分页获取岗位列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "org:position:read", description = "查询岗位列表", allowSuper = true) public ApiResponse> getPositionPage( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/menu/controller/PositionPermissionController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/menu/controller/PositionPermissionController.java index 1c360b75..7b028d05 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/menu/controller/PositionPermissionController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/menu/controller/PositionPermissionController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.position.menu.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -18,7 +15,6 @@ import java.util.List; * 职位菜单管理控制器 * 职位菜单关联表: org_position_menu(由 org_position_company_menu_map 重命名) */ -@Tag(name = "组织-职位菜单管理", description = "职位菜单的分配和管理接口") @RestController @RequestMapping("/api/position-menu") public class PositionPermissionController { @@ -29,7 +25,6 @@ public class PositionPermissionController { this.positionMenuService = positionMenuService; } - @Operation(summary = "批量分配职位菜单", description = "为指定职位批量分配菜单") @PostMapping("/assign") @RequirePermission(value = "org:position-menu:assign", description = "批量分配职位菜单", allowSuper = true) public ApiResponse batchAssignPositionMenus(@Valid @RequestBody BatchAssignPositionMenuDTO batchAssignDTO) { @@ -37,26 +32,23 @@ public class PositionPermissionController { return ApiResponse.success("职位菜单分配成功"); } - @Operation(summary = "移除职位菜单", description = "移除指定职位的某个菜单") @DeleteMapping("/remove/{positionId}/{menuId}") @RequirePermission(value = "org:position-menu:assign", description = "移除职位菜单", allowSuper = true) public ApiResponse removePositionMenu( - @Parameter(description = "职位ID") @PathVariable Long positionId, - @Parameter(description = "菜单ID") @PathVariable Long menuId) { +@PathVariable Long positionId, +@PathVariable Long menuId) { positionMenuService.removePositionMenu(positionId, menuId); return ApiResponse.success("职位菜单移除成功"); } - @Operation(summary = "查询职位菜单列表", description = "根据职位ID查询该职位拥有的所有菜单") @GetMapping("/menus/{positionId}") @RequirePermission(value = "org:position-menu:assign", description = "查询职位菜单列表", allowSuper = true) public ApiResponse> getMenusByPositionId( - @Parameter(description = "职位ID") @PathVariable Long positionId) { +@PathVariable Long positionId) { List menus = positionMenuService.getMenusByPositionId(positionId); return ApiResponse.success("获取职位菜单列表成功", menus); } - @Operation(summary = "批量查询职位菜单", description = "根据职位ID列表批量查询菜单") @PostMapping("/menus/batch") @RequirePermission(value = "org:position-menu:assign", description = "批量查询职位菜单", allowSuper = true) public ApiResponse> getMenusByPositionIds(@RequestBody List positionIds) { @@ -64,40 +56,36 @@ public class PositionPermissionController { return ApiResponse.success("批量获取职位菜单成功", menus); } - @Operation(summary = "检查职位菜单", description = "检查指定职位是否拥有某个菜单") @GetMapping("/check/{positionId}/{menuId}") @RequirePermission(value = "org:position-menu:assign", description = "检查职位菜单", allowSuper = true) public ApiResponse hasPositionMenu( - @Parameter(description = "职位ID") @PathVariable Long positionId, - @Parameter(description = "菜单ID") @PathVariable Long menuId) { +@PathVariable Long positionId, +@PathVariable Long menuId) { boolean hasPermission = positionMenuService.hasPositionMenu(positionId, menuId); return ApiResponse.success("检查职位菜单成功", hasPermission); } - @Operation(summary = "获取职位所有菜单ID", description = "获取指定职位的所有菜单ID列表") @GetMapping("/menu-ids/{positionId}") @RequirePermission(value = "org:position-menu:assign", description = "获取职位菜单ID", allowSuper = true) public ApiResponse> getPositionMenuIds( - @Parameter(description = "职位ID") @PathVariable Long positionId) { +@PathVariable Long positionId) { List menuIds = positionMenuService.getPositionMenuIds(positionId); return ApiResponse.success("获取职位菜单ID列表成功", menuIds); } - @Operation(summary = "批量更新职位菜单", description = "批量更新职位菜单") @PostMapping("/batch-update/{positionId}") @RequirePermission(value = "org:position-menu:assign", description = "批量更新职位菜单", allowSuper = true) public ApiResponse batchUpdatePositionMenus( - @Parameter(description = "职位ID") @PathVariable Long positionId, - @Parameter(description = "菜单ID列表") @RequestBody List menuIds) { +@PathVariable Long positionId, +@RequestBody List menuIds) { positionMenuService.batchUpdatePositionMenus(positionId, menuIds); return ApiResponse.success("职位菜单更新成功"); } - @Operation(summary = "获取职位可见菜单树", description = "获取职位已分配菜单的可见树(向上可见父级,向下展示子孙)") @GetMapping("/menu-tree/{positionId}") @RequirePermission(value = "org:position-menu:assign", description = "获取职位可见菜单树", allowSuper = true) public ApiResponse> getPositionVisibleMenuTree( - @Parameter(description = "职位ID") @PathVariable Long positionId) { +@PathVariable Long positionId) { List menuTree = positionMenuService.getPositionVisibleMenuTree(positionId); return ApiResponse.success("获取职位可见菜单树成功", menuTree); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/CreatePositionDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/CreatePositionDTO.java index b0f52367..0145f1a8 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/CreatePositionDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/CreatePositionDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.position.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,37 +7,31 @@ import lombok.Data; * 创建岗位DTO */ @Data -@Schema(description = "创建岗位DTO") public class CreatePositionDTO { /** * 岗位名称 */ - @Schema(description = "岗位名称", example = "软件工程师", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "岗位名称不能为空") private String name; /** * 岗位编码 */ - @Schema(description = "岗位编码", example = "SE001") private String code; /** * 部门ID */ - @Schema(description = "部门ID", example = "1") private Long departmentId; /** * 描述 */ - @Schema(description = "岗位描述", example = "负责系统开发工作") private String remark; /** * 状态 */ - @Schema(description = "岗位状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/PositionDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/PositionDTO.java index 48e41b81..2e1d34b0 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/PositionDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/PositionDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.position.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -9,50 +8,42 @@ import lombok.Data; * 岗位DTO */ @Data -@Schema(description = "岗位DTO") public class PositionDTO { /** * 岗位ID(更新时使用) */ - @Schema(description = "岗位ID(更新时使用)", example = "1") private Long id; /** * 岗位名称 */ - @Schema(description = "岗位名称", example = "软件工程师", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "岗位名称不能为空") private String name; /** * 岗位编码 */ - @Schema(description = "岗位编码", example = "SE001") private String code; /** * 公司ID */ - @Schema(description = "公司ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "公司ID不能为空") private Long companyId; /** * 部门ID */ - @Schema(description = "部门ID", example = "1") private Long departmentId; /** * 描述 */ - @Schema(description = "岗位描述", example = "负责系统开发工作") private String remark; /** * 状态 */ - @Schema(description = "岗位状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/PositionFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/PositionFilterDTO.java index d3f3aef7..817a803c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/PositionFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/PositionFilterDTO.java @@ -1,24 +1,20 @@ package top.xyquan.ecomdmbbackend.modules.org.position.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 岗位分页查询过滤DTO */ @Data -@Schema(description = "岗位分页查询过滤DTO") public class PositionFilterDTO { /** * 岗位名称(模糊查询) */ - @Schema(description = "岗位名称(模糊查询)", example = "工程师") private String name; /** * 状态 */ - @Schema(description = "岗位状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/UpdatePositionDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/UpdatePositionDTO.java index dd884428..1973a31c 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/UpdatePositionDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/dto/UpdatePositionDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.position.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,37 +7,31 @@ import lombok.Data; * 更新岗位DTO */ @Data -@Schema(description = "更新岗位DTO") public class UpdatePositionDTO { /** * 岗位名称 */ - @Schema(description = "岗位名称", example = "软件工程师", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "岗位名称不能为空") private String name; /** * 岗位编码 */ - @Schema(description = "岗位编码", example = "SE001") private String code; /** * 部门ID */ - @Schema(description = "部门ID", example = "1") private Long departmentId; /** * 描述 */ - @Schema(description = "岗位描述", example = "负责系统开发工作") private String remark; /** * 状态 */ - @Schema(description = "岗位状态", example = "1", allowableValues = { "0", "1" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/vo/PositionVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/vo/PositionVO.java index 0d80ef97..7ab48988 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/vo/PositionVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/model/vo/PositionVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.position.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,60 +8,50 @@ import java.time.LocalDateTime; * 岗位VO */ @Data -@Schema(description = "岗位VO") public class PositionVO { /** * 岗位ID */ - @Schema(description = "岗位ID", example = "1") private Long id; /** * 岗位名称 */ - @Schema(description = "岗位名称", example = "软件工程师") private String name; /** * 岗位描述 */ - @Schema(description = "岗位描述", example = "负责系统开发工作") private String remark; /** * 状态:(1-启用,0-禁用) */ - @Schema(description = "岗位状态", example = "1", allowableValues = { "0", "1" }) private Integer status; /** * 公司ID */ - @Schema(description = "公司ID", example = "1") private Long companyId; /** * 创建时间 */ - @Schema(description = "创建时间", example = "2024-01-01T10:00:00") private LocalDateTime createTime; /** * 更新时间 */ - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; /** * 创建者ID */ - @Schema(description = "创建者ID", example = "1") private Long createBy; /** * 更新者ID */ - @Schema(description = "更新者ID", example = "1") private Long updateBy; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/permission/controller/PositionPermissionManagementController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/permission/controller/PositionPermissionManagementController.java index 6d146908..64849120 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/permission/controller/PositionPermissionManagementController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/permission/controller/PositionPermissionManagementController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.position.permission.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -17,7 +14,6 @@ import java.util.List; * 岗位权限管理控制器 * 岗位权限关联表: org_position_permission */ -@Tag(name = "组织-岗位权限管理", description = "岗位权限的分配和管理接口") @RestController @RequestMapping("/api/position-permission") public class PositionPermissionManagementController { @@ -28,7 +24,6 @@ public class PositionPermissionManagementController { this.positionPermissionService = positionPermissionService; } - @Operation(summary = "批量分配岗位权限", description = "为指定岗位批量分配权限") @PostMapping("/assign") @RequirePermission(value = "org:position-permission:assign", description = "批量分配岗位权限", allowSuper = true) public ApiResponse batchAssignPositionPermissions( @@ -37,26 +32,23 @@ public class PositionPermissionManagementController { return ApiResponse.success("岗位权限分配成功"); } - @Operation(summary = "移除岗位权限", description = "移除指定岗位的某个权限") @DeleteMapping("/remove/{positionId}/{permissionId}") @RequirePermission(value = "org:position-permission:assign", description = "移除岗位权限", allowSuper = true) public ApiResponse removePositionPermission( - @Parameter(description = "岗位ID") @PathVariable Long positionId, - @Parameter(description = "权限ID") @PathVariable Long permissionId) { +@PathVariable Long positionId, +@PathVariable Long permissionId) { positionPermissionService.removePositionPermission(positionId, permissionId); return ApiResponse.success("岗位权限移除成功"); } - @Operation(summary = "查询岗位权限列表", description = "根据岗位ID查询该岗位拥有的所有权限") @GetMapping("/permissions/{positionId}") @RequirePermission(value = "org:position-permission:assign", description = "查询岗位权限列表", allowSuper = true) public ApiResponse> getPermissionsByPositionId( - @Parameter(description = "岗位ID") @PathVariable Long positionId) { +@PathVariable Long positionId) { List permissions = positionPermissionService.getPermissionsByPositionId(positionId); return ApiResponse.success("获取岗位权限列表成功", permissions); } - @Operation(summary = "批量查询岗位权限", description = "根据岗位ID列表批量查询权限") @PostMapping("/permissions/batch") @RequirePermission(value = "org:position-permission:assign", description = "批量查询岗位权限", allowSuper = true) public ApiResponse> getPermissionsByPositionIds(@RequestBody List positionIds) { @@ -64,50 +56,45 @@ public class PositionPermissionManagementController { return ApiResponse.success("批量获取岗位权限成功", permissions); } - @Operation(summary = "检查岗位权限", description = "检查指定岗位是否拥有某个权限") @GetMapping("/check/{positionId}/{permissionId}") @RequirePermission(value = "org:position-permission:assign", description = "检查岗位权限", allowSuper = true) public ApiResponse hasPositionPermission( - @Parameter(description = "岗位ID") @PathVariable Long positionId, - @Parameter(description = "权限ID") @PathVariable Long permissionId) { +@PathVariable Long positionId, +@PathVariable Long permissionId) { boolean hasPermission = positionPermissionService.hasPositionPermission(positionId, permissionId); return ApiResponse.success("检查岗位权限成功", hasPermission); } - @Operation(summary = "检查岗位权限码", description = "检查指定岗位是否拥有某个权限码") @GetMapping("/check-code/{positionId}/{permissionCode}") @RequirePermission(value = "org:position-permission:assign", description = "检查岗位权限码", allowSuper = true) public ApiResponse hasPositionPermissionByCode( - @Parameter(description = "岗位ID") @PathVariable Long positionId, - @Parameter(description = "权限码") @PathVariable String permissionCode) { +@PathVariable Long positionId, +@PathVariable String permissionCode) { boolean hasPermission = positionPermissionService.hasPositionPermissionByCode(positionId, permissionCode); return ApiResponse.success("检查岗位权限码成功", hasPermission); } - @Operation(summary = "获取岗位所有权限ID", description = "获取指定岗位的所有权限ID列表") @GetMapping("/permission-ids/{positionId}") @RequirePermission(value = "org:position-permission:assign", description = "获取岗位权限ID", allowSuper = true) public ApiResponse> getPositionPermissionIds( - @Parameter(description = "岗位ID") @PathVariable Long positionId) { +@PathVariable Long positionId) { List permissionIds = positionPermissionService.getPositionPermissionIds(positionId); return ApiResponse.success("获取岗位权限ID列表成功", permissionIds); } - @Operation(summary = "获取岗位所有权限码", description = "获取指定岗位的所有权限码列表") @GetMapping("/permission-codes/{positionId}") @RequirePermission(value = "org:position-permission:assign", description = "获取岗位权限码", allowSuper = true) public ApiResponse> getPositionPermissionCodes( - @Parameter(description = "岗位ID") @PathVariable Long positionId) { +@PathVariable Long positionId) { List permissionCodes = positionPermissionService.getPositionPermissionCodes(positionId); return ApiResponse.success("获取岗位权限码列表成功", permissionCodes); } - @Operation(summary = "批量更新岗位权限", description = "批量更新岗位权限") @PostMapping("/batch-update/{positionId}") @RequirePermission(value = "org:position-permission:assign", description = "批量更新岗位权限", allowSuper = true) public ApiResponse batchUpdatePositionPermissions( - @Parameter(description = "岗位ID") @PathVariable Long positionId, - @Parameter(description = "权限ID列表") @RequestBody List permissionIds) { +@PathVariable Long positionId, +@RequestBody List permissionIds) { positionPermissionService.batchUpdatePositionPermissions(positionId, permissionIds); return ApiResponse.success("岗位权限更新成功"); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/permission/model/dto/BatchAssignPositionPermissionDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/permission/model/dto/BatchAssignPositionPermissionDTO.java index 613ab89c..d286d7a8 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/permission/model/dto/BatchAssignPositionPermissionDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/org/position/permission/model/dto/BatchAssignPositionPermissionDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.org.position.permission.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; @@ -11,20 +10,17 @@ import java.util.List; * 批量分配岗位权限DTO */ @Data -@Schema(description = "批量分配岗位权限DTO") public class BatchAssignPositionPermissionDTO { /** * 岗位ID */ - @Schema(description = "岗位ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "岗位ID不能为空") private Long positionId; /** * 权限ID列表(对应 sys_permission.id) */ - @Schema(description = "权限ID列表", example = "[1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "权限ID列表不能为空") private List permissionIds; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/plan/controller/PlanController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/plan/controller/PlanController.java index a8116d19..3cfccfc9 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/plan/controller/PlanController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/plan/controller/PlanController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sub.plan.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -19,7 +16,6 @@ import top.xyquan.ecomdmbbackend.modules.sub.plan.service.PlanService; /** * 套餐管理控制器 */ -@Tag(name = "订阅-套餐管理", description = "套餐的增删改查接口") @RestController @RequestMapping("/api/plan") public class PlanController { @@ -30,7 +26,6 @@ public class PlanController { this.planService = planService; } - @Operation(summary = "创建套餐", description = "创建新的订阅套餐") @PostMapping("/create") @RequirePermission(value = "sys:company:manage", description = "创建套餐", allowSuper = true) public ApiResponse createPlan(@Valid @RequestBody CreatePlanDTO createPlanDTO) { @@ -38,7 +33,6 @@ public class PlanController { return ApiResponse.success("套餐创建成功", planVO); } - @Operation(summary = "更新套餐", description = "更新现有套餐信息") @PutMapping("/update/{planId}") @RequirePermission(value = "sys:company:manage", description = "更新套餐", allowSuper = true) public ApiResponse updatePlan(@Valid @RequestBody UpdatePlanDTO updatePlanDTO, @@ -47,16 +41,14 @@ public class PlanController { return ApiResponse.success("套餐更新成功", planVO); } - @Operation(summary = "删除套餐", description = "删除指定套餐") @DeleteMapping("/delete/{planId}") @RequirePermission(value = "sys:company:manage", description = "删除套餐", allowSuper = true) public ApiResponse deletePlan( - @Parameter(description = "套餐ID") @PathVariable Long planId) { +@PathVariable Long planId) { planService.deletePlan(planId); return ApiResponse.success("套餐删除成功"); } - @Operation(summary = "分页获取套餐列表", description = "分页获取套餐列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "sys:company:manage", description = "查询套餐列表", allowSuper = true) public ApiResponse> getPlanPage( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/plan/pricing/controller/PlanPricingController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/plan/pricing/controller/PlanPricingController.java index 7d810972..b29d8287 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/plan/pricing/controller/PlanPricingController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/plan/pricing/controller/PlanPricingController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sub.plan.pricing.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -19,7 +16,6 @@ import top.xyquan.ecomdmbbackend.modules.sub.plan.pricing.service.PlanPricingSer /** * 套餐定价管理控制器 */ -@Tag(name = "订阅-套餐定价管理", description = "套餐定价的增删改查接口") @RestController @RequestMapping("/api/plan-pricing") public class PlanPricingController { @@ -30,7 +26,6 @@ public class PlanPricingController { this.planPricingService = planPricingService; } - @Operation(summary = "创建定价", description = "创建新的套餐定价") @PostMapping("/create") @RequirePermission(value = "system:company:manage", description = "创建定价", allowSuper = true) public ApiResponse createPlanPricing(@Valid @RequestBody CreatePlanPricingDTO createPlanPricingDTO) { @@ -38,7 +33,6 @@ public class PlanPricingController { return ApiResponse.success("套餐定价创建成功", planPricingVO); } - @Operation(summary = "更新定价", description = "更新现有定价信息") @PutMapping("/update/{id}") @RequirePermission(value = "system:company:manage", description = "更新定价", allowSuper = true) public ApiResponse updatePlanPricing(@Valid @RequestBody UpdatePlanPricingDTO updatePlanPricingDTO, @@ -47,16 +41,14 @@ public class PlanPricingController { return ApiResponse.success("套餐定价更新成功", planPricingVO); } - @Operation(summary = "删除定价", description = "删除指定定价") @DeleteMapping("/delete/{id}") @RequirePermission(value = "system:company:manage", description = "删除定价", allowSuper = true) public ApiResponse deletePlanPricing( - @Parameter(description = "定价ID") @PathVariable Long id) { +@PathVariable Long id) { planPricingService.deletePlanPricing(id); return ApiResponse.success("套餐定价删除成功"); } - @Operation(summary = "分页获取定价列表", description = "分页获取定价列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "system:company:manage", description = "查询定价列表", allowSuper = true) public ApiResponse> getPlanPricingPage( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/subscription/controller/SubscriptionController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/subscription/controller/SubscriptionController.java index a1180d79..c9590f17 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/subscription/controller/SubscriptionController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sub/subscription/controller/SubscriptionController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sub.subscription.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -19,7 +16,6 @@ import top.xyquan.ecomdmbbackend.modules.sub.subscription.service.SubscriptionSe /** * 订阅管理控制器 */ -@Tag(name = "订阅-订阅管理", description = "订阅的增删改查接口") @RestController @RequestMapping("/api/subscription") public class SubscriptionController { @@ -30,7 +26,6 @@ public class SubscriptionController { this.subscriptionService = subscriptionService; } - @Operation(summary = "创建订阅", description = "创建新的订阅记录") @PostMapping("/create") @RequirePermission(value = "sys:company:manage", description = "创建订阅", allowSuper = true) public ApiResponse createSubscription( @@ -39,7 +34,6 @@ public class SubscriptionController { return ApiResponse.success("订阅创建成功", subscriptionVO); } - @Operation(summary = "更新订阅", description = "更新现有订阅信息") @PutMapping("/update/{id}") @RequirePermission(value = "sys:company:manage", description = "更新订阅", allowSuper = true) public ApiResponse updateSubscription( @@ -49,16 +43,14 @@ public class SubscriptionController { return ApiResponse.success("订阅更新成功", subscriptionVO); } - @Operation(summary = "删除订阅", description = "删除指定订阅") @DeleteMapping("/delete/{id}") @RequirePermission(value = "sys:company:manage", description = "删除订阅", allowSuper = true) public ApiResponse deleteSubscription( - @Parameter(description = "订阅ID") @PathVariable Long id) { +@PathVariable Long id) { subscriptionService.deleteSubscription(id); return ApiResponse.success("订阅删除成功"); } - @Operation(summary = "分页获取订阅列表", description = "分页获取订阅列表,支持条件过滤") @PostMapping("/list") @RequirePermission(value = "sys:company:manage", description = "查询订阅列表", allowSuper = true) public ApiResponse> getSubscriptionPage( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/controller/AuthController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/controller/AuthController.java index dda72569..7a0be8c3 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/controller/AuthController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/controller/AuthController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.auth.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.response.ApiResponse; @@ -18,7 +16,6 @@ import java.util.List; /** * 认证控制器 */ -@Tag(name = "系统-认证管理", description = "用户注册、登录等认证相关接口") @RestController @RequestMapping("/api/auth") public class AuthController { @@ -33,35 +30,30 @@ public class AuthController { this.currentUserContext = currentUserContext; } - @Operation(summary = "用户注册", description = "用户注册接口,支持通过登录账号或手机号码注册") @PostMapping("/register") public ApiResponse register(@Valid @RequestBody RegisterDTO registerDTO) { LoginVO loginVO = userService.register(registerDTO); return ApiResponse.success("用户注册成功", loginVO); } - @Operation(summary = "用户登录", description = "用户登录接口,支持通过登录账号或手机号码登录") @PostMapping("/login") public ApiResponse login(@Valid @RequestBody LoginDTO loginDTO) { LoginVO loginVO = userService.login(loginDTO); return ApiResponse.success("用户登录成功", loginVO); } - @Operation(summary = "刷新访问令牌", description = "使用刷新令牌获取新的访问令牌") @PostMapping("/refresh") public ApiResponse refreshToken(@Valid @RequestBody RefreshTokenDTO refreshTokenDTO) { LoginVO loginVO = userService.refreshToken(refreshTokenDTO); return ApiResponse.success("令牌刷新成功", loginVO); } - @Operation(summary = "切换公司", description = "切换当前登录公司上下文并重新签发 token") @PostMapping("/switch-company/{companyId}") public ApiResponse switchCompany(@PathVariable Long companyId) { LoginVO loginVO = userService.switchCompany(companyId); return ApiResponse.success("切换公司成功", loginVO); } - @Operation(summary = "获取用户权限码", description = "获取当前登录用户的权限码列表") @GetMapping("/codes") public ApiResponse> getAccessCodes() { try { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/controller/SuperAuthController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/controller/SuperAuthController.java index 0832d23b..176b8817 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/controller/SuperAuthController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/controller/SuperAuthController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.auth.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -15,7 +12,6 @@ import top.xyquan.ecomdmbbackend.modules.sys.user.service.UserService; /** * 超级管理员认证控制器 */ -@Tag(name = "超级管理员-认证管理", description = "超级管理员专属认证相关接口") @RestController @RequestMapping("/api/super/auth") public class SuperAuthController { @@ -29,12 +25,11 @@ public class SuperAuthController { /** * 切换账户:以目标用户在指定公司下的身份登录,Token.super 保持为 true */ - @Operation(summary = "切换账户", description = "超级管理员切换到指定用户在指定公司下的账户上下文,超管标识保持不变") @PostMapping("/switch/company/{companyId}/user/{userId}") @RequireRole(allowCompany = false, allowUser = false, description = "切换账户") public ApiResponse switchAccount( - @Parameter(description = "目标公司ID") @PathVariable Long companyId, - @Parameter(description = "目标用户ID") @PathVariable Long userId) { +@PathVariable Long companyId, +@PathVariable Long userId) { LoginVO loginVO = userService.switchAccount(userId, companyId); return ApiResponse.success("账户切换成功", loginVO); } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/model/dto/RefreshTokenDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/model/dto/RefreshTokenDTO.java index 4e96956c..b6da0c27 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/model/dto/RefreshTokenDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/auth/model/dto/RefreshTokenDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.auth.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -8,10 +7,8 @@ import lombok.Data; * 刷新令牌请求DTO */ @Data -@Schema(description = "刷新令牌请求") public class RefreshTokenDTO { @NotBlank(message = "刷新令牌不能为空") - @Schema(description = "刷新令牌", example = "eyJhbGciOiJIUzUxMiJ9...") private String refreshToken; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/controller/SysFileController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/controller/SysFileController.java index 0d75ede6..897db9a3 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/controller/SysFileController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/controller/SysFileController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -23,7 +21,6 @@ import java.util.List; /** * 系统文件管理控制器 */ -@Tag(name = "系统-文件管理", description = "文件上传和管理相关接口") @RestController @RequestMapping("/api/sys/file") public class SysFileController { @@ -34,42 +31,36 @@ public class SysFileController { this.sysFileService = sysFileService; } - @Operation(summary = "批量上传文件", description = "批量上传文件到服务器(仅用于本地存储)") @PostMapping("/batch-upload") public ApiResponse> batchUploadFiles(@RequestParam("files") List files) { List result = sysFileService.batchUploadFiles(files); return ApiResponse.success("文件批量上传成功", result); } - @Operation(summary = "批量获取Header签名", description = "批量获取OSS文件上传Header签名(V1签名方式,HMAC-SHA1),如果文件已存在则返回文件信息") @PostMapping("/batch-sign-url") public ApiResponse batchSignUrl(@Valid @RequestBody BatchSignUrlDTO dto) { BatchSignUrlVO result = sysFileService.batchSignUrl(dto); return ApiResponse.success("获取批量签名URL成功", result); } - @Operation(summary = "批量创建OSS文件记录", description = "前端上传OSS文件成功后,批量创建文件记录") @PostMapping("/batch-create-oss") public ApiResponse> batchCreateOssFiles(@Valid @RequestBody BatchCreateOssFileDTO dto) { List result = sysFileService.batchCreateOssFiles(dto); return ApiResponse.success("创建OSS文件记录成功", result); } - @Operation(summary = "获取文件访问URL", description = "通过文件ID获取文件访问URL") @GetMapping("/{fileId}/access-url") public ApiResponse getFileAccessUrl(@PathVariable Long fileId) { String accessUrl = sysFileService.getFileAccessUrl(fileId); return ApiResponse.success("获取文件访问URL成功", accessUrl); } - @Operation(summary = "分页获取文件列表", description = "分页获取当前公司的文件列表,支持条件过滤") @PostMapping("/list") public ApiResponse> getFilePage(@Valid @RequestBody PageQueryDTO pageQueryDTO) { PageResultVO result = sysFileService.getFilePage(pageQueryDTO); return ApiResponse.success("获取文件列表成功", result); } - @Operation(summary = "删除文件") @DeleteMapping("/{fileId}") @RequireRole(description = "删除文件") public ApiResponse deleteFile(@PathVariable Long fileId) { @@ -77,7 +68,6 @@ public class SysFileController { return ApiResponse.success("文件删除成功"); } - @Operation(summary = "更新文件元信息") @PutMapping("/{fileId}") @RequireRole(description = "更新文件") public ApiResponse updateFile(@PathVariable Long fileId, @Valid @RequestBody SysFileUpdateDTO dto) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchCreateOssFileDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchCreateOssFileDTO.java index dc5ce737..57d6bc8e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchCreateOssFileDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchCreateOssFileDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotEmpty; import lombok.Data; @@ -11,13 +10,11 @@ import java.util.List; * 批量创建OSS文件记录DTO */ @Data -@Schema(description = "批量创建OSS文件记录DTO") public class BatchCreateOssFileDTO { /** * 文件列表 */ - @Schema(description = "文件列表", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "文件列表不能为空") private List files; @@ -25,57 +22,48 @@ public class BatchCreateOssFileDTO { * 文件项 */ @Data - @Schema(description = "文件项") public static class FileItem { /** * 文件名 */ - @Schema(description = "文件名", example = "example.jpg", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "文件名不能为空") private String filename; /** * 文件哈希值 */ - @Schema(description = "文件哈希值", example = "abc123def456", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "文件哈希值不能为空") private String fileHash; /** * 存储路径/Key */ - @Schema(description = "存储路径/Key", example = "uploads/2024/01/abc123def456.jpg", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "存储路径不能为空") private String storagePath; /** * 文件大小(字节) */ - @Schema(description = "文件大小(字节)", example = "102400") private Long fileSize; /** * MIME类型 */ - @Schema(description = "MIME类型", example = "image/jpeg") private String mimeType; /** * 文件分类(可选) */ - @Schema(description = "文件分类", example = "image") private String category; /** * 标签(可选) */ - @Schema(description = "标签", example = "logo,品牌") private String tags; /** * 备注(可选) */ - @Schema(description = "备注", example = "公司Logo") private String remark; } } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchSignUrlDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchSignUrlDTO.java index 8829f666..a7ff85ca 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchSignUrlDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchSignUrlDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotEmpty; import lombok.Data; @@ -11,13 +10,11 @@ import java.util.List; * 批量URL签名DTO */ @Data -@Schema(description = "批量URL签名DTO") public class BatchSignUrlDTO { /** * 文件列表 */ - @Schema(description = "文件列表", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "文件列表不能为空") private List files; @@ -25,19 +22,16 @@ public class BatchSignUrlDTO { * 文件项 */ @Data - @Schema(description = "文件项") public static class FileItem { /** * 文件名 */ - @Schema(description = "文件名", example = "example.jpg", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "文件名不能为空") private String filename; /** * 文件哈希值 */ - @Schema(description = "文件哈希值", example = "abc123def456", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "文件哈希值不能为空") private String fileHash; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchUploadFileDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchUploadFileDTO.java index c656f3b3..6c45f4bc 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchUploadFileDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/BatchUploadFileDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotEmpty; import lombok.Data; @@ -11,13 +10,11 @@ import java.util.List; * 批量上传文件DTO */ @Data -@Schema(description = "批量上传文件DTO") public class BatchUploadFileDTO { /** * 文件列表 */ - @Schema(description = "文件列表", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "文件列表不能为空") private List files; @@ -25,38 +22,32 @@ public class BatchUploadFileDTO { * 文件项 */ @Data - @Schema(description = "文件项") public static class FileItem { /** * 文件名 */ - @Schema(description = "文件名", example = "example.jpg", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "文件名不能为空") private String filename; /** * 文件哈希值 */ - @Schema(description = "文件哈希值", example = "abc123def456", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "文件哈希值不能为空") private String fileHash; /** * 文件分类(可选) */ - @Schema(description = "文件分类", example = "image") private String category; /** * 标签(可选) */ - @Schema(description = "标签", example = "logo,品牌") private String tags; /** * 备注(可选) */ - @Schema(description = "备注", example = "公司Logo") private String remark; } } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/SysFileFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/SysFileFilterDTO.java index 21421d3b..11fa5afb 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/SysFileFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/SysFileFilterDTO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,49 +8,41 @@ import java.time.LocalDateTime; * 系统文件分页查询过滤DTO */ @Data -@Schema(description = "系统文件分页查询过滤DTO") public class SysFileFilterDTO { /** * 文件名(模糊查询) */ - @Schema(description = "文件名(模糊查询)", example = "logo") private String filename; /** * 文件格式(精准查询) */ - @Schema(description = "文件格式(精准查询)", example = "jpg") private String fileFormat; /** * 存储类型(精准查询) */ - @Schema(description = "存储类型(精准查询)", example = "oss", allowableValues = {"local", "oss", "s3", "qiniu", "cos"}) private String storageType; /** * 文件分类(精准查询) */ - @Schema(description = "文件分类(精准查询)", example = "image") private String category; /** * 标签(模糊查询) */ - @Schema(description = "标签(模糊查询)", example = "logo") private String tags; /** * 上传时间范围-开始时间 */ - @Schema(description = "上传时间范围-开始时间", example = "2024-01-01T00:00:00") private LocalDateTime startUploadTime; /** * 上传时间范围-结束时间 */ - @Schema(description = "上传时间范围-结束时间", example = "2024-12-31T23:59:59") private LocalDateTime endUploadTime; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/SysFileUpdateDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/SysFileUpdateDTO.java index 59484946..e7ec799a 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/SysFileUpdateDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/dto/SysFileUpdateDTO.java @@ -1,18 +1,14 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 更新文件元信息DTO */ @Data -@Schema(description = "更新文件元信息DTO") public class SysFileUpdateDTO { - @Schema(description = "标签,多个用逗号分隔") private String tags; - @Schema(description = "描述/备注") private String remark; } \ No newline at end of file diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/BatchSignUrlVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/BatchSignUrlVO.java index 629f7fb4..781adb92 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/BatchSignUrlVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/BatchSignUrlVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; @@ -10,43 +9,31 @@ import java.util.Map; * 批量Header签名响应VO(Header签名) */ @Data -@Schema(description = "批量Header签名响应VO(Header签名)") public class BatchSignUrlVO { - @Schema(description = "文件信息列表") private List files; /** * 文件签名信息 */ @Data - @Schema(description = "文件签名信息") public static class FileSignInfo { - @Schema(description = "文件名", example = "example.jpg") private String filename; - @Schema(description = "文件哈希值", example = "abc123def456") private String fileHash; - @Schema(description = "文件ID(如果文件已存在)", example = "1") private Long fileId; - @Schema(description = "是否已存在", example = "true") private Boolean exists; - @Schema(description = "上传URL(如果文件不存在,不含签名参数)", example = "https://bucket.oss-cn-hangzhou.aliyuncs.com/uploads/2024/01/file.jpg") private String uploadUrl; - @Schema(description = "上传所需的Header签名信息(如果文件不存在,包含Authorization、Date、x-oss-date、Content-Type等)", example = "{\"Authorization\":\"OSS xxx:xxx\",\"Date\":\"Mon, 01 Jan 2024 00:00:00 GMT\",\"x-oss-date\":\"Mon, 01 Jan 2024 00:00:00 GMT\",\"Content-Type\":\"image/jpeg\"}") private Map uploadHeaders; - @Schema(description = "存储路径/Key(如果文件不存在,用于前端创建文件记录时使用)", example = "uploads/2024/01/abc123def456.jpg") private String storagePath; - @Schema(description = "访问URL(如果文件已存在,临时签名URL)", example = "https://oss.example.com/file.jpg?signature=xxx") private String accessUrl; - @Schema(description = "文件信息(如果文件已存在)") private SysFileVO fileInfo; } } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/OssPostPolicyVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/OssPostPolicyVO.java index 420e0af2..ad26c23d 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/OssPostPolicyVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/OssPostPolicyVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Map; @@ -9,16 +8,12 @@ import java.util.Map; * OSS Header签名信息VO(V1签名方式) */ @Data -@Schema(description = "OSS Header签名信息VO(V1签名方式)") public class OssPostPolicyVO { - @Schema(description = "OSS上传URL(不含签名参数,前端需要使用Header签名上传)", example = "https://your-bucket.oss-cn-hangzhou.aliyuncs.com/uploads/2024/01/file.jpg") private String url; - @Schema(description = "存储路径/Key", example = "uploads/2024/01/file.jpg") private String key; - @Schema(description = "上传所需的Header签名信息(包含Authorization、Date、x-oss-date、Content-Type等)", example = "{\"Authorization\":\"OSS xxx:xxx\",\"Date\":\"Mon, 01 Jan 2024 00:00:00 GMT\",\"x-oss-date\":\"Mon, 01 Jan 2024 00:00:00 GMT\",\"Content-Type\":\"image/jpeg\"}") private Map headers; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/SysFileUploadVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/SysFileUploadVO.java index 92cf3baa..9696adbd 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/SysFileUploadVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/SysFileUploadVO.java @@ -1,49 +1,35 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 文件上传响应VO(不包含敏感信息) */ @Data -@Schema(description = "文件上传响应VO") public class SysFileUploadVO { - @Schema(description = "文件ID", example = "1") private Long id; - @Schema(description = "存储类型", example = "local") private String storageType; - @Schema(description = "存储路径/Key", example = "./uploads/2024/01/file.jpg") private String storagePath; - @Schema(description = "原始文件名", example = "example.jpg") private String filename; - @Schema(description = "文件格式", example = "jpg") private String fileFormat; - @Schema(description = "MIME类型", example = "image/jpeg") private String mimeType; - @Schema(description = "文件大小(字节)", example = "102400") private Long fileSize; - @Schema(description = "文件哈希值", example = "abc123def456") private String fileHash; - @Schema(description = "文件分类", example = "image") private String category; - @Schema(description = "标签", example = "logo,品牌") private String tags; - @Schema(description = "文件描述", example = "公司Logo") private String remark; - @Schema(description = "访问URL(临时签名URL,仅OSS存储)", example = "https://example.com/file.jpg?signature=xxx") private String accessUrl; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/SysFileVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/SysFileVO.java index 15f2e69d..87eaf0bd 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/SysFileVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/file/model/vo/SysFileVO.java @@ -1,6 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.file.model.vo; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -9,58 +8,40 @@ import java.time.LocalDateTime; * 系统文件VO */ @Data -@Schema(description = "系统文件VO") public class SysFileVO { - @Schema(description = "文件ID", example = "1") private Long id; - @Schema(description = "公司ID", example = "1") private Long companyId; - @Schema(description = "存储类型", example = "oss") private String storageType; - @Schema(description = "存储路径/Key", example = "uploads/2024/01/file.jpg") private String storagePath; - @Schema(description = "原始文件名", example = "example.jpg") private String filename; - @Schema(description = "文件格式", example = "jpg") private String fileFormat; - @Schema(description = "MIME类型", example = "image/jpeg") private String mimeType; - @Schema(description = "文件大小(字节)", example = "102400") private Long fileSize; - @Schema(description = "文件哈希值", example = "abc123def456") private String fileHash; - @Schema(description = "文件分类", example = "image") private String category; - @Schema(description = "标签", example = "logo,品牌") private String tags; - @Schema(description = "文件描述", example = "公司Logo") private String remark; - @Schema(description = "上传人ID", example = "1") private Long uploadBy; - @Schema(description = "上传时间", example = "2024-01-01T10:00:00") private LocalDateTime uploadTime; - @Schema(description = "更新时间", example = "2024-01-01T10:00:00") private LocalDateTime updateTime; - @Schema(description = "更新人ID", example = "1") private Long updateBy; - @Schema(description = "访问URL(临时签名URL)", example = "https://example.com/file.jpg?signature=xxx") private String accessUrl; } diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/license/controller/SystemLicenseController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/license/controller/SystemLicenseController.java index b11811e6..effad01e 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/license/controller/SystemLicenseController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/license/controller/SystemLicenseController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.license.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -20,7 +18,6 @@ import top.xyquan.ecomdmbbackend.modules.sys.license.service.LicenseService; /** * 系统设置 - 授权管理 API(已登录) */ -@Tag(name = "系统-授权管理", description = "机器指纹查看与 License 激活/续期") @RestController @RequestMapping("/api/system") public class SystemLicenseController { @@ -31,14 +28,12 @@ public class SystemLicenseController { this.licenseService = licenseService; } - @Operation(summary = "获取当前授权信息") @GetMapping("/license") @RequirePermission(value = "sys:license:read", description = "查看授权信息") public ApiResponse getLicense() { return ApiResponse.success(licenseService.getLicenseSummary()); } - @Operation(summary = "激活/更新授权 License") @PutMapping("/license") @RequirePermission(value = "sys:license:manage", description = "激活或更新授权") public ApiResponse updateLicense(@Valid @RequestBody ActivateLicenseDTO dto) { @@ -46,7 +41,6 @@ public class SystemLicenseController { return ApiResponse.success("授权更新成功", summary); } - @Operation(summary = "激活授权 License") @PostMapping("/license/activate") @RequirePermission(value = "sys:license:manage", description = "激活授权") public ApiResponse activateLicense(@Valid @RequestBody ActivateLicenseDTO dto) { @@ -54,7 +48,6 @@ public class SystemLicenseController { return ApiResponse.success("授权激活成功", summary); } - @Operation(summary = "获取本机机器指纹") @GetMapping("/fingerprint") @RequirePermission(value = "sys:license:read", description = "查看机器指纹") public ApiResponse fingerprint() { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/menu/controller/MenuController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/menu/controller/MenuController.java index 2f53f8e3..0d5a9d18 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/menu/controller/MenuController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/menu/controller/MenuController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.menu.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -18,7 +15,6 @@ import java.util.List; /** * 菜单管理控制器 */ -@Tag(name = "系统-菜单管理", description = "菜单的增删改查接口") @RestController @RequestMapping("/api/menu") public class MenuController { @@ -29,7 +25,6 @@ public class MenuController { this.menuService = menuService; } - @Operation(summary = "创建菜单", description = "创建新的菜单") @PostMapping("/create") @RequirePermission(value = "sys:menu:create", description = "创建菜单", allowSuper = true) public ApiResponse createMenu(@Valid @RequestBody CreateMenuDTO createMenuDTO) { @@ -37,7 +32,6 @@ public class MenuController { return ApiResponse.success("菜单创建成功", menuVO); } - @Operation(summary = "更新菜单", description = "更新现有菜单信息") @PutMapping("/update/{id}") @RequirePermission(value = "sys:menu:update", description = "更新菜单", allowSuper = true) public ApiResponse updateMenu(@Valid @RequestBody UpdateMenuDTO updateMenuDTO, @@ -46,16 +40,14 @@ public class MenuController { return ApiResponse.success("菜单更新成功", menuVO); } - @Operation(summary = "删除菜单", description = "删除指定菜单") @DeleteMapping("/delete/{id}") @RequirePermission(value = "sys:menu:delete", description = "删除菜单", allowSuper = true) public ApiResponse deleteMenu( - @Parameter(description = "菜单ID") @PathVariable Long id) { +@PathVariable Long id) { menuService.deleteMenu(id); return ApiResponse.success("菜单删除成功"); } - @Operation(summary = "获取菜单树", description = "获取完整的菜单树结构") @GetMapping("/tree") @RequirePermission(value = "sys:menu:read", description = "获取菜单树", allowSuper = true) public ApiResponse> getMenuTree() { @@ -63,7 +55,6 @@ public class MenuController { return ApiResponse.success("获取菜单树成功", menuTree); } - @Operation(summary = "获取所有菜单", description = "获取所有菜单的列表") @GetMapping("/list") @RequirePermission(value = "sys:menu:read", description = "获取所有菜单", allowSuper = true) public ApiResponse> getAllMenus() { @@ -71,16 +62,14 @@ public class MenuController { return ApiResponse.success("获取菜单列表成功", menuList); } - @Operation(summary = "获取菜单详情", description = "根据ID获取菜单详细信息") @GetMapping("/detail/{id}") @RequirePermission(value = "sys:menu:read", description = "获取菜单详情", allowSuper = true) public ApiResponse getMenuDetail( - @Parameter(description = "菜单ID") @PathVariable Long id) { +@PathVariable Long id) { MenuVO menuVO = menuService.getMenuDetail(id); return ApiResponse.success("获取菜单详情成功", menuVO); } - @Operation(summary = "批量菜单排序", description = "批量更新菜单的排序值") @PostMapping("/batch-sort") @RequirePermission(value = "sys:menu:update", description = "批量菜单排序", allowSuper = true) public ApiResponse batchSortMenu(@Valid @RequestBody BatchSortMenuDTO batchSortMenuDTO) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/menu/permission/controller/MenuPermissionController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/menu/permission/controller/MenuPermissionController.java index 0cbe76a5..267f8a01 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/menu/permission/controller/MenuPermissionController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/menu/permission/controller/MenuPermissionController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.menu.permission.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -11,11 +9,9 @@ import top.xyquan.ecomdmbbackend.modules.sys.menu.permission.model.dto.RemoveMen import top.xyquan.ecomdmbbackend.modules.sys.menu.permission.model.vo.MenuPermissionVO; import top.xyquan.ecomdmbbackend.modules.sys.menu.permission.service.MenuPermissionService; - /** * 菜单权限映射控制器 */ -@Tag(name = "系统-菜单权限映射管理", description = "菜单权限映射的增删接口") @RestController @RequestMapping("/api/menu-permission") public class MenuPermissionController { @@ -26,7 +22,6 @@ public class MenuPermissionController { this.menuPermissionService = menuPermissionService; } - @Operation(summary = "添加菜单权限映射", description = "为指定菜单添加权限映射") @PostMapping("/add") @RequirePermission(value = "system:menu:update", description = "添加菜单权限映射", allowSuper = true) public ApiResponse addMenuPermission(@Valid @RequestBody AddMenuPermissionDTO addMenuPermissionDTO) { @@ -34,7 +29,6 @@ public class MenuPermissionController { return ApiResponse.success("菜单权限映射添加成功", menuPermissionVO); } - @Operation(summary = "删除菜单权限映射", description = "删除指定菜单的权限映射") @PostMapping("/remove") @RequirePermission(value = "system:menu:update", description = "删除菜单权限映射", allowSuper = true) public ApiResponse removeMenuPermission(@Valid @RequestBody RemoveMenuPermissionDTO removeMenuPermissionDTO) { diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/permission/controller/PermissionController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/permission/controller/PermissionController.java index 9b6fa9f5..7a8d34e8 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/permission/controller/PermissionController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/permission/controller/PermissionController.java @@ -1,8 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.permission.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import top.xyquan.ecomdmbbackend.common.annotation.RequirePermission; @@ -22,7 +19,6 @@ import java.util.List; /** * 权限码管理控制器 */ -@Tag(name = "系统-权限码管理", description = "权限码的增删改查接口") @RestController @RequestMapping("/api/permission") public class PermissionController { @@ -35,7 +31,6 @@ public class PermissionController { this.currentUserContext = currentUserContext; } - @Operation(summary = "创建权限", description = "创建新的权限") @PostMapping("/create") @RequirePermission(value = "sys:permission:manage", description = "创建权限", allowSuper = true) public ApiResponse createPermission(@Valid @RequestBody CreatePermissionDTO createPermissionDTO) { @@ -43,7 +38,6 @@ public class PermissionController { return ApiResponse.success("权限创建成功", permissionVO); } - @Operation(summary = "更新权限", description = "更新现有权限信息") @PutMapping("/update/{id}") @RequirePermission(value = "sys:permission:manage", description = "更新权限", allowSuper = true) public ApiResponse updatePermission(@Valid @RequestBody UpdatePermissionDTO updatePermissionDTO, @@ -52,16 +46,14 @@ public class PermissionController { return ApiResponse.success("权限更新成功", permissionVO); } - @Operation(summary = "删除权限", description = "删除指定权限") @DeleteMapping("/delete/{id}") @RequirePermission(value = "sys:permission:manage", description = "删除权限", allowSuper = true) public ApiResponse deletePermission( - @Parameter(description = "权限ID") @PathVariable Long id) { +@PathVariable Long id) { permissionService.deletePermission(id); return ApiResponse.success("权限删除成功"); } - @Operation(summary = "分页获取权限列表", description = "根据条件分页获取权限列表") @PostMapping("/list") @RequirePermission(value = "sys:permission:read", description = "查询权限列表", allowSuper = true) public ApiResponse> getPermissionPage( @@ -70,16 +62,14 @@ public class PermissionController { return ApiResponse.success("获取权限列表成功", pageResult); } - @Operation(summary = "获取权限详情", description = "根据ID获取权限详细信息") @GetMapping("/detail/{id}") @RequirePermission(value = "sys:permission:read", description = "获取权限详情", allowSuper = true) public ApiResponse getPermissionDetail( - @Parameter(description = "权限ID") @PathVariable Long id) { +@PathVariable Long id) { PermissionVO permissionVO = permissionService.getPermissionDetail(id); return ApiResponse.success("获取权限详情成功", permissionVO); } - @Operation(summary = "获取所有权限", description = "获取所有启用的权限列表") @GetMapping("/list") @RequirePermission(value = "sys:permission:read", description = "获取所有权限", allowSuper = true) public ApiResponse> getAllPermissions() { @@ -87,7 +77,6 @@ public class PermissionController { return ApiResponse.success("获取所有权限成功", permissionList); } - @Operation(summary = "获取权限树", description = "获取权限树状结构(用于前端展示)") @GetMapping("/tree") @RequirePermission(value = "sys:permission:read", description = "获取权限树", allowSuper = true) public ApiResponse> getPermissionTree() { @@ -95,7 +84,6 @@ public class PermissionController { return ApiResponse.success("获取权限树成功", tree); } - @Operation(summary = "获取公司可见的权限树", description = "只返回当前用户所属公司的已分配权限及其祖先节点") @GetMapping("/tree/company") @RequirePermission(value = "sys:permission:read", description = "获取公司可见权限树", allowSuper = true) public ApiResponse> getCompanyVisiblePermissionTree() { @@ -104,16 +92,14 @@ public class PermissionController { return ApiResponse.success("获取公司可见权限树成功", tree); } - @Operation(summary = "获取职位可见的权限树", description = "只返回已分配权限及其祖先节点") @GetMapping("/tree/position/{positionId}") @RequirePermission(value = "sys:permission:read", description = "获取职位可见权限树", allowSuper = true) public ApiResponse> getPositionVisiblePermissionTree( - @Parameter(description = "职位ID") @PathVariable Long positionId) { +@PathVariable Long positionId) { List tree = permissionService.getPositionVisiblePermissionTree(positionId); return ApiResponse.success("获取职位可见权限树成功", tree); } - @Operation(summary = "获取系统权限树", description = "返回全量权限树(整个平台的权限,用于平台超管管理)") @GetMapping("/system/tree") @RequirePermission(value = "sys:permission:read", description = "获取系统权限树", allowSuper = true) public ApiResponse> getSystemPermissionTree() { @@ -121,7 +107,6 @@ public class PermissionController { return ApiResponse.success("获取系统权限树成功", tree); } - @Operation(summary = "批量更新权限排序") @PutMapping("/sort") @RequirePermission(value = "sys:permission:update", description = "批量更新权限排序", allowSuper = true) public ApiResponse batchSortPermission( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/user/controller/UserController.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/user/controller/UserController.java index 25eb4864..1741aa55 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/user/controller/UserController.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/user/controller/UserController.java @@ -1,7 +1,5 @@ package top.xyquan.ecomdmbbackend.modules.sys.user.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -24,7 +22,6 @@ import java.util.List; /** * 用户管理控制器 */ -@Tag(name = "系统-用户管理", description = "用户信息管理相关接口") @RestController @RequestMapping("/api/user") public class UserController { @@ -37,21 +34,18 @@ public class UserController { this.userMenuService = userMenuService; } - @Operation(summary = "获取用户信息", description = "获取当前登录用户的详细信息") @GetMapping("/info") public ApiResponse getUserInfo() { UserVO userVO = userService.getCurrentUserInfo(); return ApiResponse.success("获取用户信息成功", userVO); } - @Operation(summary = "获取可用公司列表", description = "获取当前用户可切换的可用公司列表") @GetMapping("/companies") public ApiResponse> getAvailableCompanies() { List companies = userService.getAvailableCompanies(); return ApiResponse.success("获取可用公司列表成功", companies); } - @Operation(summary = "更新用户信息", description = "更新当前登录用户的基本信息") @PutMapping("/info") @RequirePermission(value = "sys:user:update", description = "更新用户信息", allowSuper = true) public ApiResponse updateUserInfo(@Valid @RequestBody UpdateUserInfoDTO updateUserInfoDTO) { @@ -59,14 +53,12 @@ public class UserController { return ApiResponse.success("用户信息更新成功", userVO); } - @Operation(summary = "修改密码", description = "修改当前登录用户的密码") @PostMapping("/change-password") public ApiResponse changePassword(@Valid @RequestBody ChangePasswordDTO changePasswordDTO) { userService.changePassword(changePasswordDTO); return ApiResponse.success("密码修改成功"); } - @Operation(summary = "上传用户头像", description = "上传用户头像图片") @PostMapping("/upload-avatar") @RequirePermission(value = "sys:user:update", description = "上传用户头像", allowSuper = true) public ApiResponse uploadAvatar(@RequestParam("file") MultipartFile file) { @@ -79,14 +71,12 @@ public class UserController { return ApiResponse.success("头像上传成功", userVO); } - @Operation(summary = "获取用户菜单", description = "根据用户角色获取对应的菜单,用于前端动态路由") @GetMapping("/menu") public ApiResponse> getUserMenus() { List userMenuVOS = userMenuService.getUserMenus(); return ApiResponse.success("获取用户菜单成功", userMenuVOS); } - @Operation(summary = "分页查询用户列表", description = "分页查询用户列表,支持多种过滤条件") @PostMapping("/list") @RequirePermission(value = "sys:user:read", description = "查询用户列表", allowSuper = true) public ApiResponse> getUserPage( diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/user/model/dto/UserFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/user/model/dto/UserFilterDTO.java index 0cb0b59f..8bc21eef 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/user/model/dto/UserFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/sys/user/model/dto/UserFilterDTO.java @@ -1,60 +1,50 @@ package top.xyquan.ecomdmbbackend.modules.sys.user.model.dto; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** * 用户分页查询过滤DTO */ @Data -@Schema(description = "用户分页查询过滤DTO") public class UserFilterDTO { /** * 用户名称(模糊查询) */ - @Schema(description = "用户名称(模糊查询)", example = "张") private String realName; /** * 登录账号(模糊查询) */ - @Schema(description = "登录账号(模糊查询)", example = "admin") private String loginCode; /** * 手机号码(精确查询) */ - @Schema(description = "手机号码(精确查询)", example = "13800138000") private String phone; /** * 是否超级管理员 (0-否 1-是) */ - @Schema(description = "是否超级管理员", example = "0", allowableValues = { "0", "1" }) private Integer isSuper; /** * 公司ID */ - @Schema(description = "公司ID", example = "1") private Long companyId; /** * 部门ID */ - @Schema(description = "部门ID", example = "1") private Long departmentId; /** * 岗位ID */ - @Schema(description = "岗位ID", example = "1") private Long positionId; /** * 状态查询 */ - @Schema(description = "用户状态", example = "0", allowableValues = { "0", "1", "2", "3" }) private Integer status; } diff --git a/ecom-dmb-backend/src/main/resources/application-dev.yml b/ecom-dmb-backend/src/main/resources/application-dev.yml index 5cc4ab87..05fe9fd2 100644 --- a/ecom-dmb-backend/src/main/resources/application-dev.yml +++ b/ecom-dmb-backend/src/main/resources/application-dev.yml @@ -29,10 +29,6 @@ mybatis-plus: # 开发环境可按需打开 SQL 日志 # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - -knife4j: - enable: true - oss: enabled: false access-key-id: LTAI5t8oyyor6wLrQasDUQA3 diff --git a/ecom-dmb-backend/src/main/resources/application-pre.yml b/ecom-dmb-backend/src/main/resources/application-pre.yml index c545dafb..103ecbd0 100644 --- a/ecom-dmb-backend/src/main/resources/application-pre.yml +++ b/ecom-dmb-backend/src/main/resources/application-pre.yml @@ -26,10 +26,6 @@ spring: jwt: secret: staging-jwt-secret-key-must-be-at-least-64-bytes-long-for-hs512-algorithm - -knife4j: - enable: true - oss: enabled: true access-key-id: LTAI5t8oyyor6wLrQasDUQA3 diff --git a/ecom-dmb-backend/src/main/resources/application-prod.yml b/ecom-dmb-backend/src/main/resources/application-prod.yml index be563d55..f4535cc1 100644 --- a/ecom-dmb-backend/src/main/resources/application-prod.yml +++ b/ecom-dmb-backend/src/main/resources/application-prod.yml @@ -27,10 +27,6 @@ spring: jwt: secret: prod-jwt-secret-key-must-be-at-least-64-bytes-long-for-hs512-algorithm-security - -knife4j: - enable: false - oss: enabled: true access-key-id: LTAI5t8oyyor6wLrQasDUQA3 diff --git a/ecom-dmb-backend/src/main/resources/application-test.yml b/ecom-dmb-backend/src/main/resources/application-test.yml index 58413c1c..9503a730 100644 --- a/ecom-dmb-backend/src/main/resources/application-test.yml +++ b/ecom-dmb-backend/src/main/resources/application-test.yml @@ -24,10 +24,6 @@ spring: jwt: secret: test-jwt-secret-key-must-be-at-least-64-bytes-long-for-hs512-algorithm - -knife4j: - enable: true - oss: enabled: false access-key-id: LTAI5t8oyyor6wLrQasDUQA3 diff --git a/ecom-dmb-backend/src/main/resources/application.yml b/ecom-dmb-backend/src/main/resources/application.yml index b1224737..7035e6e4 100644 --- a/ecom-dmb-backend/src/main/resources/application.yml +++ b/ecom-dmb-backend/src/main/resources/application.yml @@ -13,9 +13,6 @@ spring: # SSE 长连接:避免默认异步超时把 emitter 掐断(只收到 connected 后反复重连) async: request-timeout: -1 - # 配置404错误处理 - 注释掉,避免影响Swagger文档访问 - # mvc: - # throw-exception-if-no-handler-found: true web: resources: add-mappings: true @@ -109,49 +106,6 @@ mybatis-plus: configuration: map-underscore-to-camel-case: true -# OpenAPI / Knife4j -springdoc: - swagger-ui: - path: /swagger-ui.html - api-docs: - path: /v3/api-docs - packages-to-scan: top.xyquan.ecomdmbbackend.modules - group-configs: - - group: "系统模块" - paths-to-match: - - "/auth/**" - - "/menu/**" - - "/permission/**" - - "/user/**" - - "/sys/file/**" - packages-to-scan: "top.xyquan.ecomdmbbackend.modules.sys.controller" - - group: "组织模块" - paths-to-match: - - "/company/**" - - "/company-menu/**" - - "/department/**" - - "/position/**" - - "/position-menu/**" - - "/position-permission/**" - packages-to-scan: "top.xyquan.ecomdmbbackend.modules.org.controller" - - group: "订阅模块" - paths-to-match: - - "/plan/**" - - "/plan-pricing/**" - - "/subscription/**" - packages-to-scan: "top.xyquan.ecomdmbbackend.modules.sub.controller" - - group: "媒体模块" - paths-to-match: - - "/media/image/**" - - "/media/file/**" - packages-to-scan: "top.xyquan.ecomdmbbackend.modules.media.controller" - -knife4j: - enable-group: true - enable-search: true - enable-footer: false - enable-footer-custom: false - # OSS(开关与凭证见各环境配置) oss: endpoint: https://oss-cn-guangzhou.aliyuncs.com