Commit be9d670beed60fe4f50e3760c7e2298621b8a0dc
1 parent
f2adb441
feat: mp springdoc
Showing
54 changed files
with
412 additions
and
448 deletions
yudao-module-mp/yudao-module-mp-biz/pom.xml
| @@ -54,6 +54,11 @@ | @@ -54,6 +54,11 @@ | ||
| 54 | <artifactId>yudao-spring-boot-starter-security</artifactId> | 54 | <artifactId>yudao-spring-boot-starter-security</artifactId> |
| 55 | </dependency> | 55 | </dependency> |
| 56 | 56 | ||
| 57 | + <dependency> | ||
| 58 | + <groupId>org.springframework.boot</groupId> | ||
| 59 | + <artifactId>spring-boot-starter-validation</artifactId> | ||
| 60 | + </dependency> | ||
| 61 | + | ||
| 57 | <!-- DB 相关 --> | 62 | <!-- DB 相关 --> |
| 58 | <dependency> | 63 | <dependency> |
| 59 | <groupId>cn.iocoder.boot</groupId> | 64 | <groupId>cn.iocoder.boot</groupId> |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/MpAccountController.java
| @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.account.vo.*; | @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.account.vo.*; | ||
| 6 | import cn.iocoder.yudao.module.mp.convert.account.MpAccountConvert; | 6 | import cn.iocoder.yudao.module.mp.convert.account.MpAccountConvert; |
| 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; |
| 8 | import cn.iocoder.yudao.module.mp.service.account.MpAccountService; | 8 | import cn.iocoder.yudao.module.mp.service.account.MpAccountService; |
| 9 | -import io.swagger.annotations.Api; | ||
| 10 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 11 | -import io.swagger.annotations.ApiOperation; | 9 | +import io.swagger.v3.oas.annotations.Operation; |
| 10 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 11 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 12 | import org.springframework.security.access.prepost.PreAuthorize; | 12 | import org.springframework.security.access.prepost.PreAuthorize; |
| 13 | import org.springframework.validation.annotation.Validated; | 13 | import org.springframework.validation.annotation.Validated; |
| 14 | import org.springframework.web.bind.annotation.*; | 14 | import org.springframework.web.bind.annotation.*; |
| @@ -19,7 +19,7 @@ import java.util.List; | @@ -19,7 +19,7 @@ import java.util.List; | ||
| 19 | 19 | ||
| 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 21 | ||
| 22 | -@Api(tags = "管理后台 - 公众号账号") | 22 | +@Tag(name = "管理后台 - 公众号账号") |
| 23 | @RestController | 23 | @RestController |
| 24 | @RequestMapping("/mp/account") | 24 | @RequestMapping("/mp/account") |
| 25 | @Validated | 25 | @Validated |
| @@ -29,14 +29,14 @@ public class MpAccountController { | @@ -29,14 +29,14 @@ public class MpAccountController { | ||
| 29 | private MpAccountService mpAccountService; | 29 | private MpAccountService mpAccountService; |
| 30 | 30 | ||
| 31 | @PostMapping("/create") | 31 | @PostMapping("/create") |
| 32 | - @ApiOperation("创建公众号账号") | 32 | + @Operation(summary = "创建公众号账号") |
| 33 | @PreAuthorize("@ss.hasPermission('mp:account:create')") | 33 | @PreAuthorize("@ss.hasPermission('mp:account:create')") |
| 34 | public CommonResult<Long> createAccount(@Valid @RequestBody MpAccountCreateReqVO createReqVO) { | 34 | public CommonResult<Long> createAccount(@Valid @RequestBody MpAccountCreateReqVO createReqVO) { |
| 35 | return success(mpAccountService.createAccount(createReqVO)); | 35 | return success(mpAccountService.createAccount(createReqVO)); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | @PutMapping("/update") | 38 | @PutMapping("/update") |
| 39 | - @ApiOperation("更新公众号账号") | 39 | + @Operation(summary = "更新公众号账号") |
| 40 | @PreAuthorize("@ss.hasPermission('mp:account:update')") | 40 | @PreAuthorize("@ss.hasPermission('mp:account:update')") |
| 41 | public CommonResult<Boolean> updateAccount(@Valid @RequestBody MpAccountUpdateReqVO updateReqVO) { | 41 | public CommonResult<Boolean> updateAccount(@Valid @RequestBody MpAccountUpdateReqVO updateReqVO) { |
| 42 | mpAccountService.updateAccount(updateReqVO); | 42 | mpAccountService.updateAccount(updateReqVO); |
| @@ -44,8 +44,8 @@ public class MpAccountController { | @@ -44,8 +44,8 @@ public class MpAccountController { | ||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | @DeleteMapping("/delete") | 46 | @DeleteMapping("/delete") |
| 47 | - @ApiOperation("删除公众号账号") | ||
| 48 | - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | 47 | + @Operation(summary = "删除公众号账号") |
| 48 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 49 | @PreAuthorize("@ss.hasPermission('mp:account:delete')") | 49 | @PreAuthorize("@ss.hasPermission('mp:account:delete')") |
| 50 | public CommonResult<Boolean> deleteAccount(@RequestParam("id") Long id) { | 50 | public CommonResult<Boolean> deleteAccount(@RequestParam("id") Long id) { |
| 51 | mpAccountService.deleteAccount(id); | 51 | mpAccountService.deleteAccount(id); |
| @@ -53,8 +53,8 @@ public class MpAccountController { | @@ -53,8 +53,8 @@ public class MpAccountController { | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | @GetMapping("/get") | 55 | @GetMapping("/get") |
| 56 | - @ApiOperation("获得公众号账号") | ||
| 57 | - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | 56 | + @Operation(summary = "获得公众号账号") |
| 57 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 58 | @PreAuthorize("@ss.hasPermission('mp:account:query')") | 58 | @PreAuthorize("@ss.hasPermission('mp:account:query')") |
| 59 | public CommonResult<MpAccountRespVO> getAccount(@RequestParam("id") Long id) { | 59 | public CommonResult<MpAccountRespVO> getAccount(@RequestParam("id") Long id) { |
| 60 | MpAccountDO wxAccount = mpAccountService.getAccount(id); | 60 | MpAccountDO wxAccount = mpAccountService.getAccount(id); |
| @@ -62,7 +62,7 @@ public class MpAccountController { | @@ -62,7 +62,7 @@ public class MpAccountController { | ||
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | @GetMapping("/page") | 64 | @GetMapping("/page") |
| 65 | - @ApiOperation("获得公众号账号分页") | 65 | + @Operation(summary = "获得公众号账号分页") |
| 66 | @PreAuthorize("@ss.hasPermission('mp:account:query')") | 66 | @PreAuthorize("@ss.hasPermission('mp:account:query')") |
| 67 | public CommonResult<PageResult<MpAccountRespVO>> getAccountPage(@Valid MpAccountPageReqVO pageVO) { | 67 | public CommonResult<PageResult<MpAccountRespVO>> getAccountPage(@Valid MpAccountPageReqVO pageVO) { |
| 68 | PageResult<MpAccountDO> pageResult = mpAccountService.getAccountPage(pageVO); | 68 | PageResult<MpAccountDO> pageResult = mpAccountService.getAccountPage(pageVO); |
| @@ -70,7 +70,7 @@ public class MpAccountController { | @@ -70,7 +70,7 @@ public class MpAccountController { | ||
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | @GetMapping("/list-all-simple") | 72 | @GetMapping("/list-all-simple") |
| 73 | - @ApiOperation(value = "获取公众号账号精简信息列表") | 73 | + @Operation(summary = "获取公众号账号精简信息列表") |
| 74 | @PreAuthorize("@ss.hasPermission('mp:account:query')") | 74 | @PreAuthorize("@ss.hasPermission('mp:account:query')") |
| 75 | public CommonResult<List<MpAccountSimpleRespVO>> getSimpleAccounts() { | 75 | public CommonResult<List<MpAccountSimpleRespVO>> getSimpleAccounts() { |
| 76 | List<MpAccountDO> list = mpAccountService.getAccountList(); | 76 | List<MpAccountDO> list = mpAccountService.getAccountList(); |
| @@ -78,8 +78,8 @@ public class MpAccountController { | @@ -78,8 +78,8 @@ public class MpAccountController { | ||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | @PutMapping("/generate-qr-code") | 80 | @PutMapping("/generate-qr-code") |
| 81 | - @ApiOperation("生成公众号二维码") | ||
| 82 | - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | 81 | + @Operation(summary = "生成公众号二维码") |
| 82 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 83 | @PreAuthorize("@ss.hasPermission('mp:account:qr-code')") | 83 | @PreAuthorize("@ss.hasPermission('mp:account:qr-code')") |
| 84 | public CommonResult<Boolean> generateAccountQrCode(@RequestParam("id") Long id) { | 84 | public CommonResult<Boolean> generateAccountQrCode(@RequestParam("id") Long id) { |
| 85 | mpAccountService.generateAccountQrCode(id); | 85 | mpAccountService.generateAccountQrCode(id); |
| @@ -87,8 +87,8 @@ public class MpAccountController { | @@ -87,8 +87,8 @@ public class MpAccountController { | ||
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | @PutMapping("/clear-quota") | 89 | @PutMapping("/clear-quota") |
| 90 | - @ApiOperation("清空公众号 API 配额") | ||
| 91 | - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | 90 | + @Operation(summary = "清空公众号 API 配额") |
| 91 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 92 | @PreAuthorize("@ss.hasPermission('mp:account:clear-quota')") | 92 | @PreAuthorize("@ss.hasPermission('mp:account:clear-quota')") |
| 93 | public CommonResult<Boolean> clearAccountQuota(@RequestParam("id") Long id) { | 93 | public CommonResult<Boolean> clearAccountQuota(@RequestParam("id") Long id) { |
| 94 | mpAccountService.clearAccountQuota(id); | 94 | mpAccountService.clearAccountQuota(id); |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.Data; | 4 | import lombok.Data; |
| 5 | 5 | ||
| 6 | import javax.validation.constraints.NotEmpty; | 6 | import javax.validation.constraints.NotEmpty; |
| @@ -14,30 +14,30 @@ import javax.validation.constraints.NotEmpty; | @@ -14,30 +14,30 @@ import javax.validation.constraints.NotEmpty; | ||
| 14 | @Data | 14 | @Data |
| 15 | public class MpAccountBaseVO { | 15 | public class MpAccountBaseVO { |
| 16 | 16 | ||
| 17 | - @ApiModelProperty(value = "公众号名称", required = true, example = "芋道源码") | 17 | + @Schema(description = "公众号名称", required = true, example = "芋道源码") |
| 18 | @NotEmpty(message = "公众号名称不能为空") | 18 | @NotEmpty(message = "公众号名称不能为空") |
| 19 | private String name; | 19 | private String name; |
| 20 | 20 | ||
| 21 | - @ApiModelProperty(value = "公众号微信号", required = true, example = "yudaoyuanma") | 21 | + @Schema(description = "公众号微信号", required = true, example = "yudaoyuanma") |
| 22 | @NotEmpty(message = "公众号微信号不能为空") | 22 | @NotEmpty(message = "公众号微信号不能为空") |
| 23 | private String account; | 23 | private String account; |
| 24 | 24 | ||
| 25 | - @ApiModelProperty(value = "公众号 appId", required = true, example = "wx5b23ba7a5589ecbb") | 25 | + @Schema(description = "公众号 appId", required = true, example = "wx5b23ba7a5589ecbb") |
| 26 | @NotEmpty(message = "公众号 appId 不能为空") | 26 | @NotEmpty(message = "公众号 appId 不能为空") |
| 27 | private String appId; | 27 | private String appId; |
| 28 | 28 | ||
| 29 | - @ApiModelProperty(value = "公众号密钥", required = true, example = "3a7b3b20c537e52e74afd395eb85f61f") | 29 | + @Schema(description = "公众号密钥", required = true, example = "3a7b3b20c537e52e74afd395eb85f61f") |
| 30 | @NotEmpty(message = "公众号密钥不能为空") | 30 | @NotEmpty(message = "公众号密钥不能为空") |
| 31 | private String appSecret; | 31 | private String appSecret; |
| 32 | 32 | ||
| 33 | - @ApiModelProperty(value = "公众号 token", required = true, example = "kangdayuzhen") | 33 | + @Schema(description = "公众号 token", required = true, example = "kangdayuzhen") |
| 34 | @NotEmpty(message = "公众号 token 不能为空") | 34 | @NotEmpty(message = "公众号 token 不能为空") |
| 35 | private String token; | 35 | private String token; |
| 36 | 36 | ||
| 37 | - @ApiModelProperty(value = "加密密钥", example = "gjN+Ksei") | 37 | + @Schema(description = "加密密钥", example = "gjN+Ksei") |
| 38 | private String aesKey; | 38 | private String aesKey; |
| 39 | 39 | ||
| 40 | - @ApiModelProperty(value = "备注", example = "请关注芋道源码,学习技术") | 40 | + @Schema(description = "备注", example = "请关注芋道源码,学习技术") |
| 41 | private String remark; | 41 | private String remark; |
| 42 | 42 | ||
| 43 | } | 43 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountCreateReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.Data; | 4 | import lombok.Data; |
| 5 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 6 | import lombok.ToString; | 6 | import lombok.ToString; |
| 7 | 7 | ||
| 8 | -@ApiModel("管理后台 - 公众号账号创建 Request VO") | 8 | +@Schema(description = "管理后台 - 公众号账号创建 Request VO") |
| 9 | @Data | 9 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 11 | @ToString(callSuper = true) |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountPageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.ToString; | ||
| 6 | 8 | ||
| 7 | -@ApiModel("管理后台 - 公众号账号分页 Request VO") | 9 | +@Schema(description = "管理后台 - 公众号账号分页 Request VO") |
| 8 | @Data | 10 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 11 | @EqualsAndHashCode(callSuper = true) |
| 10 | @ToString(callSuper = true) | 12 | @ToString(callSuper = true) |
| 11 | public class MpAccountPageReqVO extends PageParam { | 13 | public class MpAccountPageReqVO extends PageParam { |
| 12 | 14 | ||
| 13 | - @ApiModelProperty(value = "公众号名称", notes = "模糊匹配") | 15 | + @Schema(name = "公众号名称", description = "模糊匹配") |
| 14 | private String name; | 16 | private String name; |
| 15 | 17 | ||
| 16 | - @ApiModelProperty(value = "公众号账号", notes = "模糊匹配") | 18 | + @Schema(name = "公众号账号", description = "模糊匹配") |
| 17 | private String account; | 19 | private String account; |
| 18 | 20 | ||
| 19 | - @ApiModelProperty(value = "公众号 appid", notes = "模糊匹配") | 21 | + @Schema(name = "公众号 appid", description = "模糊匹配") |
| 20 | private String appId; | 22 | private String appId; |
| 21 | 23 | ||
| 22 | } | 24 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 6 | import lombok.ToString; |
| 8 | 7 | ||
| 9 | import java.util.Date; | 8 | import java.util.Date; |
| 10 | 9 | ||
| 11 | -@ApiModel("管理后台 - 公众号账号 Response VO") | 10 | +@Schema(description = "管理后台 - 公众号账号 Response VO") |
| 12 | @Data | 11 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 15 | public class MpAccountRespVO extends MpAccountBaseVO { | 14 | public class MpAccountRespVO extends MpAccountBaseVO { |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "编号", required = true, example = "1024") | 16 | + @Schema(description = "编号", required = true, example = "1024") |
| 18 | private Long id; | 17 | private Long id; |
| 19 | 18 | ||
| 20 | - @ApiModelProperty(value = "二维码图片URL", example = "https://www.iocoder.cn/1024.png") | 19 | + @Schema(description = "二维码图片URL", example = "https://www.iocoder.cn/1024.png") |
| 21 | private String qrCodeUrl; | 20 | private String qrCodeUrl; |
| 22 | 21 | ||
| 23 | - @ApiModelProperty(value = "创建时间", required = true) | 22 | + @Schema(description = "创建时间", required = true) |
| 24 | private Date createTime; | 23 | private Date createTime; |
| 25 | 24 | ||
| 26 | } | 25 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountSimpleRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | -@ApiModel("管理后台 - 公众号账号精简信息 Response VO") | 6 | +@Schema(description = "管理后台 - 公众号账号精简信息 Response VO") |
| 8 | @Data | 7 | @Data |
| 9 | public class MpAccountSimpleRespVO { | 8 | public class MpAccountSimpleRespVO { |
| 10 | 9 | ||
| 11 | - @ApiModelProperty(value = "编号", required = true, example = "1024") | 10 | + @Schema(description = "编号", required = true, example = "1024") |
| 12 | private Long id; | 11 | private Long id; |
| 13 | 12 | ||
| 14 | - @ApiModelProperty(value = "公众号名称", required = true, example = "芋道源码") | 13 | + @Schema(description = "公众号名称", required = true, example = "芋道源码") |
| 15 | private String name; | 14 | private String name; |
| 16 | 15 | ||
| 17 | } | 16 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountUpdateReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | -import javax.validation.constraints.*; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | +import lombok.Data; | ||
| 5 | +import lombok.EqualsAndHashCode; | ||
| 6 | +import lombok.ToString; | ||
| 6 | 7 | ||
| 7 | -@ApiModel("管理后台 - 公众号账号更新 Request VO") | 8 | +import javax.validation.constraints.NotNull; |
| 9 | + | ||
| 10 | +@Schema(description = "管理后台 - 公众号账号更新 Request VO") | ||
| 8 | @Data | 11 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 10 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 11 | public class MpAccountUpdateReqVO extends MpAccountBaseVO { | 14 | public class MpAccountUpdateReqVO extends MpAccountBaseVO { |
| 12 | 15 | ||
| 13 | - @ApiModelProperty(value = "编号", required = true, example = "1024") | 16 | + @Schema(description = "编号", required = true, example = "1024") |
| 14 | @NotNull(message = "编号不能为空") | 17 | @NotNull(message = "编号不能为空") |
| 15 | private Long id; | 18 | private Long id; |
| 16 | 19 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/MpMaterialController.java
| @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.material.vo.*; | @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.material.vo.*; | ||
| 6 | import cn.iocoder.yudao.module.mp.convert.material.MpMaterialConvert; | 6 | import cn.iocoder.yudao.module.mp.convert.material.MpMaterialConvert; |
| 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.material.MpMaterialDO; | 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.material.MpMaterialDO; |
| 8 | import cn.iocoder.yudao.module.mp.service.material.MpMaterialService; | 8 | import cn.iocoder.yudao.module.mp.service.material.MpMaterialService; |
| 9 | -import io.swagger.annotations.Api; | ||
| 10 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 11 | -import io.swagger.annotations.ApiOperation; | 9 | +import io.swagger.v3.oas.annotations.Operation; |
| 10 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 11 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 12 | import org.springframework.security.access.prepost.PreAuthorize; | 12 | import org.springframework.security.access.prepost.PreAuthorize; |
| 13 | import org.springframework.validation.annotation.Validated; | 13 | import org.springframework.validation.annotation.Validated; |
| 14 | import org.springframework.web.bind.annotation.*; | 14 | import org.springframework.web.bind.annotation.*; |
| @@ -19,7 +19,7 @@ import java.io.IOException; | @@ -19,7 +19,7 @@ import java.io.IOException; | ||
| 19 | 19 | ||
| 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 21 | ||
| 22 | -@Api(tags = "管理后台 - 公众号素材") | 22 | +@Tag(name = "管理后台 - 公众号素材") |
| 23 | @RestController | 23 | @RestController |
| 24 | @RequestMapping("/mp/material") | 24 | @RequestMapping("/mp/material") |
| 25 | @Validated | 25 | @Validated |
| @@ -28,7 +28,7 @@ public class MpMaterialController { | @@ -28,7 +28,7 @@ public class MpMaterialController { | ||
| 28 | @Resource | 28 | @Resource |
| 29 | private MpMaterialService mpMaterialService; | 29 | private MpMaterialService mpMaterialService; |
| 30 | 30 | ||
| 31 | - @ApiOperation("上传临时素材") | 31 | + @Operation(summary = "上传临时素材") |
| 32 | @PostMapping("/upload-temporary") | 32 | @PostMapping("/upload-temporary") |
| 33 | @PreAuthorize("@ss.hasPermission('mp:material:upload-temporary')") | 33 | @PreAuthorize("@ss.hasPermission('mp:material:upload-temporary')") |
| 34 | public CommonResult<MpMaterialUploadRespVO> uploadTemporaryMaterial( | 34 | public CommonResult<MpMaterialUploadRespVO> uploadTemporaryMaterial( |
| @@ -37,7 +37,7 @@ public class MpMaterialController { | @@ -37,7 +37,7 @@ public class MpMaterialController { | ||
| 37 | return success(MpMaterialConvert.INSTANCE.convert(material)); | 37 | return success(MpMaterialConvert.INSTANCE.convert(material)); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | - @ApiOperation("上传永久素材") | 40 | + @Operation(summary = "上传永久素材") |
| 41 | @PostMapping("/upload-permanent") | 41 | @PostMapping("/upload-permanent") |
| 42 | @PreAuthorize("@ss.hasPermission('mp:material:upload-permanent')") | 42 | @PreAuthorize("@ss.hasPermission('mp:material:upload-permanent')") |
| 43 | public CommonResult<MpMaterialUploadRespVO> uploadPermanentMaterial( | 43 | public CommonResult<MpMaterialUploadRespVO> uploadPermanentMaterial( |
| @@ -46,16 +46,16 @@ public class MpMaterialController { | @@ -46,16 +46,16 @@ public class MpMaterialController { | ||
| 46 | return success(MpMaterialConvert.INSTANCE.convert(material)); | 46 | return success(MpMaterialConvert.INSTANCE.convert(material)); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | - @ApiOperation("删除素材") | 49 | + @Operation(summary = "删除素材") |
| 50 | @DeleteMapping("/delete-permanent") | 50 | @DeleteMapping("/delete-permanent") |
| 51 | - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | 51 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 52 | @PreAuthorize("@ss.hasPermission('mp:material:delete')") | 52 | @PreAuthorize("@ss.hasPermission('mp:material:delete')") |
| 53 | public CommonResult<Boolean> deleteMaterial(@RequestParam("id") Long id) { | 53 | public CommonResult<Boolean> deleteMaterial(@RequestParam("id") Long id) { |
| 54 | mpMaterialService.deleteMaterial(id); | 54 | mpMaterialService.deleteMaterial(id); |
| 55 | return success(true); | 55 | return success(true); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | - @ApiOperation("上传图文内容中的图片") | 58 | + @Operation(summary = "上传图文内容中的图片") |
| 59 | @PostMapping("/upload-news-image") | 59 | @PostMapping("/upload-news-image") |
| 60 | @PreAuthorize("@ss.hasPermission('mp:material:upload-news-image')") | 60 | @PreAuthorize("@ss.hasPermission('mp:material:upload-news-image')") |
| 61 | public CommonResult<String> uploadNewsImage(@Valid MpMaterialUploadNewsImageReqVO reqVO) | 61 | public CommonResult<String> uploadNewsImage(@Valid MpMaterialUploadNewsImageReqVO reqVO) |
| @@ -63,7 +63,7 @@ public class MpMaterialController { | @@ -63,7 +63,7 @@ public class MpMaterialController { | ||
| 63 | return success(mpMaterialService.uploadNewsImage(reqVO)); | 63 | return success(mpMaterialService.uploadNewsImage(reqVO)); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | - @ApiOperation("获得素材分页") | 66 | + @Operation(summary = "获得素材分页") |
| 67 | @GetMapping("/page") | 67 | @GetMapping("/page") |
| 68 | @PreAuthorize("@ss.hasPermission('mp:material:query')") | 68 | @PreAuthorize("@ss.hasPermission('mp:material:query')") |
| 69 | public CommonResult<PageResult<MpMaterialRespVO>> getMaterialPage(@Valid MpMaterialPageReqVO pageReqVO) { | 69 | public CommonResult<PageResult<MpMaterialRespVO>> getMaterialPage(@Valid MpMaterialPageReqVO pageReqVO) { |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialPageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 8 | import lombok.ToString; | 7 | import lombok.ToString; |
| 9 | 8 | ||
| 10 | import javax.validation.constraints.NotNull; | 9 | import javax.validation.constraints.NotNull; |
| 11 | 10 | ||
| 12 | -@ApiModel("管理后台 - 公众号素材的分页 Request VO") | 11 | +@Schema(description = "管理后台 - 公众号素材的分页 Request VO") |
| 13 | @Data | 12 | @Data |
| 14 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| 15 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 16 | public class MpMaterialPageReqVO extends PageParam { | 15 | public class MpMaterialPageReqVO extends PageParam { |
| 17 | 16 | ||
| 18 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | 17 | + @Schema(description = "公众号账号的编号", required = true, example = "2048") |
| 19 | @NotNull(message = "公众号账号的编号不能为空") | 18 | @NotNull(message = "公众号账号的编号不能为空") |
| 20 | private Long accountId; | 19 | private Long accountId; |
| 21 | 20 | ||
| 22 | - @ApiModelProperty(value = "是否永久", example = "true") | 21 | + @Schema(description = "是否永久", example = "true") |
| 23 | private Boolean permanent; | 22 | private Boolean permanent; |
| 24 | 23 | ||
| 25 | - @ApiModelProperty(value = "文件类型", example = "image", notes = "参见 WxConsts.MediaFileType 枚举") | 24 | + @Schema(description = "文件类型 参见 WxConsts.MediaFileType 枚举", example = "image") |
| 26 | private String type; | 25 | private String type; |
| 27 | 26 | ||
| 28 | } | 27 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | import java.util.Date; | 6 | import java.util.Date; |
| 8 | 7 | ||
| 9 | -@ApiModel("管理后台 - 公众号素材 Response VO") | 8 | +@Schema(description = "管理后台 - 公众号素材 Response VO") |
| 10 | @Data | 9 | @Data |
| 11 | public class MpMaterialRespVO { | 10 | public class MpMaterialRespVO { |
| 12 | 11 | ||
| 13 | - @ApiModelProperty(value = "主键", required = true, example = "1024") | 12 | + @Schema(description = "主键", required = true, example = "1024") |
| 14 | private Long id; | 13 | private Long id; |
| 15 | 14 | ||
| 16 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1") | 15 | + @Schema(description = "公众号账号的编号", required = true, example = "1") |
| 17 | private Long accountId; | 16 | private Long accountId; |
| 18 | - @ApiModelProperty(value = "公众号账号的 appId", required = true, example = "wx1234567890") | 17 | + @Schema(description = "公众号账号的 appId", required = true, example = "wx1234567890") |
| 19 | private String appId; | 18 | private String appId; |
| 20 | 19 | ||
| 21 | - @ApiModelProperty(value = "素材的 media_id", required = true, example = "123") | 20 | + @Schema(description = "素材的 media_id", required = true, example = "123") |
| 22 | private String mediaId; | 21 | private String mediaId; |
| 23 | 22 | ||
| 24 | - @ApiModelProperty(value = "文件类型", required = true, example = "image", notes = "参见 WxConsts.MediaFileType 枚举") | 23 | + @Schema(description = "文件类型 参见 WxConsts.MediaFileType 枚举", required = true, example = "image") |
| 25 | private String type; | 24 | private String type; |
| 26 | 25 | ||
| 27 | - @ApiModelProperty(value = "是否永久", required = true, example = "true", notes = "true - 永久;false - 临时") | 26 | + @Schema(description = "是否永久 true - 永久;false - 临时", required = true, example = "true") |
| 28 | private Boolean permanent; | 27 | private Boolean permanent; |
| 29 | 28 | ||
| 30 | - @ApiModelProperty(value = "素材的 URL", required = true, example = "https://www.iocoder.cn/1.png") | 29 | + @Schema(description = "素材的 URL", required = true, example = "https://www.iocoder.cn/1.png") |
| 31 | private String url; | 30 | private String url; |
| 32 | 31 | ||
| 33 | 32 | ||
| 34 | - @ApiModelProperty(value = "名字", example = "yunai.png") | 33 | + @Schema(description = "名字", example = "yunai.png") |
| 35 | private String name; | 34 | private String name; |
| 36 | 35 | ||
| 37 | - @ApiModelProperty(value = "公众号文件 URL", example = "https://mmbiz.qpic.cn/xxx.mp3", notes = "只有【永久素材】使用") | 36 | + @Schema(description = "公众号文件 URL 只有【永久素材】使用", example = "https://mmbiz.qpic.cn/xxx.mp3") |
| 38 | private String mpUrl; | 37 | private String mpUrl; |
| 39 | 38 | ||
| 40 | - @ApiModelProperty(value = "视频素材的标题", example = "我是标题", notes = "只有【永久素材】使用") | 39 | + @Schema(description = "视频素材的标题 只有【永久素材】使用", example = "我是标题") |
| 41 | private String title; | 40 | private String title; |
| 42 | - @ApiModelProperty(value = "视频素材的描述", example = "我是介绍", notes = "只有【永久素材】使用") | 41 | + @Schema(description = "视频素材的描述 只有【永久素材】使用", example = "我是介绍") |
| 43 | private String introduction; | 42 | private String introduction; |
| 44 | 43 | ||
| 45 | - @ApiModelProperty(value = "创建时间", required = true) | 44 | + @Schema(description = "创建时间", required = true) |
| 46 | private Date createTime; | 45 | private Date createTime; |
| 47 | 46 | ||
| 48 | } | 47 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadNewsImageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; |
| 2 | 2 | ||
| 3 | import com.fasterxml.jackson.annotation.JsonIgnore; | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | import org.springframework.web.multipart.MultipartFile; | 6 | import org.springframework.web.multipart.MultipartFile; |
| 8 | 7 | ||
| 9 | import javax.validation.constraints.NotNull; | 8 | import javax.validation.constraints.NotNull; |
| 10 | 9 | ||
| 11 | -@ApiModel("管理后台 - 公众号素材上传图文内容中的图片 Request VO") | 10 | +@Schema(description = "管理后台 - 公众号素材上传图文内容中的图片 Request VO") |
| 12 | @Data | 11 | @Data |
| 13 | public class MpMaterialUploadNewsImageReqVO { | 12 | public class MpMaterialUploadNewsImageReqVO { |
| 14 | 13 | ||
| 15 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | 14 | + @Schema(description = "公众号账号的编号", required = true, example = "2048") |
| 16 | @NotNull(message = "公众号账号的编号不能为空") | 15 | @NotNull(message = "公众号账号的编号不能为空") |
| 17 | private Long accountId; | 16 | private Long accountId; |
| 18 | 17 | ||
| 19 | - @ApiModelProperty(value = "文件附件", required = true) | 18 | + @Schema(description = "文件附件", required = true) |
| 20 | @NotNull(message = "文件不能为空") | 19 | @NotNull(message = "文件不能为空") |
| 21 | @JsonIgnore // 避免被操作日志,进行序列化,导致报错 | 20 | @JsonIgnore // 避免被操作日志,进行序列化,导致报错 |
| 22 | private MultipartFile file; | 21 | private MultipartFile file; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadPermanentReqVO.java
| @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.mp.controller.admin.material.vo; | @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.mp.controller.admin.material.vo; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.util.ObjectUtil; | 3 | import cn.hutool.core.util.ObjectUtil; |
| 4 | import com.fasterxml.jackson.annotation.JsonIgnore; | 4 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 5 | -import io.swagger.annotations.ApiModel; | ||
| 6 | -import io.swagger.annotations.ApiModelProperty; | 5 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 7 | import lombok.Data; | 6 | import lombok.Data; |
| 8 | import me.chanjar.weixin.common.api.WxConsts; | 7 | import me.chanjar.weixin.common.api.WxConsts; |
| 9 | import org.springframework.web.multipart.MultipartFile; | 8 | import org.springframework.web.multipart.MultipartFile; |
| @@ -12,29 +11,29 @@ import javax.validation.constraints.AssertTrue; | @@ -12,29 +11,29 @@ import javax.validation.constraints.AssertTrue; | ||
| 12 | import javax.validation.constraints.NotEmpty; | 11 | import javax.validation.constraints.NotEmpty; |
| 13 | import javax.validation.constraints.NotNull; | 12 | import javax.validation.constraints.NotNull; |
| 14 | 13 | ||
| 15 | -@ApiModel("管理后台 - 公众号素材上传永久 Request VO") | 14 | +@Schema(description = "管理后台 - 公众号素材上传永久 Request VO") |
| 16 | @Data | 15 | @Data |
| 17 | public class MpMaterialUploadPermanentReqVO { | 16 | public class MpMaterialUploadPermanentReqVO { |
| 18 | 17 | ||
| 19 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | 18 | + @Schema(description = "公众号账号的编号", required = true, example = "2048") |
| 20 | @NotNull(message = "公众号账号的编号不能为空") | 19 | @NotNull(message = "公众号账号的编号不能为空") |
| 21 | private Long accountId; | 20 | private Long accountId; |
| 22 | 21 | ||
| 23 | - @ApiModelProperty(value = "文件类型", required = true, example = "image", notes = "参见 WxConsts.MediaFileType 枚举") | 22 | + @Schema(description = "文件类型 参见 WxConsts.MediaFileType 枚举", required = true, example = "image") |
| 24 | @NotEmpty(message = "文件类型不能为空") | 23 | @NotEmpty(message = "文件类型不能为空") |
| 25 | private String type; | 24 | private String type; |
| 26 | 25 | ||
| 27 | - @ApiModelProperty(value = "文件附件", required = true) | 26 | + @Schema(description = "文件附件", required = true) |
| 28 | @NotNull(message = "文件不能为空") | 27 | @NotNull(message = "文件不能为空") |
| 29 | @JsonIgnore // 避免被操作日志,进行序列化,导致报错 | 28 | @JsonIgnore // 避免被操作日志,进行序列化,导致报错 |
| 30 | private MultipartFile file; | 29 | private MultipartFile file; |
| 31 | 30 | ||
| 32 | - @ApiModelProperty(value = "名字", example = "wechat.mp", notes = "如果 name 为空,则使用 file 文件名") | 31 | + @Schema(description = "名字 如果 name 为空,则使用 file 文件名", example = "wechat.mp") |
| 33 | private String name; | 32 | private String name; |
| 34 | 33 | ||
| 35 | - @ApiModelProperty(value = "视频素材的标题", example = "视频素材的标题", notes = "文件类型为 video 时,必填") | 34 | + @Schema(description = "视频素材的标题 文件类型为 video 时,必填", example = "视频素材的标题") |
| 36 | private String title; | 35 | private String title; |
| 37 | - @ApiModelProperty(value = "视频素材的描述", example = "视频素材的描述", notes = "文件类型为 video 时,必填") | 36 | + @Schema(description = "视频素材的描述 文件类型为 video 时,必填", example = "视频素材的描述") |
| 38 | private String introduction; | 37 | private String introduction; |
| 39 | 38 | ||
| 40 | @AssertTrue(message = "标题不能为空") | 39 | @AssertTrue(message = "标题不能为空") |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | -@ApiModel("管理后台 - 公众号素材上传结果 Response VO") | 6 | +@Schema(description = "管理后台 - 公众号素材上传结果 Response VO") |
| 8 | @Data | 7 | @Data |
| 9 | public class MpMaterialUploadRespVO { | 8 | public class MpMaterialUploadRespVO { |
| 10 | 9 | ||
| 11 | - @ApiModelProperty(value = "素材的 media_id", required = true, example = "123") | 10 | + @Schema(description = "素材的 media_id", required = true, example = "123") |
| 12 | private String mediaId; | 11 | private String mediaId; |
| 13 | 12 | ||
| 14 | - @ApiModelProperty(value = "素材的 URL", required = true, example = "https://www.iocoder.cn/1.png") | 13 | + @Schema(description = "素材的 URL", required = true, example = "https://www.iocoder.cn/1.png") |
| 15 | private String url; | 14 | private String url; |
| 16 | 15 | ||
| 17 | } | 16 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadTemporaryReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.material.vo; |
| 2 | 2 | ||
| 3 | import com.fasterxml.jackson.annotation.JsonIgnore; | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | import org.springframework.web.multipart.MultipartFile; | 6 | import org.springframework.web.multipart.MultipartFile; |
| 8 | 7 | ||
| 9 | import javax.validation.constraints.NotEmpty; | 8 | import javax.validation.constraints.NotEmpty; |
| 10 | import javax.validation.constraints.NotNull; | 9 | import javax.validation.constraints.NotNull; |
| 11 | 10 | ||
| 12 | -@ApiModel("管理后台 - 公众号素材上传临时 Request VO") | 11 | +@Schema(description = "管理后台 - 公众号素材上传临时 Request VO") |
| 13 | @Data | 12 | @Data |
| 14 | public class MpMaterialUploadTemporaryReqVO { | 13 | public class MpMaterialUploadTemporaryReqVO { |
| 15 | 14 | ||
| 16 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | 15 | + @Schema(description = "公众号账号的编号", required = true, example = "2048") |
| 17 | @NotNull(message = "公众号账号的编号不能为空") | 16 | @NotNull(message = "公众号账号的编号不能为空") |
| 18 | private Long accountId; | 17 | private Long accountId; |
| 19 | 18 | ||
| 20 | - @ApiModelProperty(value = "文件类型", required = true, example = "image", notes = "参见 WxConsts.MediaFileType 枚举") | 19 | + @Schema(description = "文件类型 参见 WxConsts.MediaFileType 枚举", required = true, example = "image") |
| 21 | @NotEmpty(message = "文件类型不能为空") | 20 | @NotEmpty(message = "文件类型不能为空") |
| 22 | private String type; | 21 | private String type; |
| 23 | 22 | ||
| 24 | - @ApiModelProperty(value = "文件附件", required = true) | 23 | + @Schema(description = "文件附件", required = true) |
| 25 | @NotNull(message = "文件不能为空") | 24 | @NotNull(message = "文件不能为空") |
| 26 | @JsonIgnore // 避免被操作日志,进行序列化,导致报错 | 25 | @JsonIgnore // 避免被操作日志,进行序列化,导致报错 |
| 27 | private MultipartFile file; | 26 | private MultipartFile file; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.java
| @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.MpMenuSaveReqVO; | @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.MpMenuSaveReqVO; | ||
| 6 | import cn.iocoder.yudao.module.mp.convert.menu.MpMenuConvert; | 6 | import cn.iocoder.yudao.module.mp.convert.menu.MpMenuConvert; |
| 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.menu.MpMenuDO; | 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.menu.MpMenuDO; |
| 8 | import cn.iocoder.yudao.module.mp.service.menu.MpMenuService; | 8 | import cn.iocoder.yudao.module.mp.service.menu.MpMenuService; |
| 9 | -import io.swagger.annotations.Api; | ||
| 10 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 11 | -import io.swagger.annotations.ApiOperation; | 9 | +import io.swagger.v3.oas.annotations.Operation; |
| 10 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 11 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 12 | import org.springframework.security.access.prepost.PreAuthorize; | 12 | import org.springframework.security.access.prepost.PreAuthorize; |
| 13 | import org.springframework.validation.annotation.Validated; | 13 | import org.springframework.validation.annotation.Validated; |
| 14 | import org.springframework.web.bind.annotation.*; | 14 | import org.springframework.web.bind.annotation.*; |
| @@ -19,7 +19,7 @@ import java.util.List; | @@ -19,7 +19,7 @@ import java.util.List; | ||
| 19 | 19 | ||
| 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 21 | ||
| 22 | -@Api(tags = "管理后台 - 公众号菜单") | 22 | +@Tag(name = "管理后台 - 公众号菜单") |
| 23 | @RestController | 23 | @RestController |
| 24 | @RequestMapping("/mp/menu") | 24 | @RequestMapping("/mp/menu") |
| 25 | @Validated | 25 | @Validated |
| @@ -29,7 +29,7 @@ public class MpMenuController { | @@ -29,7 +29,7 @@ public class MpMenuController { | ||
| 29 | private MpMenuService mpMenuService; | 29 | private MpMenuService mpMenuService; |
| 30 | 30 | ||
| 31 | @PostMapping("/save") | 31 | @PostMapping("/save") |
| 32 | - @ApiOperation("保存公众号菜单") | 32 | + @Operation(summary = "保存公众号菜单") |
| 33 | @PreAuthorize("@ss.hasPermission('mp:menu:save')") | 33 | @PreAuthorize("@ss.hasPermission('mp:menu:save')") |
| 34 | public CommonResult<Boolean> saveMenu(@Valid @RequestBody MpMenuSaveReqVO createReqVO) { | 34 | public CommonResult<Boolean> saveMenu(@Valid @RequestBody MpMenuSaveReqVO createReqVO) { |
| 35 | mpMenuService.saveMenu(createReqVO); | 35 | mpMenuService.saveMenu(createReqVO); |
| @@ -37,8 +37,8 @@ public class MpMenuController { | @@ -37,8 +37,8 @@ public class MpMenuController { | ||
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | @DeleteMapping("/delete") | 39 | @DeleteMapping("/delete") |
| 40 | - @ApiOperation("删除公众号菜单") | ||
| 41 | - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, example = "10", dataTypeClass = Long.class) | 40 | + @Operation(summary = "删除公众号菜单") |
| 41 | + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "10") | ||
| 42 | @PreAuthorize("@ss.hasPermission('mp:menu:delete')") | 42 | @PreAuthorize("@ss.hasPermission('mp:menu:delete')") |
| 43 | public CommonResult<Boolean> deleteMenu(@RequestParam("accountId") Long accountId) { | 43 | public CommonResult<Boolean> deleteMenu(@RequestParam("accountId") Long accountId) { |
| 44 | mpMenuService.deleteMenuByAccountId(accountId); | 44 | mpMenuService.deleteMenuByAccountId(accountId); |
| @@ -46,8 +46,8 @@ public class MpMenuController { | @@ -46,8 +46,8 @@ public class MpMenuController { | ||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | @GetMapping("/list") | 48 | @GetMapping("/list") |
| 49 | - @ApiOperation("获得公众号菜单列表") | ||
| 50 | - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, example = "10", dataTypeClass = Long.class) | 49 | + @Operation(summary = "获得公众号菜单列表") |
| 50 | + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "10") | ||
| 51 | @PreAuthorize("@ss.hasPermission('mp:menu:query')") | 51 | @PreAuthorize("@ss.hasPermission('mp:menu:query')") |
| 52 | public CommonResult<List<MpMenuRespVO>> getMenuList(@RequestParam("accountId") Long accountId) { | 52 | public CommonResult<List<MpMenuRespVO>> getMenuList(@RequestParam("accountId") Long accountId) { |
| 53 | List<MpMenuDO> list = mpMenuService.getMenuListByAccountId(accountId); | 53 | List<MpMenuDO> list = mpMenuService.getMenuListByAccountId(accountId); |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | 3 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; |
| 4 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | import me.chanjar.weixin.common.api.WxConsts; | 6 | import me.chanjar.weixin.common.api.WxConsts; |
| 7 | import org.hibernate.validator.constraints.URL; | 7 | import org.hibernate.validator.constraints.URL; |
| @@ -44,54 +44,53 @@ public class MpMenuBaseVO { | @@ -44,54 +44,53 @@ public class MpMenuBaseVO { | ||
| 44 | */ | 44 | */ |
| 45 | private String type; | 45 | private String type; |
| 46 | 46 | ||
| 47 | - @ApiModelProperty(value = "网页链接", example = "https://www.iocoder.cn/") | 47 | + @Schema(description = "网页链接", example = "https://www.iocoder.cn/") |
| 48 | @NotEmpty(message = "网页链接不能为空", groups = {ViewButtonGroup.class, MiniProgramButtonGroup.class}) | 48 | @NotEmpty(message = "网页链接不能为空", groups = {ViewButtonGroup.class, MiniProgramButtonGroup.class}) |
| 49 | @URL(message = "网页链接必须是 URL 格式") | 49 | @URL(message = "网页链接必须是 URL 格式") |
| 50 | private String url; | 50 | private String url; |
| 51 | 51 | ||
| 52 | - @ApiModelProperty(value = "小程序的 appId", example = "wx1234567890") | 52 | + @Schema(description = "小程序的 appId", example = "wx1234567890") |
| 53 | @NotEmpty(message = "小程序的 appId 不能为空", groups = MiniProgramButtonGroup.class) | 53 | @NotEmpty(message = "小程序的 appId 不能为空", groups = MiniProgramButtonGroup.class) |
| 54 | private String miniProgramAppId; | 54 | private String miniProgramAppId; |
| 55 | 55 | ||
| 56 | - @ApiModelProperty(value = "小程序的页面路径", example = "pages/index/index") | 56 | + @Schema(description = "小程序的页面路径", example = "pages/index/index") |
| 57 | @NotEmpty(message = "小程序的页面路径不能为空", groups = MiniProgramButtonGroup.class) | 57 | @NotEmpty(message = "小程序的页面路径不能为空", groups = MiniProgramButtonGroup.class) |
| 58 | private String miniProgramPagePath; | 58 | private String miniProgramPagePath; |
| 59 | 59 | ||
| 60 | - @ApiModelProperty(value ="跳转图文的媒体编号", example = "jCQk93AIIgp8ixClWcW_NXXqBKInNWNmq2XnPeDZl7IMVqWiNeL4FfELtggRXd83") | 60 | + @Schema(description ="跳转图文的媒体编号", example = "jCQk93AIIgp8ixClWcW_NXXqBKInNWNmq2XnPeDZl7IMVqWiNeL4FfELtggRXd83") |
| 61 | @NotEmpty(message = "跳转图文的媒体编号不能为空", groups = ViewLimitedButtonGroup.class) | 61 | @NotEmpty(message = "跳转图文的媒体编号不能为空", groups = ViewLimitedButtonGroup.class) |
| 62 | private String articleId; | 62 | private String articleId; |
| 63 | 63 | ||
| 64 | // ========== 消息内容 ========== | 64 | // ========== 消息内容 ========== |
| 65 | 65 | ||
| 66 | - @ApiModelProperty(value = "回复的消息类型", example = "text", | ||
| 67 | - notes = "枚举 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC") | 66 | + @Schema(description = "回复的消息类型 枚举 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC", example = "text") |
| 68 | @NotEmpty(message = "回复的消息类型不能为空", groups = {ClickButtonGroup.class, ScanCodeWaitMsgButtonGroup.class}) | 67 | @NotEmpty(message = "回复的消息类型不能为空", groups = {ClickButtonGroup.class, ScanCodeWaitMsgButtonGroup.class}) |
| 69 | private String replyMessageType; | 68 | private String replyMessageType; |
| 70 | 69 | ||
| 71 | - @ApiModelProperty(value = "回复的消息内容", example = "欢迎关注") | 70 | + @Schema(description = "回复的消息内容", example = "欢迎关注") |
| 72 | @NotEmpty(message = "回复的消息内容不能为空", groups = TextMessageGroup.class) | 71 | @NotEmpty(message = "回复的消息内容不能为空", groups = TextMessageGroup.class) |
| 73 | private String replyContent; | 72 | private String replyContent; |
| 74 | 73 | ||
| 75 | - @ApiModelProperty(value = "回复的媒体 id", example = "123456") | 74 | + @Schema(description = "回复的媒体 id", example = "123456") |
| 76 | @NotEmpty(message = "回复的消息 mediaId 不能为空", | 75 | @NotEmpty(message = "回复的消息 mediaId 不能为空", |
| 77 | groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) | 76 | groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) |
| 78 | private String replyMediaId; | 77 | private String replyMediaId; |
| 79 | - @ApiModelProperty(value = "回复的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") | 78 | + @Schema(description = "回复的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") |
| 80 | @NotEmpty(message = "回复的消息 mediaId 不能为空", | 79 | @NotEmpty(message = "回复的消息 mediaId 不能为空", |
| 81 | groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) | 80 | groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) |
| 82 | private String replyMediaUrl; | 81 | private String replyMediaUrl; |
| 83 | 82 | ||
| 84 | - @ApiModelProperty(value = "缩略图的媒体 id", example = "123456") | 83 | + @Schema(description = "缩略图的媒体 id", example = "123456") |
| 85 | @NotEmpty(message = "回复的消息 thumbMediaId 不能为空", groups = {MusicMessageGroup.class}) | 84 | @NotEmpty(message = "回复的消息 thumbMediaId 不能为空", groups = {MusicMessageGroup.class}) |
| 86 | private String replyThumbMediaId; | 85 | private String replyThumbMediaId; |
| 87 | - @ApiModelProperty(value = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") | 86 | + @Schema(description = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") |
| 88 | @NotEmpty(message = "回复的消息 thumbMedia 地址不能为空", groups = {MusicMessageGroup.class}) | 87 | @NotEmpty(message = "回复的消息 thumbMedia 地址不能为空", groups = {MusicMessageGroup.class}) |
| 89 | private String replyThumbMediaUrl; | 88 | private String replyThumbMediaUrl; |
| 90 | 89 | ||
| 91 | - @ApiModelProperty(value = "回复的标题", example = "视频标题") | 90 | + @Schema(description = "回复的标题", example = "视频标题") |
| 92 | @NotEmpty(message = "回复的消息标题不能为空", groups = VideoMessageGroup.class) | 91 | @NotEmpty(message = "回复的消息标题不能为空", groups = VideoMessageGroup.class) |
| 93 | private String replyTitle; | 92 | private String replyTitle; |
| 94 | - @ApiModelProperty(value = "回复的描述", example = "视频描述") | 93 | + @Schema(description = "回复的描述", example = "视频描述") |
| 95 | @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) | 94 | @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) |
| 96 | private String replyDescription; | 95 | private String replyDescription; |
| 97 | 96 | ||
| @@ -104,11 +103,11 @@ public class MpMenuBaseVO { | @@ -104,11 +103,11 @@ public class MpMenuBaseVO { | ||
| 104 | @Valid | 103 | @Valid |
| 105 | private List<MpMessageDO.Article> replyArticles; | 104 | private List<MpMessageDO.Article> replyArticles; |
| 106 | 105 | ||
| 107 | - @ApiModelProperty(value = "回复的音乐链接", example = "https://www.iocoder.cn/xxx.mp3") | 106 | + @Schema(description = "回复的音乐链接", example = "https://www.iocoder.cn/xxx.mp3") |
| 108 | @NotEmpty(message = "回复的音乐链接不能为空", groups = MusicMessageGroup.class) | 107 | @NotEmpty(message = "回复的音乐链接不能为空", groups = MusicMessageGroup.class) |
| 109 | @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) | 108 | @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) |
| 110 | private String replyMusicUrl; | 109 | private String replyMusicUrl; |
| 111 | - @ApiModelProperty(value = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3") | 110 | + @Schema(description = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3") |
| 112 | @NotEmpty(message = "回复的高质量音乐链接不能为空", groups = MusicMessageGroup.class) | 111 | @NotEmpty(message = "回复的高质量音乐链接不能为空", groups = MusicMessageGroup.class) |
| 113 | @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) | 112 | @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) |
| 114 | private String replyHqMusicUrl; | 113 | private String replyHqMusicUrl; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 6 | import lombok.ToString; |
| 8 | 7 | ||
| 9 | import java.util.Date; | 8 | import java.util.Date; |
| 10 | 9 | ||
| 11 | -@ApiModel("管理后台 - 公众号菜单 Response VO") | 10 | +@Schema(description = "管理后台 - 公众号菜单 Response VO") |
| 12 | @Data | 11 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 15 | public class MpMenuRespVO extends MpMenuBaseVO { | 14 | public class MpMenuRespVO extends MpMenuBaseVO { |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "主键", required = true, example = "1024") | 16 | + @Schema(description = "主键", required = true, example = "1024") |
| 18 | private Long id; | 17 | private Long id; |
| 19 | 18 | ||
| 20 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | 19 | + @Schema(description = "公众号账号的编号", required = true, example = "2048") |
| 21 | private Long accountId; | 20 | private Long accountId; |
| 22 | 21 | ||
| 23 | - @ApiModelProperty(value = "公众号 appId", required = true, example = "wx1234567890ox") | 22 | + @Schema(description = "公众号 appId", required = true, example = "wx1234567890ox") |
| 24 | private String appId; | 23 | private String appId; |
| 25 | 24 | ||
| 26 | - @ApiModelProperty(value = "创建时间", required = true) | 25 | + @Schema(description = "创建时间", required = true) |
| 27 | private Date createTime; | 26 | private Date createTime; |
| 28 | 27 | ||
| 29 | } | 28 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuSaveReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | import javax.validation.Valid; | 6 | import javax.validation.Valid; |
| @@ -9,11 +8,11 @@ import javax.validation.constraints.NotEmpty; | @@ -9,11 +8,11 @@ import javax.validation.constraints.NotEmpty; | ||
| 9 | import javax.validation.constraints.NotNull; | 8 | import javax.validation.constraints.NotNull; |
| 10 | import java.util.List; | 9 | import java.util.List; |
| 11 | 10 | ||
| 12 | -@ApiModel("管理后台 - 公众号菜单保存 Request VO") | 11 | +@Schema(description = "管理后台 - 公众号菜单保存 Request VO") |
| 13 | @Data | 12 | @Data |
| 14 | public class MpMenuSaveReqVO { | 13 | public class MpMenuSaveReqVO { |
| 15 | 14 | ||
| 16 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | 15 | + @Schema(description = "公众号账号的编号", required = true, example = "2048") |
| 17 | @NotNull(message = "公众号账号的编号不能为空") | 16 | @NotNull(message = "公众号账号的编号不能为空") |
| 18 | private Long accountId; | 17 | private Long accountId; |
| 19 | 18 | ||
| @@ -21,7 +20,7 @@ public class MpMenuSaveReqVO { | @@ -21,7 +20,7 @@ public class MpMenuSaveReqVO { | ||
| 21 | @Valid | 20 | @Valid |
| 22 | private List<Menu> menus; | 21 | private List<Menu> menus; |
| 23 | 22 | ||
| 24 | - @ApiModel("管理后台 - 公众号菜单保存时的每个菜单") | 23 | + @Schema(description = "管理后台 - 公众号菜单保存时的每个菜单") |
| 25 | @Data | 24 | @Data |
| 26 | public static class Menu extends MpMenuBaseVO { | 25 | public static class Menu extends MpMenuBaseVO { |
| 27 | 26 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpAutoReplyController.java
| @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.message.vo.message.MpMessageP | @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.message.vo.message.MpMessageP | ||
| 9 | import cn.iocoder.yudao.module.mp.convert.message.MpAutoReplyConvert; | 9 | import cn.iocoder.yudao.module.mp.convert.message.MpAutoReplyConvert; |
| 10 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpAutoReplyDO; | 10 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpAutoReplyDO; |
| 11 | import cn.iocoder.yudao.module.mp.service.message.MpAutoReplyService; | 11 | import cn.iocoder.yudao.module.mp.service.message.MpAutoReplyService; |
| 12 | -import io.swagger.annotations.Api; | ||
| 13 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 14 | -import io.swagger.annotations.ApiOperation; | 12 | +import io.swagger.v3.oas.annotations.Operation; |
| 13 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 14 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 15 | import org.springframework.security.access.prepost.PreAuthorize; | 15 | import org.springframework.security.access.prepost.PreAuthorize; |
| 16 | import org.springframework.validation.annotation.Validated; | 16 | import org.springframework.validation.annotation.Validated; |
| 17 | import org.springframework.web.bind.annotation.*; | 17 | import org.springframework.web.bind.annotation.*; |
| @@ -21,7 +21,7 @@ import javax.validation.Valid; | @@ -21,7 +21,7 @@ import javax.validation.Valid; | ||
| 21 | 21 | ||
| 22 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 22 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 23 | 23 | ||
| 24 | -@Api(tags = "管理后台 - 公众号自动回复") | 24 | +@Tag(name = "管理后台 - 公众号自动回复") |
| 25 | @RestController | 25 | @RestController |
| 26 | @RequestMapping("/mp/auto-reply") | 26 | @RequestMapping("/mp/auto-reply") |
| 27 | @Validated | 27 | @Validated |
| @@ -31,7 +31,7 @@ public class MpAutoReplyController { | @@ -31,7 +31,7 @@ public class MpAutoReplyController { | ||
| 31 | private MpAutoReplyService mpAutoReplyService; | 31 | private MpAutoReplyService mpAutoReplyService; |
| 32 | 32 | ||
| 33 | @GetMapping("/page") | 33 | @GetMapping("/page") |
| 34 | - @ApiOperation("获得公众号自动回复分页") | 34 | + @Operation(summary = "获得公众号自动回复分页") |
| 35 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:query')") | 35 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:query')") |
| 36 | public CommonResult<PageResult<MpAutoReplyRespVO>> getAutoReplyPage(@Valid MpMessagePageReqVO pageVO) { | 36 | public CommonResult<PageResult<MpAutoReplyRespVO>> getAutoReplyPage(@Valid MpMessagePageReqVO pageVO) { |
| 37 | PageResult<MpAutoReplyDO> pageResult = mpAutoReplyService.getAutoReplyPage(pageVO); | 37 | PageResult<MpAutoReplyDO> pageResult = mpAutoReplyService.getAutoReplyPage(pageVO); |
| @@ -39,8 +39,8 @@ public class MpAutoReplyController { | @@ -39,8 +39,8 @@ public class MpAutoReplyController { | ||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | @GetMapping("/get") | 41 | @GetMapping("/get") |
| 42 | - @ApiOperation("获得公众号自动回复") | ||
| 43 | - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | 42 | + @Operation(summary = "获得公众号自动回复") |
| 43 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 44 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:query')") | 44 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:query')") |
| 45 | public CommonResult<MpAutoReplyRespVO> getAutoReply(@RequestParam("id") Long id) { | 45 | public CommonResult<MpAutoReplyRespVO> getAutoReply(@RequestParam("id") Long id) { |
| 46 | MpAutoReplyDO autoReply = mpAutoReplyService.getAutoReply(id); | 46 | MpAutoReplyDO autoReply = mpAutoReplyService.getAutoReply(id); |
| @@ -48,14 +48,14 @@ public class MpAutoReplyController { | @@ -48,14 +48,14 @@ public class MpAutoReplyController { | ||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | @PostMapping("/create") | 50 | @PostMapping("/create") |
| 51 | - @ApiOperation("创建公众号自动回复") | 51 | + @Operation(summary = "创建公众号自动回复") |
| 52 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:create')") | 52 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:create')") |
| 53 | public CommonResult<Long> createAutoReply(@Valid @RequestBody MpAutoReplyCreateReqVO createReqVO) { | 53 | public CommonResult<Long> createAutoReply(@Valid @RequestBody MpAutoReplyCreateReqVO createReqVO) { |
| 54 | return success(mpAutoReplyService.createAutoReply(createReqVO)); | 54 | return success(mpAutoReplyService.createAutoReply(createReqVO)); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | @PutMapping("/update") | 57 | @PutMapping("/update") |
| 58 | - @ApiOperation("更新公众号自动回复") | 58 | + @Operation(summary = "更新公众号自动回复") |
| 59 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:update')") | 59 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:update')") |
| 60 | public CommonResult<Boolean> updateAutoReply(@Valid @RequestBody MpAutoReplyUpdateReqVO updateReqVO) { | 60 | public CommonResult<Boolean> updateAutoReply(@Valid @RequestBody MpAutoReplyUpdateReqVO updateReqVO) { |
| 61 | mpAutoReplyService.updateAutoReply(updateReqVO); | 61 | mpAutoReplyService.updateAutoReply(updateReqVO); |
| @@ -63,8 +63,8 @@ public class MpAutoReplyController { | @@ -63,8 +63,8 @@ public class MpAutoReplyController { | ||
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | @DeleteMapping("/delete") | 65 | @DeleteMapping("/delete") |
| 66 | - @ApiOperation("删除公众号自动回复") | ||
| 67 | - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | 66 | + @Operation(summary = "删除公众号自动回复") |
| 67 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 68 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:delete')") | 68 | @PreAuthorize("@ss.hasPermission('mp:auto-reply:delete')") |
| 69 | public CommonResult<Boolean> deleteAutoReply(@RequestParam("id") Long id) { | 69 | public CommonResult<Boolean> deleteAutoReply(@RequestParam("id") Long id) { |
| 70 | mpAutoReplyService.deleteAutoReply(id); | 70 | mpAutoReplyService.deleteAutoReply(id); |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpMessageController.java
| @@ -8,8 +8,8 @@ import cn.iocoder.yudao.module.mp.controller.admin.message.vo.message.MpMessageS | @@ -8,8 +8,8 @@ import cn.iocoder.yudao.module.mp.controller.admin.message.vo.message.MpMessageS | ||
| 8 | import cn.iocoder.yudao.module.mp.convert.message.MpMessageConvert; | 8 | import cn.iocoder.yudao.module.mp.convert.message.MpMessageConvert; |
| 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; |
| 10 | import cn.iocoder.yudao.module.mp.service.message.MpMessageService; | 10 | import cn.iocoder.yudao.module.mp.service.message.MpMessageService; |
| 11 | -import io.swagger.annotations.Api; | ||
| 12 | -import io.swagger.annotations.ApiOperation; | 11 | +import io.swagger.v3.oas.annotations.Operation; |
| 12 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 13 | import org.springframework.security.access.prepost.PreAuthorize; | 13 | import org.springframework.security.access.prepost.PreAuthorize; |
| 14 | import org.springframework.validation.annotation.Validated; | 14 | import org.springframework.validation.annotation.Validated; |
| 15 | import org.springframework.web.bind.annotation.*; | 15 | import org.springframework.web.bind.annotation.*; |
| @@ -19,7 +19,7 @@ import javax.validation.Valid; | @@ -19,7 +19,7 @@ import javax.validation.Valid; | ||
| 19 | 19 | ||
| 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 21 | ||
| 22 | -@Api(tags = "管理后台 - 公众号消息") | 22 | +@Tag(name = "管理后台 - 公众号消息") |
| 23 | @RestController | 23 | @RestController |
| 24 | @RequestMapping("/mp/message") | 24 | @RequestMapping("/mp/message") |
| 25 | @Validated | 25 | @Validated |
| @@ -29,7 +29,7 @@ public class MpMessageController { | @@ -29,7 +29,7 @@ public class MpMessageController { | ||
| 29 | private MpMessageService mpMessageService; | 29 | private MpMessageService mpMessageService; |
| 30 | 30 | ||
| 31 | @GetMapping("/page") | 31 | @GetMapping("/page") |
| 32 | - @ApiOperation("获得公众号消息分页") | 32 | + @Operation(summary = "获得公众号消息分页") |
| 33 | @PreAuthorize("@ss.hasPermission('mp:message:query')") | 33 | @PreAuthorize("@ss.hasPermission('mp:message:query')") |
| 34 | public CommonResult<PageResult<MpMessageRespVO>> getMessagePage(@Valid MpMessagePageReqVO pageVO) { | 34 | public CommonResult<PageResult<MpMessageRespVO>> getMessagePage(@Valid MpMessagePageReqVO pageVO) { |
| 35 | PageResult<MpMessageDO> pageResult = mpMessageService.getMessagePage(pageVO); | 35 | PageResult<MpMessageDO> pageResult = mpMessageService.getMessagePage(pageVO); |
| @@ -37,7 +37,7 @@ public class MpMessageController { | @@ -37,7 +37,7 @@ public class MpMessageController { | ||
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | @PostMapping("/send") | 39 | @PostMapping("/send") |
| 40 | - @ApiOperation("给粉丝发送消息") | 40 | + @Operation(summary = "给粉丝发送消息") |
| 41 | @PreAuthorize("@ss.hasPermission('mp:message:send')") | 41 | @PreAuthorize("@ss.hasPermission('mp:message:send')") |
| 42 | public CommonResult<MpMessageRespVO> sendMessage(@Valid @RequestBody MpMessageSendReqVO reqVO) { | 42 | public CommonResult<MpMessageRespVO> sendMessage(@Valid @RequestBody MpMessageSendReqVO reqVO) { |
| 43 | MpMessageDO message = mpMessageService.sendKefuMessage(reqVO); | 43 | MpMessageDO message = mpMessageService.sendKefuMessage(reqVO); |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyBaseVO.java
| @@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil; | @@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil; | ||
| 4 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | 4 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; |
| 5 | import cn.iocoder.yudao.module.mp.enums.message.MpAutoReplyTypeEnum; | 5 | import cn.iocoder.yudao.module.mp.enums.message.MpAutoReplyTypeEnum; |
| 6 | import cn.iocoder.yudao.module.mp.framework.mp.core.util.MpUtils.*; | 6 | import cn.iocoder.yudao.module.mp.framework.mp.core.util.MpUtils.*; |
| 7 | -import io.swagger.annotations.ApiModelProperty; | 7 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | import me.chanjar.weixin.common.api.WxConsts; | 9 | import me.chanjar.weixin.common.api.WxConsts; |
| 10 | import org.hibernate.validator.constraints.URL; | 10 | import org.hibernate.validator.constraints.URL; |
| @@ -22,51 +22,50 @@ import java.util.List; | @@ -22,51 +22,50 @@ import java.util.List; | ||
| 22 | @Data | 22 | @Data |
| 23 | public class MpAutoReplyBaseVO { | 23 | public class MpAutoReplyBaseVO { |
| 24 | 24 | ||
| 25 | - @ApiModelProperty(value = "回复类型", example = "1", notes = "参见 MpAutoReplyTypeEnum 枚举") | 25 | + @Schema(description = "回复类型 参见 MpAutoReplyTypeEnum 枚举", example = "1") |
| 26 | @NotNull(message = "回复类型不能为空") | 26 | @NotNull(message = "回复类型不能为空") |
| 27 | private Integer type; | 27 | private Integer type; |
| 28 | 28 | ||
| 29 | // ==================== 请求消息 ==================== | 29 | // ==================== 请求消息 ==================== |
| 30 | 30 | ||
| 31 | - @ApiModelProperty(value = "请求的关键字", example = "关键字", notes = "当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填") | 31 | + @Schema(description = "请求的关键字 当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填", example = "关键字") |
| 32 | private String requestKeyword; | 32 | private String requestKeyword; |
| 33 | - @ApiModelProperty(value = "请求的匹配方式", example = "1", notes = "当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填") | 33 | + @Schema(description = "请求的匹配方式 当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填", example = "1") |
| 34 | private Integer requestMatch; | 34 | private Integer requestMatch; |
| 35 | 35 | ||
| 36 | - @ApiModelProperty(value = "请求的消息类型", example = "text", notes = "当 type 为 MpAutoReplyTypeEnum#MESSAGE 时,必填") | 36 | + @Schema(description = "请求的消息类型 当 type 为 MpAutoReplyTypeEnum#MESSAGE 时,必填", example = "text") |
| 37 | private String requestMessageType; | 37 | private String requestMessageType; |
| 38 | 38 | ||
| 39 | // ==================== 响应消息 ==================== | 39 | // ==================== 响应消息 ==================== |
| 40 | 40 | ||
| 41 | - @ApiModelProperty(value = "回复的消息类型", example = "text", | ||
| 42 | - notes = "枚举 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC") | 41 | + @Schema(description = "回复的消息类型 枚举 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC", example = "text") |
| 43 | @NotEmpty(message = "回复的消息类型不能为空") | 42 | @NotEmpty(message = "回复的消息类型不能为空") |
| 44 | private String responseMessageType; | 43 | private String responseMessageType; |
| 45 | 44 | ||
| 46 | - @ApiModelProperty(value = "回复的消息内容", example = "欢迎关注") | 45 | + @Schema(description = "回复的消息内容", example = "欢迎关注") |
| 47 | @NotEmpty(message = "回复的消息内容不能为空", groups = TextMessageGroup.class) | 46 | @NotEmpty(message = "回复的消息内容不能为空", groups = TextMessageGroup.class) |
| 48 | private String responseContent; | 47 | private String responseContent; |
| 49 | 48 | ||
| 50 | - @ApiModelProperty(value = "回复的媒体 id", example = "123456") | 49 | + @Schema(description = "回复的媒体 id", example = "123456") |
| 51 | @NotEmpty(message = "回复的消息 mediaId 不能为空", | 50 | @NotEmpty(message = "回复的消息 mediaId 不能为空", |
| 52 | groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) | 51 | groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) |
| 53 | private String responseMediaId; | 52 | private String responseMediaId; |
| 54 | - @ApiModelProperty(value = "回复的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") | 53 | + @Schema(description = "回复的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") |
| 55 | @NotEmpty(message = "回复的消息 mediaId 不能为空", | 54 | @NotEmpty(message = "回复的消息 mediaId 不能为空", |
| 56 | groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) | 55 | groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) |
| 57 | private String responseMediaUrl; | 56 | private String responseMediaUrl; |
| 58 | 57 | ||
| 59 | - @ApiModelProperty(value = "缩略图的媒体 id", example = "123456") | 58 | + @Schema(description = "缩略图的媒体 id", example = "123456") |
| 60 | @NotEmpty(message = "回复的消息 thumbMediaId 不能为空", groups = {MusicMessageGroup.class}) | 59 | @NotEmpty(message = "回复的消息 thumbMediaId 不能为空", groups = {MusicMessageGroup.class}) |
| 61 | private String responseThumbMediaId; | 60 | private String responseThumbMediaId; |
| 62 | - @ApiModelProperty(value = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") | 61 | + @Schema(description = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") |
| 63 | @NotEmpty(message = "回复的消息 thumbMedia 地址不能为空", groups = {MusicMessageGroup.class}) | 62 | @NotEmpty(message = "回复的消息 thumbMedia 地址不能为空", groups = {MusicMessageGroup.class}) |
| 64 | private String responseThumbMediaUrl; | 63 | private String responseThumbMediaUrl; |
| 65 | 64 | ||
| 66 | - @ApiModelProperty(value = "回复的标题", example = "视频标题") | 65 | + @Schema(description = "回复的标题", example = "视频标题") |
| 67 | @NotEmpty(message = "回复的消息标题不能为空", groups = VideoMessageGroup.class) | 66 | @NotEmpty(message = "回复的消息标题不能为空", groups = VideoMessageGroup.class) |
| 68 | private String responseTitle; | 67 | private String responseTitle; |
| 69 | - @ApiModelProperty(value = "回复的描述", example = "视频描述") | 68 | + @Schema(description = "回复的描述", example = "视频描述") |
| 70 | @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) | 69 | @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) |
| 71 | private String responseDescription; | 70 | private String responseDescription; |
| 72 | 71 | ||
| @@ -79,11 +78,11 @@ public class MpAutoReplyBaseVO { | @@ -79,11 +78,11 @@ public class MpAutoReplyBaseVO { | ||
| 79 | @Valid | 78 | @Valid |
| 80 | private List<MpMessageDO.Article> responseArticles; | 79 | private List<MpMessageDO.Article> responseArticles; |
| 81 | 80 | ||
| 82 | - @ApiModelProperty(value = "回复的音乐链接", example = "https://www.iocoder.cn/xxx.mp3") | 81 | + @Schema(description = "回复的音乐链接", example = "https://www.iocoder.cn/xxx.mp3") |
| 83 | @NotEmpty(message = "回复的音乐链接不能为空", groups = MusicMessageGroup.class) | 82 | @NotEmpty(message = "回复的音乐链接不能为空", groups = MusicMessageGroup.class) |
| 84 | @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) | 83 | @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) |
| 85 | private String responseMusicUrl; | 84 | private String responseMusicUrl; |
| 86 | - @ApiModelProperty(value = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3") | 85 | + @Schema(description = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3") |
| 87 | @NotEmpty(message = "回复的高质量音乐链接不能为空", groups = MusicMessageGroup.class) | 86 | @NotEmpty(message = "回复的高质量音乐链接不能为空", groups = MusicMessageGroup.class) |
| 88 | @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) | 87 | @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) |
| 89 | private String responseHqMusicUrl; | 88 | private String responseHqMusicUrl; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyCreateReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 6 | import lombok.ToString; |
| 8 | 7 | ||
| 9 | import javax.validation.constraints.NotNull; | 8 | import javax.validation.constraints.NotNull; |
| 10 | 9 | ||
| 11 | -@ApiModel("管理后台 - 公众号自动回复的创建 Request VO") | 10 | +@Schema(description = "管理后台 - 公众号自动回复的创建 Request VO") |
| 12 | @Data | 11 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 15 | public class MpAutoReplyCreateReqVO extends MpAutoReplyBaseVO { | 14 | public class MpAutoReplyCreateReqVO extends MpAutoReplyBaseVO { |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") | 16 | + @Schema(description = "公众号账号的编号", required = true, example = "1024") |
| 18 | @NotNull(message = "公众号账号的编号不能为空") | 17 | @NotNull(message = "公众号账号的编号不能为空") |
| 19 | private Long accountId; | 18 | private Long accountId; |
| 20 | 19 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyPageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 8 | import lombok.ToString; | 7 | import lombok.ToString; |
| 9 | 8 | ||
| 10 | import javax.validation.constraints.NotNull; | 9 | import javax.validation.constraints.NotNull; |
| 11 | 10 | ||
| 12 | -@ApiModel("管理后台 - 公众号自动回复的分页 Request VO") | 11 | +@Schema(description = "管理后台 - 公众号自动回复的分页 Request VO") |
| 13 | @Data | 12 | @Data |
| 14 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| 15 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 16 | public class MpAutoReplyPageReqVO extends PageParam { | 15 | public class MpAutoReplyPageReqVO extends PageParam { |
| 17 | 16 | ||
| 18 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1") | 17 | + @Schema(description = "公众号账号的编号", required = true, example = "1") |
| 19 | @NotNull(message = "公众号账号的编号不能为空") | 18 | @NotNull(message = "公众号账号的编号不能为空") |
| 20 | private Long accountId; | 19 | private Long accountId; |
| 21 | 20 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 6 | import lombok.ToString; |
| 8 | 7 | ||
| 9 | import java.util.Date; | 8 | import java.util.Date; |
| 10 | 9 | ||
| 11 | -@ApiModel("管理后台 - 公众号自动回复 Response VO") | 10 | +@Schema(description = "管理后台 - 公众号自动回复 Response VO") |
| 12 | @Data | 11 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 15 | public class MpAutoReplyRespVO extends MpAutoReplyBaseVO { | 14 | public class MpAutoReplyRespVO extends MpAutoReplyBaseVO { |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "主键", required = true, example = "1024") | 16 | + @Schema(description = "主键", required = true, example = "1024") |
| 18 | private Long id; | 17 | private Long id; |
| 19 | 18 | ||
| 20 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") | 19 | + @Schema(description = "公众号账号的编号", required = true, example = "1024") |
| 21 | private Long accountId; | 20 | private Long accountId; |
| 22 | - @ApiModelProperty(value = "公众号 appId", required = true, example = "wx1234567890") | 21 | + @Schema(description = "公众号 appId", required = true, example = "wx1234567890") |
| 23 | private String appId; | 22 | private String appId; |
| 24 | 23 | ||
| 25 | - @ApiModelProperty(value = "创建时间", required = true) | 24 | + @Schema(description = "创建时间", required = true) |
| 26 | private Date createTime; | 25 | private Date createTime; |
| 27 | 26 | ||
| 28 | } | 27 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyUpdateReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 6 | import lombok.ToString; |
| 8 | 7 | ||
| 9 | import javax.validation.constraints.NotNull; | 8 | import javax.validation.constraints.NotNull; |
| 10 | 9 | ||
| 11 | -@ApiModel("管理后台 - 公众号自动回复的更新 Request VO") | 10 | +@Schema(description = "管理后台 - 公众号自动回复的更新 Request VO") |
| 12 | @Data | 11 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 15 | public class MpAutoReplyUpdateReqVO extends MpAutoReplyBaseVO { | 14 | public class MpAutoReplyUpdateReqVO extends MpAutoReplyBaseVO { |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "主键", required = true, example = "1024") | 16 | + @Schema(description = "主键", required = true, example = "1024") |
| 18 | @NotNull(message = "主键不能为空") | 17 | @NotNull(message = "主键不能为空") |
| 19 | private Long id; | 18 | private Long id; |
| 20 | 19 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessagePageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.message; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.message.vo.message; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import io.swagger.annotations.*; | ||
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.ToString; | ||
| 7 | import org.springframework.format.annotation.DateTimeFormat; | 8 | import org.springframework.format.annotation.DateTimeFormat; |
| 8 | 9 | ||
| 9 | import javax.validation.constraints.NotNull; | 10 | import javax.validation.constraints.NotNull; |
| @@ -11,24 +12,24 @@ import java.time.LocalDateTime; | @@ -11,24 +12,24 @@ import java.time.LocalDateTime; | ||
| 11 | 12 | ||
| 12 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 13 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 13 | 14 | ||
| 14 | -@ApiModel("管理后台 - 公众号消息分页 Request VO") | 15 | +@Schema(description = "管理后台 - 公众号消息分页 Request VO") |
| 15 | @Data | 16 | @Data |
| 16 | @EqualsAndHashCode(callSuper = true) | 17 | @EqualsAndHashCode(callSuper = true) |
| 17 | @ToString(callSuper = true) | 18 | @ToString(callSuper = true) |
| 18 | public class MpMessagePageReqVO extends PageParam { | 19 | public class MpMessagePageReqVO extends PageParam { |
| 19 | 20 | ||
| 20 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") | 21 | + @Schema(description = "公众号账号的编号", required = true, example = "1024") |
| 21 | @NotNull(message = "公众号账号的编号不能为空") | 22 | @NotNull(message = "公众号账号的编号不能为空") |
| 22 | private Long accountId; | 23 | private Long accountId; |
| 23 | 24 | ||
| 24 | - @ApiModelProperty(value = "消息类型", example = "text", notes = "参见 WxConsts.XmlMsgType 枚举") | 25 | + @Schema(description = "消息类型 参见 WxConsts.XmlMsgType 枚举", example = "text") |
| 25 | private String type; | 26 | private String type; |
| 26 | 27 | ||
| 27 | - @ApiModelProperty(value = "公众号粉丝标识", example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") | 28 | + @Schema(description = "公众号粉丝标识", example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") |
| 28 | private String openid; | 29 | private String openid; |
| 29 | 30 | ||
| 30 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 31 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 31 | - @ApiModelProperty(value = "创建时间") | 32 | + @Schema(description = "创建时间") |
| 32 | private LocalDateTime[] createTime; | 33 | private LocalDateTime[] createTime; |
| 33 | 34 | ||
| 34 | } | 35 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageRespVO.java
| @@ -2,80 +2,77 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.message; | @@ -2,80 +2,77 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.message; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | 3 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; |
| 4 | import com.baomidou.mybatisplus.annotation.TableField; | 4 | import com.baomidou.mybatisplus.annotation.TableField; |
| 5 | -import io.swagger.annotations.ApiModel; | ||
| 6 | -import io.swagger.annotations.ApiModelProperty; | 5 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 7 | import lombok.Data; | 6 | import lombok.Data; |
| 8 | import me.chanjar.weixin.common.api.WxConsts; | 7 | import me.chanjar.weixin.common.api.WxConsts; |
| 9 | 8 | ||
| 10 | import java.util.Date; | 9 | import java.util.Date; |
| 11 | import java.util.List; | 10 | import java.util.List; |
| 12 | 11 | ||
| 13 | -@ApiModel("管理后台 - 公众号消息 Response VO") | 12 | +@Schema(description = "管理后台 - 公众号消息 Response VO") |
| 14 | @Data | 13 | @Data |
| 15 | public class MpMessageRespVO { | 14 | public class MpMessageRespVO { |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "主键", required = true, example = "1024") | 16 | + @Schema(description = "主键", required = true, example = "1024") |
| 18 | private Integer id; | 17 | private Integer id; |
| 19 | 18 | ||
| 20 | - @ApiModelProperty(value = "微信公众号消息 id", required = true, example = "23953173569869169") | 19 | + @Schema(description = "微信公众号消息 id", required = true, example = "23953173569869169") |
| 21 | private Long msgId; | 20 | private Long msgId; |
| 22 | 21 | ||
| 23 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1") | 22 | + @Schema(description = "公众号账号的编号", required = true, example = "1") |
| 24 | private Long accountId; | 23 | private Long accountId; |
| 25 | - @ApiModelProperty(value = "公众号账号的 appid", required = true, example = "wx1234567890") | 24 | + @Schema(description = "公众号账号的 appid", required = true, example = "wx1234567890") |
| 26 | private String appId; | 25 | private String appId; |
| 27 | 26 | ||
| 28 | - @ApiModelProperty(value = "公众号粉丝编号", required = true, example = "2048") | 27 | + @Schema(description = "公众号粉丝编号", required = true, example = "2048") |
| 29 | private Long userId; | 28 | private Long userId; |
| 30 | - @ApiModelProperty(value = "公众号粉丝标志", required = true, example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") | 29 | + @Schema(description = "公众号粉丝标志", required = true, example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") |
| 31 | private String openid; | 30 | private String openid; |
| 32 | 31 | ||
| 33 | - @ApiModelProperty(value = "消息类型", required = true, example = "text", notes = "参见 WxConsts.XmlMsgType 枚举") | 32 | + @Schema(description = "消息类型 参见 WxConsts.XmlMsgType 枚举", required = true, example = "text") |
| 34 | private String type; | 33 | private String type; |
| 35 | - @ApiModelProperty(value = "消息来源", required = true, example = "1", notes = "参见 MpMessageSendFromEnum 枚举") | 34 | + @Schema(description = "消息来源 参见 MpMessageSendFromEnum 枚举", required = true, example = "1") |
| 36 | private Integer sendFrom; | 35 | private Integer sendFrom; |
| 37 | 36 | ||
| 38 | // ========= 普通消息内容 https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html | 37 | // ========= 普通消息内容 https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html |
| 39 | 38 | ||
| 40 | - @ApiModelProperty(value = "消息内容", example = "你好呀", notes = "消息类型为 text 时,才有值") | 39 | + @Schema(description = "消息内容 消息类型为 text 时,才有值", example = "你好呀") |
| 41 | private String content; | 40 | private String content; |
| 42 | 41 | ||
| 43 | - @ApiModelProperty(value = "媒体素材的编号", example = "1234567890", notes = "消息类型为 image、voice、video 时,才有值") | 42 | + @Schema(description = "媒体素材的编号 消息类型为 image、voice、video 时,才有值", example = "1234567890") |
| 44 | private String mediaId; | 43 | private String mediaId; |
| 45 | - @ApiModelProperty(value = "媒体文件的 URL", example = "https://www.iocoder.cn/xxx.png", | ||
| 46 | - notes = "消息类型为 image、voice、video 时,才有值") | 44 | + @Schema(description = "媒体文件的 URL 消息类型为 image、voice、video 时,才有值", example = "https://www.iocoder.cn/xxx.png") |
| 47 | private String mediaUrl; | 45 | private String mediaUrl; |
| 48 | 46 | ||
| 49 | - @ApiModelProperty(value = "语音识别后文本", example = "语音识别后文本", notes = "消息类型为 voice 时,才有值") | 47 | + @Schema(description = "语音识别后文本 消息类型为 voice 时,才有值", example = "语音识别后文本") |
| 50 | private String recognition; | 48 | private String recognition; |
| 51 | - @ApiModelProperty(value = "语音格式", example = "amr", notes = "消息类型为 voice 时,才有值") | 49 | + @Schema(description = "语音格式 消息类型为 voice 时,才有值", example = "amr") |
| 52 | private String format; | 50 | private String format; |
| 53 | 51 | ||
| 54 | - @ApiModelProperty(value = "标题", example = "我是标题", notes = "消息类型为 video、music、link 时,才有值") | 52 | + @Schema(description = "标题 消息类型为 video、music、link 时,才有值", example = "我是标题") |
| 55 | private String title; | 53 | private String title; |
| 56 | 54 | ||
| 57 | - @ApiModelProperty(value = "描述", example = "我是描述", notes = "消息类型为 video、music 时,才有值") | 55 | + @Schema(description = "描述 消息类型为 video、music 时,才有值", example = "我是描述") |
| 58 | private String description; | 56 | private String description; |
| 59 | 57 | ||
| 60 | - @ApiModelProperty(value = "缩略图的媒体 id", example = "1234567890", notes = "消息类型为 video、music 时,才有值") | 58 | + @Schema(description = "缩略图的媒体 id 消息类型为 video、music 时,才有值", example = "1234567890") |
| 61 | private String thumbMediaId; | 59 | private String thumbMediaId; |
| 62 | - @ApiModelProperty(value = "缩略图的媒体 URL", example = "https://www.iocoder.cn/xxx.png", | ||
| 63 | - notes = "消息类型为 video、music 时,才有值") | 60 | + @Schema(description = "缩略图的媒体 URL 消息类型为 video、music 时,才有值", example = "https://www.iocoder.cn/xxx.png") |
| 64 | private String thumbMediaUrl; | 61 | private String thumbMediaUrl; |
| 65 | 62 | ||
| 66 | - @ApiModelProperty(value = "点击图文消息跳转链接", example = "https://www.iocoder.cn", notes = "消息类型为 link 时,才有值") | 63 | + @Schema(description = "点击图文消息跳转链接 消息类型为 link 时,才有值", example = "https://www.iocoder.cn") |
| 67 | private String url; | 64 | private String url; |
| 68 | 65 | ||
| 69 | - @ApiModelProperty(value = "地理位置维度", example = "23.137466", notes = "消息类型为 location 时,才有值") | 66 | + @Schema(description = "地理位置维度 消息类型为 location 时,才有值", example = "23.137466") |
| 70 | private Double locationX; | 67 | private Double locationX; |
| 71 | 68 | ||
| 72 | - @ApiModelProperty(value = "地理位置经度", example = "113.352425", notes = "消息类型为 location 时,才有值") | 69 | + @Schema(description = "地理位置经度 消息类型为 location 时,才有值", example = "113.352425") |
| 73 | private Double locationY; | 70 | private Double locationY; |
| 74 | 71 | ||
| 75 | - @ApiModelProperty(value = "地图缩放大小", example = "13", notes = "消息类型为 location 时,才有值") | 72 | + @Schema(description = "地图缩放大小 消息类型为 location 时,才有值", example = "13") |
| 76 | private Double scale; | 73 | private Double scale; |
| 77 | 74 | ||
| 78 | - @ApiModelProperty(value = "详细地址", example = "杨浦区黄兴路 221-4 号临", notes = "消息类型为 location 时,才有值") | 75 | + @Schema(description = "详细地址 消息类型为 location 时,才有值", example = "杨浦区黄兴路 221-4 号临") |
| 79 | private String label; | 76 | private String label; |
| 80 | 77 | ||
| 81 | /** | 78 | /** |
| @@ -86,19 +83,19 @@ public class MpMessageRespVO { | @@ -86,19 +83,19 @@ public class MpMessageRespVO { | ||
| 86 | @TableField(typeHandler = MpMessageDO.ArticleTypeHandler.class) | 83 | @TableField(typeHandler = MpMessageDO.ArticleTypeHandler.class) |
| 87 | private List<MpMessageDO.Article> articles; | 84 | private List<MpMessageDO.Article> articles; |
| 88 | 85 | ||
| 89 | - @ApiModelProperty(value = "音乐链接", example = "https://www.iocoder.cn/xxx.mp3", notes = "消息类型为 music 时,才有值") | 86 | + @Schema(description = "音乐链接 消息类型为 music 时,才有值", example = "https://www.iocoder.cn/xxx.mp3") |
| 90 | private String musicUrl; | 87 | private String musicUrl; |
| 91 | - @ApiModelProperty(value = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3", notes = "消息类型为 music 时,才有值") | 88 | + @Schema(description = "高质量音乐链接 消息类型为 music 时,才有值", example = "https://www.iocoder.cn/xxx.mp3") |
| 92 | private String hqMusicUrl; | 89 | private String hqMusicUrl; |
| 93 | 90 | ||
| 94 | // ========= 事件推送 https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html | 91 | // ========= 事件推送 https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html |
| 95 | 92 | ||
| 96 | - @ApiModelProperty(value = "事件类型", example = "subscribe", notes = "参见 WxConsts.EventType 枚举") | 93 | + @Schema(description = "事件类型 参见 WxConsts.EventType 枚举", example = "subscribe") |
| 97 | private String event; | 94 | private String event; |
| 98 | - @ApiModelProperty(value = "事件 Key", example = "qrscene_123456", notes = "参见 WxConsts.EventType 枚举") | 95 | + @Schema(description = "事件 Key 参见 WxConsts.EventType 枚举", example = "qrscene_123456") |
| 99 | private String eventKey; | 96 | private String eventKey; |
| 100 | 97 | ||
| 101 | - @ApiModelProperty(value = "创建时间", required = true) | 98 | + @Schema(description = "创建时间", required = true) |
| 102 | private Date createTime; | 99 | private Date createTime; |
| 103 | 100 | ||
| 104 | } | 101 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageSendReqVO.java
| @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.message; | @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.message; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | 3 | import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; |
| 4 | import cn.iocoder.yudao.module.mp.framework.mp.core.util.MpUtils.*; | 4 | import cn.iocoder.yudao.module.mp.framework.mp.core.util.MpUtils.*; |
| 5 | -import io.swagger.annotations.ApiModel; | ||
| 6 | -import io.swagger.annotations.ApiModelProperty; | 5 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 7 | import lombok.Data; | 6 | import lombok.Data; |
| 8 | 7 | ||
| 9 | import javax.validation.Valid; | 8 | import javax.validation.Valid; |
| @@ -11,49 +10,49 @@ import javax.validation.constraints.NotEmpty; | @@ -11,49 +10,49 @@ import javax.validation.constraints.NotEmpty; | ||
| 11 | import javax.validation.constraints.NotNull; | 10 | import javax.validation.constraints.NotNull; |
| 12 | import java.util.List; | 11 | import java.util.List; |
| 13 | 12 | ||
| 14 | -@ApiModel("管理后台 - 公众号消息发送 Request VO") | 13 | +@Schema(description = "管理后台 - 公众号消息发送 Request VO") |
| 15 | @Data | 14 | @Data |
| 16 | public class MpMessageSendReqVO { | 15 | public class MpMessageSendReqVO { |
| 17 | 16 | ||
| 18 | - @ApiModelProperty(value = "公众号粉丝的编号", required = true, example = "1024") | 17 | + @Schema(description = "公众号粉丝的编号", required = true, example = "1024") |
| 19 | @NotNull(message = "公众号粉丝的编号不能为空") | 18 | @NotNull(message = "公众号粉丝的编号不能为空") |
| 20 | private Long userId; | 19 | private Long userId; |
| 21 | 20 | ||
| 22 | // ========== 消息内容 ========== | 21 | // ========== 消息内容 ========== |
| 23 | 22 | ||
| 24 | - @ApiModelProperty(value = "消息类型", required = true, example = "text", notes = "TEXT/IMAGE/VOICE/VIDEO/NEWS") | 23 | + @Schema(description = "消息类型 TEXT/IMAGE/VOICE/VIDEO/NEWS", required = true, example = "text") |
| 25 | @NotEmpty(message = "消息类型不能为空") | 24 | @NotEmpty(message = "消息类型不能为空") |
| 26 | public String type; | 25 | public String type; |
| 27 | 26 | ||
| 28 | - @ApiModelProperty(value = "消息内容", required = true, example = "你好呀") | 27 | + @Schema(description = "消息内容", required = true, example = "你好呀") |
| 29 | @NotEmpty(message = "消息内容不能为空", groups = TextMessageGroup.class) | 28 | @NotEmpty(message = "消息内容不能为空", groups = TextMessageGroup.class) |
| 30 | private String content; | 29 | private String content; |
| 31 | 30 | ||
| 32 | - @ApiModelProperty(value = "媒体 ID", required = true, example = "qqc_2Fot30Jse-HDoZmo5RrUDijz2nGUkP") | 31 | + @Schema(description = "媒体 ID", required = true, example = "qqc_2Fot30Jse-HDoZmo5RrUDijz2nGUkP") |
| 33 | @NotEmpty(message = "消息内容不能为空", groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) | 32 | @NotEmpty(message = "消息内容不能为空", groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) |
| 34 | private String mediaId; | 33 | private String mediaId; |
| 35 | 34 | ||
| 36 | - @ApiModelProperty(value = "标题", required = true, example = "没有标题") | 35 | + @Schema(description = "标题", required = true, example = "没有标题") |
| 37 | @NotEmpty(message = "消息内容不能为空", groups = VideoMessageGroup.class) | 36 | @NotEmpty(message = "消息内容不能为空", groups = VideoMessageGroup.class) |
| 38 | private String title; | 37 | private String title; |
| 39 | 38 | ||
| 40 | - @ApiModelProperty(value = "描述", required = true, example = "你猜") | 39 | + @Schema(description = "描述", required = true, example = "你猜") |
| 41 | @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) | 40 | @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) |
| 42 | private String description; | 41 | private String description; |
| 43 | 42 | ||
| 44 | - @ApiModelProperty(value = "缩略图的媒体 id", required = true, example = "qqc_2Fot30Jse-HDoZmo5RrUDijz2nGUkP") | 43 | + @Schema(description = "缩略图的媒体 id", required = true, example = "qqc_2Fot30Jse-HDoZmo5RrUDijz2nGUkP") |
| 45 | @NotEmpty(message = "缩略图的媒体 id 不能为空", groups = MusicMessageGroup.class) | 44 | @NotEmpty(message = "缩略图的媒体 id 不能为空", groups = MusicMessageGroup.class) |
| 46 | private String thumbMediaId; | 45 | private String thumbMediaId; |
| 47 | 46 | ||
| 48 | - @ApiModelProperty(value = "图文消息", required = true) | 47 | + @Schema(description = "图文消息", required = true) |
| 49 | @Valid | 48 | @Valid |
| 50 | @NotNull(message = "图文消息不能为空", groups = NewsMessageGroup.class) | 49 | @NotNull(message = "图文消息不能为空", groups = NewsMessageGroup.class) |
| 51 | private List<MpMessageDO.Article> articles; | 50 | private List<MpMessageDO.Article> articles; |
| 52 | 51 | ||
| 53 | - @ApiModelProperty(value = "音乐链接", example = "https://www.iocoder.cn/music.mp3", notes = "消息类型为 MUSIC 时") | 52 | + @Schema(description = "音乐链接 消息类型为 MUSIC 时", example = "https://www.iocoder.cn/music.mp3") |
| 54 | private String musicUrl; | 53 | private String musicUrl; |
| 55 | 54 | ||
| 56 | - @ApiModelProperty(value = "高质量音乐链接", example = "https://www.iocoder.cn/music.mp3", notes = "消息类型为 MUSIC 时") | 55 | + @Schema(description = "高质量音乐链接 消息类型为 MUSIC 时", example = "https://www.iocoder.cn/music.mp3") |
| 57 | private String hqMusicUrl; | 56 | private String hqMusicUrl; |
| 58 | 57 | ||
| 59 | } | 58 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.java
| @@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.mp.controller.admin.news.vo.MpDraftPageReqVO; | @@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.mp.controller.admin.news.vo.MpDraftPageReqVO; | ||
| 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.material.MpMaterialDO; | 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.material.MpMaterialDO; |
| 10 | import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; | 10 | import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; |
| 11 | import cn.iocoder.yudao.module.mp.service.material.MpMaterialService; | 11 | import cn.iocoder.yudao.module.mp.service.material.MpMaterialService; |
| 12 | -import io.swagger.annotations.Api; | ||
| 13 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 14 | -import io.swagger.annotations.ApiImplicitParams; | ||
| 15 | -import io.swagger.annotations.ApiOperation; | 12 | +import io.swagger.v3.oas.annotations.Operation; |
| 13 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 14 | +import io.swagger.v3.oas.annotations.Parameters; | ||
| 15 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 16 | import me.chanjar.weixin.common.error.WxErrorException; | 16 | import me.chanjar.weixin.common.error.WxErrorException; |
| 17 | import me.chanjar.weixin.mp.api.WxMpService; | 17 | import me.chanjar.weixin.mp.api.WxMpService; |
| 18 | import me.chanjar.weixin.mp.bean.draft.*; | 18 | import me.chanjar.weixin.mp.bean.draft.*; |
| @@ -31,7 +31,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | @@ -31,7 +31,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 31 | import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen; | 31 | import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen; |
| 32 | import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; | 32 | import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; |
| 33 | 33 | ||
| 34 | -@Api(tags = "管理后台 - 公众号草稿") | 34 | +@Tag(name = "管理后台 - 公众号草稿") |
| 35 | @RestController | 35 | @RestController |
| 36 | @RequestMapping("/mp/draft") | 36 | @RequestMapping("/mp/draft") |
| 37 | @Validated | 37 | @Validated |
| @@ -44,7 +44,7 @@ public class MpDraftController { | @@ -44,7 +44,7 @@ public class MpDraftController { | ||
| 44 | private MpMaterialService mpMaterialService; | 44 | private MpMaterialService mpMaterialService; |
| 45 | 45 | ||
| 46 | @GetMapping("/page") | 46 | @GetMapping("/page") |
| 47 | - @ApiOperation("获得草稿分页") | 47 | + @Operation(summary = "获得草稿分页") |
| 48 | @PreAuthorize("@ss.hasPermission('mp:draft:query')") | 48 | @PreAuthorize("@ss.hasPermission('mp:draft:query')") |
| 49 | public CommonResult<PageResult<WxMpDraftItem>> getDraftPage(MpDraftPageReqVO reqVO) { | 49 | public CommonResult<PageResult<WxMpDraftItem>> getDraftPage(MpDraftPageReqVO reqVO) { |
| 50 | // 从公众号查询草稿箱 | 50 | // 从公众号查询草稿箱 |
| @@ -79,9 +79,8 @@ public class MpDraftController { | @@ -79,9 +79,8 @@ public class MpDraftController { | ||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | @PostMapping("/create") | 81 | @PostMapping("/create") |
| 82 | - @ApiOperation("创建草稿") | ||
| 83 | - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, | ||
| 84 | - example = "1024", dataTypeClass = Long.class) | 82 | + @Operation(summary = "创建草稿") |
| 83 | + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024") | ||
| 85 | @PreAuthorize("@ss.hasPermission('mp:draft:create')") | 84 | @PreAuthorize("@ss.hasPermission('mp:draft:create')") |
| 86 | public CommonResult<String> deleteDraft(@RequestParam("accountId") Long accountId, | 85 | public CommonResult<String> deleteDraft(@RequestParam("accountId") Long accountId, |
| 87 | @RequestBody WxMpAddDraft draft) { | 86 | @RequestBody WxMpAddDraft draft) { |
| @@ -95,12 +94,10 @@ public class MpDraftController { | @@ -95,12 +94,10 @@ public class MpDraftController { | ||
| 95 | } | 94 | } |
| 96 | 95 | ||
| 97 | @PutMapping("/update") | 96 | @PutMapping("/update") |
| 98 | - @ApiOperation("更新草稿") | ||
| 99 | - @ApiImplicitParams({ | ||
| 100 | - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, | ||
| 101 | - example = "1024", dataTypeClass = Long.class), | ||
| 102 | - @ApiImplicitParam(name = "mediaId", value = "草稿素材的编号", required = true, | ||
| 103 | - example = "xxx", dataTypeClass = String.class), | 97 | + @Operation(summary = "更新草稿") |
| 98 | + @Parameters({ | ||
| 99 | + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024"), | ||
| 100 | + @Parameter(name = "mediaId", description = "草稿素材的编号", required = true, example = "xxx") | ||
| 104 | }) | 101 | }) |
| 105 | @PreAuthorize("@ss.hasPermission('mp:draft:update')") | 102 | @PreAuthorize("@ss.hasPermission('mp:draft:update')") |
| 106 | public CommonResult<Boolean> deleteDraft(@RequestParam("accountId") Long accountId, | 103 | public CommonResult<Boolean> deleteDraft(@RequestParam("accountId") Long accountId, |
| @@ -119,12 +116,10 @@ public class MpDraftController { | @@ -119,12 +116,10 @@ public class MpDraftController { | ||
| 119 | } | 116 | } |
| 120 | 117 | ||
| 121 | @DeleteMapping("/delete") | 118 | @DeleteMapping("/delete") |
| 122 | - @ApiOperation("删除草稿") | ||
| 123 | - @ApiImplicitParams({ | ||
| 124 | - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, | ||
| 125 | - example = "1024", dataTypeClass = Long.class), | ||
| 126 | - @ApiImplicitParam(name = "mediaId", value = "草稿素材的编号", required = true, | ||
| 127 | - example = "xxx", dataTypeClass = String.class), | 119 | + @Operation(summary = "删除草稿") |
| 120 | + @Parameters({ | ||
| 121 | + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024"), | ||
| 122 | + @Parameter(name = "mediaId", description = "草稿素材的编号", required = true, example = "xxx") | ||
| 128 | }) | 123 | }) |
| 129 | @PreAuthorize("@ss.hasPermission('mp:draft:delete')") | 124 | @PreAuthorize("@ss.hasPermission('mp:draft:delete')") |
| 130 | public CommonResult<Boolean> deleteDraft(@RequestParam("accountId") Long accountId, | 125 | public CommonResult<Boolean> deleteDraft(@RequestParam("accountId") Long accountId, |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.java
| @@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.mp.controller.admin.news.vo.MpFreePublishPageReqV | @@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.mp.controller.admin.news.vo.MpFreePublishPageReqV | ||
| 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.material.MpMaterialDO; | 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.material.MpMaterialDO; |
| 10 | import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; | 10 | import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; |
| 11 | import cn.iocoder.yudao.module.mp.service.material.MpMaterialService; | 11 | import cn.iocoder.yudao.module.mp.service.material.MpMaterialService; |
| 12 | -import io.swagger.annotations.Api; | ||
| 13 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 14 | -import io.swagger.annotations.ApiImplicitParams; | ||
| 15 | -import io.swagger.annotations.ApiOperation; | 12 | +import io.swagger.v3.oas.annotations.Operation; |
| 13 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 14 | +import io.swagger.v3.oas.annotations.Parameters; | ||
| 15 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 16 | import me.chanjar.weixin.common.error.WxErrorException; | 16 | import me.chanjar.weixin.common.error.WxErrorException; |
| 17 | import me.chanjar.weixin.mp.api.WxMpService; | 17 | import me.chanjar.weixin.mp.api.WxMpService; |
| 18 | import me.chanjar.weixin.mp.bean.freepublish.WxMpFreePublishItem; | 18 | import me.chanjar.weixin.mp.bean.freepublish.WxMpFreePublishItem; |
| @@ -32,7 +32,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | @@ -32,7 +32,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 32 | import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen; | 32 | import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen; |
| 33 | import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; | 33 | import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; |
| 34 | 34 | ||
| 35 | -@Api(tags = "管理后台 - 公众号发布能力") | 35 | +@Tag(name = "管理后台 - 公众号发布能力") |
| 36 | @RestController | 36 | @RestController |
| 37 | @RequestMapping("/mp/free-publish") | 37 | @RequestMapping("/mp/free-publish") |
| 38 | @Validated | 38 | @Validated |
| @@ -45,7 +45,7 @@ public class MpFreePublishController { | @@ -45,7 +45,7 @@ public class MpFreePublishController { | ||
| 45 | private MpMaterialService mpMaterialService; | 45 | private MpMaterialService mpMaterialService; |
| 46 | 46 | ||
| 47 | @GetMapping("/page") | 47 | @GetMapping("/page") |
| 48 | - @ApiOperation("获得已发布的图文分页") | 48 | + @Operation(summary = "获得已发布的图文分页") |
| 49 | @PreAuthorize("@ss.hasPermission('mp:free-publish:query')") | 49 | @PreAuthorize("@ss.hasPermission('mp:free-publish:query')") |
| 50 | public CommonResult<PageResult<WxMpFreePublishItem>> getFreePublishPage(MpFreePublishPageReqVO reqVO) { | 50 | public CommonResult<PageResult<WxMpFreePublishItem>> getFreePublishPage(MpFreePublishPageReqVO reqVO) { |
| 51 | // 从公众号查询已发布的图文列表 | 51 | // 从公众号查询已发布的图文列表 |
| @@ -81,12 +81,10 @@ public class MpFreePublishController { | @@ -81,12 +81,10 @@ public class MpFreePublishController { | ||
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | @PostMapping("/submit") | 83 | @PostMapping("/submit") |
| 84 | - @ApiOperation("发布草稿") | ||
| 85 | - @ApiImplicitParams({ | ||
| 86 | - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, | ||
| 87 | - example = "1024", dataTypeClass = Long.class), | ||
| 88 | - @ApiImplicitParam(name = "mediaId", value = "要发布的草稿的 media_id", required = true, | ||
| 89 | - example = "2048", dataTypeClass = String.class) | 84 | + @Operation(summary = "发布草稿") |
| 85 | + @Parameters({ | ||
| 86 | + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024"), | ||
| 87 | + @Parameter(name = "mediaId", description = "要发布的草稿的 media_id", required = true, example = "2048") | ||
| 90 | }) | 88 | }) |
| 91 | @PreAuthorize("@ss.hasPermission('mp:free-publish:submit')") | 89 | @PreAuthorize("@ss.hasPermission('mp:free-publish:submit')") |
| 92 | public CommonResult<String> submitFreePublish(@RequestParam("accountId") Long accountId, | 90 | public CommonResult<String> submitFreePublish(@RequestParam("accountId") Long accountId, |
| @@ -101,12 +99,10 @@ public class MpFreePublishController { | @@ -101,12 +99,10 @@ public class MpFreePublishController { | ||
| 101 | } | 99 | } |
| 102 | 100 | ||
| 103 | @DeleteMapping("/delete") | 101 | @DeleteMapping("/delete") |
| 104 | - @ApiOperation("删除草稿") | ||
| 105 | - @ApiImplicitParams({ | ||
| 106 | - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, | ||
| 107 | - example = "1024", dataTypeClass = Long.class), | ||
| 108 | - @ApiImplicitParam(name = "articleId", value = "发布记录的编号", required = true, | ||
| 109 | - example = "2048", dataTypeClass = String.class) | 102 | + @Operation(summary = "删除草稿") |
| 103 | + @Parameters({ | ||
| 104 | + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024"), | ||
| 105 | + @Parameter(name = "articleId", description = "发布记录的编号", required = true, example = "2048") | ||
| 110 | }) | 106 | }) |
| 111 | @PreAuthorize("@ss.hasPermission('mp:free-publish:delete')") | 107 | @PreAuthorize("@ss.hasPermission('mp:free-publish:delete')") |
| 112 | public CommonResult<Boolean> deleteFreePublish(@RequestParam("accountId") Long accountId, | 108 | public CommonResult<Boolean> deleteFreePublish(@RequestParam("accountId") Long accountId, |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpDraftPageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.news.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.news.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 8 | import lombok.ToString; | 7 | import lombok.ToString; |
| 9 | 8 | ||
| 10 | import javax.validation.constraints.NotNull; | 9 | import javax.validation.constraints.NotNull; |
| 11 | 10 | ||
| 12 | -@ApiModel("管理后台 - 公众号草稿的分页 Request VO") | 11 | +@Schema(description = "管理后台 - 公众号草稿的分页 Request VO") |
| 13 | @Data | 12 | @Data |
| 14 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| 15 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 16 | public class MpDraftPageReqVO extends PageParam { | 15 | public class MpDraftPageReqVO extends PageParam { |
| 17 | 16 | ||
| 18 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") | 17 | + @Schema(description = "公众号账号的编号", required = true, example = "1024") |
| 19 | @NotNull(message = "公众号账号的编号不能为空") | 18 | @NotNull(message = "公众号账号的编号不能为空") |
| 20 | private Long accountId; | 19 | private Long accountId; |
| 21 | 20 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpFreePublishPageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.news.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.news.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 8 | import lombok.ToString; | 7 | import lombok.ToString; |
| 9 | 8 | ||
| 10 | import javax.validation.constraints.NotNull; | 9 | import javax.validation.constraints.NotNull; |
| 11 | 10 | ||
| 12 | -@ApiModel("管理后台 - 公众号已发布列表的分页 Request VO") | 11 | +@Schema(description = "管理后台 - 公众号已发布列表的分页 Request VO") |
| 13 | @Data | 12 | @Data |
| 14 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| 15 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 16 | public class MpFreePublishPageReqVO extends PageParam { | 15 | public class MpFreePublishPageReqVO extends PageParam { |
| 17 | 16 | ||
| 18 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") | 17 | + @Schema(description = "公众号账号的编号", required = true, example = "1024") |
| 19 | @NotNull(message = "公众号账号的编号不能为空") | 18 | @NotNull(message = "公众号账号的编号不能为空") |
| 20 | private Long accountId; | 19 | private Long accountId; |
| 21 | 20 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java
| @@ -10,8 +10,8 @@ import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | @@ -10,8 +10,8 @@ import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | ||
| 10 | import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; | 10 | import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; |
| 11 | import cn.iocoder.yudao.module.mp.framework.mp.core.context.MpContextHolder; | 11 | import cn.iocoder.yudao.module.mp.framework.mp.core.context.MpContextHolder; |
| 12 | import cn.iocoder.yudao.module.mp.service.account.MpAccountService; | 12 | import cn.iocoder.yudao.module.mp.service.account.MpAccountService; |
| 13 | -import io.swagger.annotations.Api; | ||
| 14 | -import io.swagger.annotations.ApiOperation; | 13 | +import io.swagger.v3.oas.annotations.Operation; |
| 14 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 15 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
| 16 | import me.chanjar.weixin.mp.api.WxMpMessageRouter; | 16 | import me.chanjar.weixin.mp.api.WxMpMessageRouter; |
| 17 | import me.chanjar.weixin.mp.api.WxMpService; | 17 | import me.chanjar.weixin.mp.api.WxMpService; |
| @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*; | @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*; | ||
| 23 | import javax.annotation.Resource; | 23 | import javax.annotation.Resource; |
| 24 | import java.util.Objects; | 24 | import java.util.Objects; |
| 25 | 25 | ||
| 26 | -@Api(tags = "管理后台 - 公众号回调") | 26 | +@Tag(name = "管理后台 - 公众号回调") |
| 27 | @RestController | 27 | @RestController |
| 28 | @RequestMapping("/mp/open") | 28 | @RequestMapping("/mp/open") |
| 29 | @Validated | 29 | @Validated |
| @@ -41,7 +41,7 @@ public class MpOpenController { | @@ -41,7 +41,7 @@ public class MpOpenController { | ||
| 41 | * | 41 | * |
| 42 | * 对应 <a href="https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html">文档</a> | 42 | * 对应 <a href="https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html">文档</a> |
| 43 | */ | 43 | */ |
| 44 | - @ApiOperation("校验签名") // 参见 | 44 | + @Operation(summary = "校验签名") // 参见 |
| 45 | @GetMapping(value = "/{appId}", produces = "text/plain;charset=utf-8") | 45 | @GetMapping(value = "/{appId}", produces = "text/plain;charset=utf-8") |
| 46 | public String checkSignature(@PathVariable("appId") String appId, | 46 | public String checkSignature(@PathVariable("appId") String appId, |
| 47 | MpOpenCheckSignatureReqVO reqVO) { | 47 | MpOpenCheckSignatureReqVO reqVO) { |
| @@ -61,7 +61,7 @@ public class MpOpenController { | @@ -61,7 +61,7 @@ public class MpOpenController { | ||
| 61 | * | 61 | * |
| 62 | * <a href="https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html">文档</a> | 62 | * <a href="https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html">文档</a> |
| 63 | */ | 63 | */ |
| 64 | - @ApiOperation("处理消息") | 64 | + @Operation(summary = "处理消息") |
| 65 | @PostMapping(value = "/{appId}", produces = "application/xml; charset=UTF-8") | 65 | @PostMapping(value = "/{appId}", produces = "application/xml; charset=UTF-8") |
| 66 | @OperateLog(enable = false) // 回调地址,无需记录操作日志 | 66 | @OperateLog(enable = false) // 回调地址,无需记录操作日志 |
| 67 | public String handleMessage(@PathVariable("appId") String appId, | 67 | public String handleMessage(@PathVariable("appId") String appId, |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenCheckSignatureReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.open.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.open.vo; |
| 2 | 2 | ||
| 3 | - | ||
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 4 | import lombok.Data; |
| 7 | -import lombok.EqualsAndHashCode; | ||
| 8 | -import lombok.ToString; | ||
| 9 | -import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | 5 | ||
| 11 | import javax.validation.constraints.NotEmpty; | 6 | import javax.validation.constraints.NotEmpty; |
| 12 | 7 | ||
| 13 | -@ApiModel("管理后台 - 公众号校验签名 Request VO") | 8 | +@Schema(description = "管理后台 - 公众号校验签名 Request VO") |
| 14 | @Data | 9 | @Data |
| 15 | public class MpOpenCheckSignatureReqVO { | 10 | public class MpOpenCheckSignatureReqVO { |
| 16 | 11 | ||
| 17 | - @ApiModelProperty(value = "微信加密签名", required = true, example = "490eb57f448b87bd5f20ccef58aa4de46aa1908e") | 12 | + @Schema(description = "微信加密签名", required = true, example = "490eb57f448b87bd5f20ccef58aa4de46aa1908e") |
| 18 | @NotEmpty(message = "微信加密签名不能为空") | 13 | @NotEmpty(message = "微信加密签名不能为空") |
| 19 | private String signature; | 14 | private String signature; |
| 20 | 15 | ||
| 21 | - @ApiModelProperty(value = "时间戳", required = true, example = "1672587863") | 16 | + @Schema(description = "时间戳", required = true, example = "1672587863") |
| 22 | @NotEmpty(message = "时间戳不能为空") | 17 | @NotEmpty(message = "时间戳不能为空") |
| 23 | private String timestamp; | 18 | private String timestamp; |
| 24 | 19 | ||
| 25 | - @ApiModelProperty(value = "随机数", required = true, example = "1827365808") | 20 | + @Schema(description = "随机数", required = true, example = "1827365808") |
| 26 | @NotEmpty(message = "随机数不能为空") | 21 | @NotEmpty(message = "随机数不能为空") |
| 27 | private String nonce; | 22 | private String nonce; |
| 28 | 23 | ||
| 29 | - @ApiModelProperty(value = "随机字符串", required = true, example = "2721154047828672511") | 24 | + @Schema(description = "随机字符串", required = true, example = "2721154047828672511") |
| 30 | @NotEmpty(message = "随机字符串不能为空") | 25 | @NotEmpty(message = "随机字符串不能为空") |
| 31 | @SuppressWarnings("SpellCheckingInspection") | 26 | @SuppressWarnings("SpellCheckingInspection") |
| 32 | private String echostr; | 27 | private String echostr; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenHandleMessageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.open.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.open.vo; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | 6 | ||
| 8 | import javax.validation.constraints.NotEmpty; | 7 | import javax.validation.constraints.NotEmpty; |
| 9 | 8 | ||
| 10 | -@ApiModel("管理后台 - 公众号处理消息 Request VO") | 9 | +@Schema(description = "管理后台 - 公众号处理消息 Request VO") |
| 11 | @Data | 10 | @Data |
| 12 | public class MpOpenHandleMessageReqVO { | 11 | public class MpOpenHandleMessageReqVO { |
| 13 | 12 | ||
| 14 | public static final String ENCRYPT_TYPE_AES = "aes"; | 13 | public static final String ENCRYPT_TYPE_AES = "aes"; |
| 15 | 14 | ||
| 16 | - @ApiModelProperty(value = "微信加密签名", required = true, example = "490eb57f448b87bd5f20ccef58aa4de46aa1908e") | 15 | + @Schema(description = "微信加密签名", required = true, example = "490eb57f448b87bd5f20ccef58aa4de46aa1908e") |
| 17 | @NotEmpty(message = "微信加密签名不能为空") | 16 | @NotEmpty(message = "微信加密签名不能为空") |
| 18 | private String signature; | 17 | private String signature; |
| 19 | 18 | ||
| 20 | - @ApiModelProperty(value = "时间戳", required = true, example = "1672587863") | 19 | + @Schema(description = "时间戳", required = true, example = "1672587863") |
| 21 | @NotEmpty(message = "时间戳不能为空") | 20 | @NotEmpty(message = "时间戳不能为空") |
| 22 | private String timestamp; | 21 | private String timestamp; |
| 23 | 22 | ||
| 24 | - @ApiModelProperty(value = "随机数", required = true, example = "1827365808") | 23 | + @Schema(description = "随机数", required = true, example = "1827365808") |
| 25 | @NotEmpty(message = "随机数不能为空") | 24 | @NotEmpty(message = "随机数不能为空") |
| 26 | private String nonce; | 25 | private String nonce; |
| 27 | 26 | ||
| 28 | - @ApiModelProperty(value = "粉丝 openid", required = true, example = "oz-Jdtyn-WGm4C4I5Z-nvBMO_ZfY") | 27 | + @Schema(description = "粉丝 openid", required = true, example = "oz-Jdtyn-WGm4C4I5Z-nvBMO_ZfY") |
| 29 | @NotEmpty(message = "粉丝 openid 不能为空") | 28 | @NotEmpty(message = "粉丝 openid 不能为空") |
| 30 | private String openid; | 29 | private String openid; |
| 31 | 30 | ||
| 32 | - @ApiModelProperty(value = "消息加密类型", example = "aes") | 31 | + @Schema(description = "消息加密类型", example = "aes") |
| 33 | private String encrypt_type; | 32 | private String encrypt_type; |
| 34 | 33 | ||
| 35 | - @ApiModelProperty(value = "微信签名", example = "QW5kcm9pZCBUaGUgQmFzZTY0IGlzIGEgZ2VuZXJhdGVkIHN0cmluZw==") | 34 | + @Schema(description = "微信签名", example = "QW5kcm9pZCBUaGUgQmFzZTY0IGlzIGEgZ2VuZXJhdGVkIHN0cmluZw==") |
| 36 | private String msg_signature; | 35 | private String msg_signature; |
| 37 | 36 | ||
| 38 | } | 37 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/MpStatisticsController.java
| @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 4 | import cn.iocoder.yudao.module.mp.controller.admin.statistics.vo.*; | 4 | import cn.iocoder.yudao.module.mp.controller.admin.statistics.vo.*; |
| 5 | import cn.iocoder.yudao.module.mp.convert.statistics.MpStatisticsConvert; | 5 | import cn.iocoder.yudao.module.mp.convert.statistics.MpStatisticsConvert; |
| 6 | import cn.iocoder.yudao.module.mp.service.statistics.MpStatisticsService; | 6 | import cn.iocoder.yudao.module.mp.service.statistics.MpStatisticsService; |
| 7 | -import io.swagger.annotations.Api; | ||
| 8 | -import io.swagger.annotations.ApiOperation; | 7 | +import io.swagger.v3.oas.annotations.Operation; |
| 8 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 9 | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeInterfaceResult; | 9 | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeInterfaceResult; |
| 10 | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeMsgResult; | 10 | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeMsgResult; |
| 11 | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate; | 11 | import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate; |
| @@ -21,7 +21,7 @@ import java.util.List; | @@ -21,7 +21,7 @@ import java.util.List; | ||
| 21 | 21 | ||
| 22 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 22 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 23 | 23 | ||
| 24 | -@Api(tags = "管理后台 - 公众号统计") | 24 | +@Tag(name = "管理后台 - 公众号统计") |
| 25 | @RestController | 25 | @RestController |
| 26 | @RequestMapping("/mp/statistics") | 26 | @RequestMapping("/mp/statistics") |
| 27 | @Validated | 27 | @Validated |
| @@ -31,7 +31,7 @@ public class MpStatisticsController { | @@ -31,7 +31,7 @@ public class MpStatisticsController { | ||
| 31 | private MpStatisticsService mpStatisticsService; | 31 | private MpStatisticsService mpStatisticsService; |
| 32 | 32 | ||
| 33 | @GetMapping("/user-summary") | 33 | @GetMapping("/user-summary") |
| 34 | - @ApiOperation("获得粉丝增减数据") | 34 | + @Operation(summary = "获得粉丝增减数据") |
| 35 | @PreAuthorize("@ss.hasPermission('mp:statistics:query')") | 35 | @PreAuthorize("@ss.hasPermission('mp:statistics:query')") |
| 36 | public CommonResult<List<MpStatisticsUserSummaryRespVO>> getUserSummary(MpStatisticsGetReqVO getReqVO) { | 36 | public CommonResult<List<MpStatisticsUserSummaryRespVO>> getUserSummary(MpStatisticsGetReqVO getReqVO) { |
| 37 | List<WxDataCubeUserSummary> list = mpStatisticsService.getUserSummary( | 37 | List<WxDataCubeUserSummary> list = mpStatisticsService.getUserSummary( |
| @@ -40,7 +40,7 @@ public class MpStatisticsController { | @@ -40,7 +40,7 @@ public class MpStatisticsController { | ||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | @GetMapping("/user-cumulate") | 42 | @GetMapping("/user-cumulate") |
| 43 | - @ApiOperation("获得粉丝累计数据") | 43 | + @Operation(summary = "获得粉丝累计数据") |
| 44 | @PreAuthorize("@ss.hasPermission('mp:statistics:query')") | 44 | @PreAuthorize("@ss.hasPermission('mp:statistics:query')") |
| 45 | public CommonResult<List<MpStatisticsUserCumulateRespVO>> getUserCumulate(MpStatisticsGetReqVO getReqVO) { | 45 | public CommonResult<List<MpStatisticsUserCumulateRespVO>> getUserCumulate(MpStatisticsGetReqVO getReqVO) { |
| 46 | List<WxDataCubeUserCumulate> list = mpStatisticsService.getUserCumulate( | 46 | List<WxDataCubeUserCumulate> list = mpStatisticsService.getUserCumulate( |
| @@ -49,7 +49,7 @@ public class MpStatisticsController { | @@ -49,7 +49,7 @@ public class MpStatisticsController { | ||
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | @GetMapping("/upstream-message") | 51 | @GetMapping("/upstream-message") |
| 52 | - @ApiOperation("获取消息发送概况数据") | 52 | + @Operation(summary = "获取消息发送概况数据") |
| 53 | @PreAuthorize("@ss.hasPermission('mp:statistics:query')") | 53 | @PreAuthorize("@ss.hasPermission('mp:statistics:query')") |
| 54 | public CommonResult<List<MpStatisticsUpstreamMessageRespVO>> getUpstreamMessage(MpStatisticsGetReqVO getReqVO) { | 54 | public CommonResult<List<MpStatisticsUpstreamMessageRespVO>> getUpstreamMessage(MpStatisticsGetReqVO getReqVO) { |
| 55 | List<WxDataCubeMsgResult> list = mpStatisticsService.getUpstreamMessage( | 55 | List<WxDataCubeMsgResult> list = mpStatisticsService.getUpstreamMessage( |
| @@ -58,7 +58,7 @@ public class MpStatisticsController { | @@ -58,7 +58,7 @@ public class MpStatisticsController { | ||
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | @GetMapping("/interface-summary") | 60 | @GetMapping("/interface-summary") |
| 61 | - @ApiOperation("获取消息发送概况数据") | 61 | + @Operation(summary = "获取消息发送概况数据") |
| 62 | @PreAuthorize("@ss.hasPermission('mp:statistics:query')") | 62 | @PreAuthorize("@ss.hasPermission('mp:statistics:query')") |
| 63 | public CommonResult<List<MpStatisticsInterfaceSummaryRespVO>> getInterfaceSummary(MpStatisticsGetReqVO getReqVO) { | 63 | public CommonResult<List<MpStatisticsInterfaceSummaryRespVO>> getInterfaceSummary(MpStatisticsGetReqVO getReqVO) { |
| 64 | List<WxDataCubeInterfaceResult> list = mpStatisticsService.getInterfaceSummary( | 64 | List<WxDataCubeInterfaceResult> list = mpStatisticsService.getInterfaceSummary( |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsGetReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import org.springframework.format.annotation.DateTimeFormat; | 5 | import org.springframework.format.annotation.DateTimeFormat; |
| 7 | 6 | ||
| @@ -10,15 +9,15 @@ import java.time.LocalDateTime; | @@ -10,15 +9,15 @@ import java.time.LocalDateTime; | ||
| 10 | 9 | ||
| 11 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 10 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 12 | 11 | ||
| 13 | -@ApiModel("管理后台 - 获得统计数据 Request VO") | 12 | +@Schema(description = "管理后台 - 获得统计数据 Request VO") |
| 14 | @Data | 13 | @Data |
| 15 | public class MpStatisticsGetReqVO { | 14 | public class MpStatisticsGetReqVO { |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") | 16 | + @Schema(description = "公众号账号的编号", required = true, example = "1024") |
| 18 | @NotNull(message = "公众号账号的编号不能为空") | 17 | @NotNull(message = "公众号账号的编号不能为空") |
| 19 | private Long accountId; | 18 | private Long accountId; |
| 20 | 19 | ||
| 21 | - @ApiModelProperty(value = "查询时间范围") | 20 | + @Schema(description = "查询时间范围") |
| 22 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 21 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 23 | @NotNull(message = "查询时间范围不能为空") | 22 | @NotNull(message = "查询时间范围不能为空") |
| 24 | private LocalDateTime[] date; | 23 | private LocalDateTime[] date; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsInterfaceSummaryRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | import java.util.Date; | 6 | import java.util.Date; |
| 8 | 7 | ||
| 9 | -@ApiModel("管理后台 - 某一天的接口分析数据 Response VO") | 8 | +@Schema(description = "管理后台 - 某一天的接口分析数据 Response VO") |
| 10 | @Data | 9 | @Data |
| 11 | public class MpStatisticsInterfaceSummaryRespVO { | 10 | public class MpStatisticsInterfaceSummaryRespVO { |
| 12 | 11 | ||
| 13 | - @ApiModelProperty(value = "日期", required = true) | 12 | + @Schema(description = "日期", required = true) |
| 14 | private Date refDate; | 13 | private Date refDate; |
| 15 | 14 | ||
| 16 | - @ApiModelProperty(value = "通过服务器配置地址获得消息后,被动回复粉丝消息的次数", required = true, example = "10") | 15 | + @Schema(description = "通过服务器配置地址获得消息后,被动回复粉丝消息的次数", required = true, example = "10") |
| 17 | private Integer callbackCount; | 16 | private Integer callbackCount; |
| 18 | 17 | ||
| 19 | - @ApiModelProperty(value = "上述动作的失败次数", required = true, example = "20") | 18 | + @Schema(description = "上述动作的失败次数", required = true, example = "20") |
| 20 | private Integer failCount; | 19 | private Integer failCount; |
| 21 | 20 | ||
| 22 | - @ApiModelProperty(value = "总耗时,除以 callback_count 即为平均耗时", required = true, example = "30") | 21 | + @Schema(description = "总耗时,除以 callback_count 即为平均耗时", required = true, example = "30") |
| 23 | private Integer totalTimeCost; | 22 | private Integer totalTimeCost; |
| 24 | 23 | ||
| 25 | - @ApiModelProperty(value = "最大耗时", required = true, example = "40") | 24 | + @Schema(description = "最大耗时", required = true, example = "40") |
| 26 | private Integer maxTimeCost; | 25 | private Integer maxTimeCost; |
| 27 | 26 | ||
| 28 | } | 27 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUpstreamMessageRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | import java.util.Date; | 6 | import java.util.Date; |
| 8 | 7 | ||
| 9 | -@ApiModel("管理后台 - 某一天的粉丝增减数据 Response VO") | 8 | +@Schema(description = "管理后台 - 某一天的粉丝增减数据 Response VO") |
| 10 | @Data | 9 | @Data |
| 11 | public class MpStatisticsUpstreamMessageRespVO { | 10 | public class MpStatisticsUpstreamMessageRespVO { |
| 12 | 11 | ||
| 13 | - @ApiModelProperty(value = "日期", required = true) | 12 | + @Schema(description = "日期", required = true) |
| 14 | private Date refDate; | 13 | private Date refDate; |
| 15 | 14 | ||
| 16 | - @ApiModelProperty(value = "上行发送了(向公众号发送了)消息的粉丝数", required = true, example = "10") | 15 | + @Schema(description = "上行发送了(向公众号发送了)消息的粉丝数", required = true, example = "10") |
| 17 | private Integer messageUser; | 16 | private Integer messageUser; |
| 18 | 17 | ||
| 19 | - @ApiModelProperty(value = "上行发送了消息的消息总数", required = true, example = "20") | 18 | + @Schema(description = "上行发送了消息的消息总数", required = true, example = "20") |
| 20 | private Integer messageCount; | 19 | private Integer messageCount; |
| 21 | 20 | ||
| 22 | } | 21 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserCumulateRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | import java.util.Date; | 6 | import java.util.Date; |
| 8 | 7 | ||
| 9 | -@ApiModel("管理后台 - 某一天的消息发送概况数据 Response VO") | 8 | +@Schema(description = "管理后台 - 某一天的消息发送概况数据 Response VO") |
| 10 | @Data | 9 | @Data |
| 11 | public class MpStatisticsUserCumulateRespVO { | 10 | public class MpStatisticsUserCumulateRespVO { |
| 12 | 11 | ||
| 13 | - @ApiModelProperty(value = "日期", required = true) | 12 | + @Schema(description = "日期", required = true) |
| 14 | private Date refDate; | 13 | private Date refDate; |
| 15 | 14 | ||
| 16 | - @ApiModelProperty(value = "累计粉丝量", required = true, example = "10") | 15 | + @Schema(description = "累计粉丝量", required = true, example = "10") |
| 17 | private Integer cumulateUser; | 16 | private Integer cumulateUser; |
| 18 | 17 | ||
| 19 | } | 18 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserSummaryRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | import java.util.Date; | 6 | import java.util.Date; |
| 8 | 7 | ||
| 9 | -@ApiModel("管理后台 - 某一天的粉丝增减数据 Response VO") | 8 | +@Schema(description = "管理后台 - 某一天的粉丝增减数据 Response VO") |
| 10 | @Data | 9 | @Data |
| 11 | public class MpStatisticsUserSummaryRespVO { | 10 | public class MpStatisticsUserSummaryRespVO { |
| 12 | 11 | ||
| 13 | - @ApiModelProperty(value = "日期", required = true) | 12 | + @Schema(description = "日期", required = true) |
| 14 | private Date refDate; | 13 | private Date refDate; |
| 15 | 14 | ||
| 16 | - @ApiModelProperty(value = "粉丝来源", required = true, example = "0") | 15 | + @Schema(description = "粉丝来源", required = true, example = "0") |
| 17 | private Integer userSource; | 16 | private Integer userSource; |
| 18 | 17 | ||
| 19 | - @ApiModelProperty(value = "新关注的粉丝数量", required = true, example = "10") | 18 | + @Schema(description = "新关注的粉丝数量", required = true, example = "10") |
| 20 | private Integer newUser; | 19 | private Integer newUser; |
| 21 | 20 | ||
| 22 | - @ApiModelProperty(value = "取消关注的粉丝数量", required = true, example = "20") | 21 | + @Schema(description = "取消关注的粉丝数量", required = true, example = "20") |
| 23 | private Integer cancelUser; | 22 | private Integer cancelUser; |
| 24 | 23 | ||
| 25 | } | 24 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java
| @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.*; | @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.*; | ||
| 6 | import cn.iocoder.yudao.module.mp.convert.tag.MpTagConvert; | 6 | import cn.iocoder.yudao.module.mp.convert.tag.MpTagConvert; |
| 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; | 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; |
| 8 | import cn.iocoder.yudao.module.mp.service.tag.MpTagService; | 8 | import cn.iocoder.yudao.module.mp.service.tag.MpTagService; |
| 9 | -import io.swagger.annotations.Api; | ||
| 10 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 11 | -import io.swagger.annotations.ApiOperation; | 9 | +import io.swagger.v3.oas.annotations.Operation; |
| 10 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 11 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 12 | import org.springframework.security.access.prepost.PreAuthorize; | 12 | import org.springframework.security.access.prepost.PreAuthorize; |
| 13 | import org.springframework.validation.annotation.Validated; | 13 | import org.springframework.validation.annotation.Validated; |
| 14 | import org.springframework.web.bind.annotation.*; | 14 | import org.springframework.web.bind.annotation.*; |
| @@ -19,7 +19,7 @@ import java.util.List; | @@ -19,7 +19,7 @@ import java.util.List; | ||
| 19 | 19 | ||
| 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 21 | ||
| 22 | -@Api(tags = "管理后台 - 公众号标签") | 22 | +@Tag(name = "管理后台 - 公众号标签") |
| 23 | @RestController | 23 | @RestController |
| 24 | @RequestMapping("/mp/tag") | 24 | @RequestMapping("/mp/tag") |
| 25 | @Validated | 25 | @Validated |
| @@ -29,14 +29,14 @@ public class MpTagController { | @@ -29,14 +29,14 @@ public class MpTagController { | ||
| 29 | private MpTagService mpTagService; | 29 | private MpTagService mpTagService; |
| 30 | 30 | ||
| 31 | @PostMapping("/create") | 31 | @PostMapping("/create") |
| 32 | - @ApiOperation("创建公众号标签") | 32 | + @Operation(summary = "创建公众号标签") |
| 33 | @PreAuthorize("@ss.hasPermission('mp:tag:create')") | 33 | @PreAuthorize("@ss.hasPermission('mp:tag:create')") |
| 34 | public CommonResult<Long> createTag(@Valid @RequestBody MpTagCreateReqVO createReqVO) { | 34 | public CommonResult<Long> createTag(@Valid @RequestBody MpTagCreateReqVO createReqVO) { |
| 35 | return success(mpTagService.createTag(createReqVO)); | 35 | return success(mpTagService.createTag(createReqVO)); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | @PutMapping("/update") | 38 | @PutMapping("/update") |
| 39 | - @ApiOperation("更新公众号标签") | 39 | + @Operation(summary = "更新公众号标签") |
| 40 | @PreAuthorize("@ss.hasPermission('mp:tag:update')") | 40 | @PreAuthorize("@ss.hasPermission('mp:tag:update')") |
| 41 | public CommonResult<Boolean> updateTag(@Valid @RequestBody MpTagUpdateReqVO updateReqVO) { | 41 | public CommonResult<Boolean> updateTag(@Valid @RequestBody MpTagUpdateReqVO updateReqVO) { |
| 42 | mpTagService.updateTag(updateReqVO); | 42 | mpTagService.updateTag(updateReqVO); |
| @@ -44,8 +44,8 @@ public class MpTagController { | @@ -44,8 +44,8 @@ public class MpTagController { | ||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | @DeleteMapping("/delete") | 46 | @DeleteMapping("/delete") |
| 47 | - @ApiOperation("删除公众号标签") | ||
| 48 | - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | 47 | + @Operation(summary = "删除公众号标签") |
| 48 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 49 | @PreAuthorize("@ss.hasPermission('mp:tag:delete')") | 49 | @PreAuthorize("@ss.hasPermission('mp:tag:delete')") |
| 50 | public CommonResult<Boolean> deleteTag(@RequestParam("id") Long id) { | 50 | public CommonResult<Boolean> deleteTag(@RequestParam("id") Long id) { |
| 51 | mpTagService.deleteTag(id); | 51 | mpTagService.deleteTag(id); |
| @@ -53,7 +53,7 @@ public class MpTagController { | @@ -53,7 +53,7 @@ public class MpTagController { | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | @GetMapping("/page") | 55 | @GetMapping("/page") |
| 56 | - @ApiOperation("获取公众号标签分页") | 56 | + @Operation(summary = "获取公众号标签分页") |
| 57 | @PreAuthorize("@ss.hasPermission('mp:tag:query')") | 57 | @PreAuthorize("@ss.hasPermission('mp:tag:query')") |
| 58 | public CommonResult<PageResult<MpTagRespVO>> getTagPage(MpTagPageReqVO pageReqVO) { | 58 | public CommonResult<PageResult<MpTagRespVO>> getTagPage(MpTagPageReqVO pageReqVO) { |
| 59 | PageResult<MpTagDO> pageResult = mpTagService.getTagPage(pageReqVO); | 59 | PageResult<MpTagDO> pageResult = mpTagService.getTagPage(pageReqVO); |
| @@ -61,7 +61,7 @@ public class MpTagController { | @@ -61,7 +61,7 @@ public class MpTagController { | ||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | @GetMapping("/list-all-simple") | 63 | @GetMapping("/list-all-simple") |
| 64 | - @ApiOperation(value = "获取公众号账号精简信息列表") | 64 | + @Operation(summary = "获取公众号账号精简信息列表") |
| 65 | @PreAuthorize("@ss.hasPermission('mp:account:query')") | 65 | @PreAuthorize("@ss.hasPermission('mp:account:query')") |
| 66 | public CommonResult<List<MpTagSimpleRespVO>> getSimpleTags() { | 66 | public CommonResult<List<MpTagSimpleRespVO>> getSimpleTags() { |
| 67 | List<MpTagDO> list = mpTagService.getTagList(); | 67 | List<MpTagDO> list = mpTagService.getTagList(); |
| @@ -69,8 +69,8 @@ public class MpTagController { | @@ -69,8 +69,8 @@ public class MpTagController { | ||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | @PostMapping("/sync") | 71 | @PostMapping("/sync") |
| 72 | - @ApiOperation("同步公众号标签") | ||
| 73 | - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, dataTypeClass = Long.class) | 72 | + @Operation(summary = "同步公众号标签") |
| 73 | + @Parameter(name = "accountId", description = "公众号账号的编号", required = true) | ||
| 74 | @PreAuthorize("@ss.hasPermission('mp:tag:sync')") | 74 | @PreAuthorize("@ss.hasPermission('mp:tag:sync')") |
| 75 | public CommonResult<Boolean> syncTag(@RequestParam("accountId") Long accountId) { | 75 | public CommonResult<Boolean> syncTag(@RequestParam("accountId") Long accountId) { |
| 76 | mpTagService.syncTag(accountId); | 76 | mpTagService.syncTag(accountId); |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.Data; | 4 | import lombok.Data; |
| 5 | 5 | ||
| 6 | import javax.validation.constraints.NotEmpty; | 6 | import javax.validation.constraints.NotEmpty; |
| @@ -14,7 +14,7 @@ import javax.validation.constraints.NotEmpty; | @@ -14,7 +14,7 @@ import javax.validation.constraints.NotEmpty; | ||
| 14 | @Data | 14 | @Data |
| 15 | public class MpTagBaseVO { | 15 | public class MpTagBaseVO { |
| 16 | 16 | ||
| 17 | - @ApiModelProperty(value = "标签名", required = true, example = "土豆") | 17 | + @Schema(description = "标签名", required = true, example = "土豆") |
| 18 | @NotEmpty(message = "标签名不能为空") | 18 | @NotEmpty(message = "标签名不能为空") |
| 19 | private String name; | 19 | private String name; |
| 20 | 20 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 6 | import lombok.ToString; |
| 8 | 7 | ||
| 9 | import javax.validation.constraints.NotNull; | 8 | import javax.validation.constraints.NotNull; |
| 10 | 9 | ||
| 11 | -@ApiModel("管理后台 - 公众号标签创建 Request VO") | 10 | +@Schema(description = "管理后台 - 公众号标签创建 Request VO") |
| 12 | @Data | 11 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 15 | public class MpTagCreateReqVO extends MpTagBaseVO { | 14 | public class MpTagCreateReqVO extends MpTagBaseVO { |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | 16 | + @Schema(description = "公众号账号的编号", required = true, example = "2048") |
| 18 | @NotNull(message = "公众号账号的编号不能为空") | 17 | @NotNull(message = "公众号账号的编号不能为空") |
| 19 | private Long accountId; | 18 | private Long accountId; |
| 20 | 19 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 8 | import lombok.ToString; | 7 | import lombok.ToString; |
| 9 | 8 | ||
| 10 | import javax.validation.constraints.NotEmpty; | 9 | import javax.validation.constraints.NotEmpty; |
| 11 | 10 | ||
| 12 | -@ApiModel("管理后台 - 公众号标签分页 Request VO") | 11 | +@Schema(description = "管理后台 - 公众号标签分页 Request VO") |
| 13 | @Data | 12 | @Data |
| 14 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| 15 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 16 | public class MpTagPageReqVO extends PageParam { | 15 | public class MpTagPageReqVO extends PageParam { |
| 17 | 16 | ||
| 18 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | 17 | + @Schema(description = "公众号账号的编号", required = true, example = "2048") |
| 19 | @NotEmpty(message = "公众号账号的编号不能为空") | 18 | @NotEmpty(message = "公众号账号的编号不能为空") |
| 20 | private Long accountId; | 19 | private Long accountId; |
| 21 | 20 | ||
| 22 | - @ApiModelProperty(value = "标签名", example = "哈哈", notes = "模糊匹配") | 21 | + @Schema(description = "标签名 模糊匹配", example = "哈哈") |
| 23 | private String name; | 22 | private String name; |
| 24 | 23 | ||
| 25 | } | 24 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 6 | import lombok.ToString; |
| 8 | 7 | ||
| 9 | import java.util.Date; | 8 | import java.util.Date; |
| 10 | 9 | ||
| 11 | -@ApiModel("管理后台 - 公众号标签 Response VO") | 10 | +@Schema(description = "管理后台 - 公众号标签 Response VO") |
| 12 | @Data | 11 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 15 | public class MpTagRespVO extends MpTagBaseVO { | 14 | public class MpTagRespVO extends MpTagBaseVO { |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "编号", required = true, example = "1024") | 16 | + @Schema(description = "编号", required = true, example = "1024") |
| 18 | private Long id; | 17 | private Long id; |
| 19 | 18 | ||
| 20 | - @ApiModelProperty(value = "此标签下粉丝数量", required = true, example = "0") | 19 | + @Schema(description = "此标签下粉丝数量", required = true, example = "0") |
| 21 | private Integer count; | 20 | private Integer count; |
| 22 | 21 | ||
| 23 | - @ApiModelProperty(value = "创建时间", required = true) | 22 | + @Schema(description = "创建时间", required = true) |
| 24 | private Date createTime; | 23 | private Date createTime; |
| 25 | 24 | ||
| 26 | } | 25 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagSimpleRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | -@ApiModel("管理后台 - 公众号标签精简信息 Response VO") | 6 | +@Schema(description = "管理后台 - 公众号标签精简信息 Response VO") |
| 8 | @Data | 7 | @Data |
| 9 | public class MpTagSimpleRespVO { | 8 | public class MpTagSimpleRespVO { |
| 10 | 9 | ||
| 11 | - @ApiModelProperty(value = "编号", required = true, example = "1024") | 10 | + @Schema(description = "编号", required = true, example = "1024") |
| 12 | private Long id; | 11 | private Long id; |
| 13 | 12 | ||
| 14 | - @ApiModelProperty(value = "公众号的标签编号", required = true, example = "2048") | 13 | + @Schema(description = "公众号的标签编号", required = true, example = "2048") |
| 15 | private Long tagId; | 14 | private Long tagId; |
| 16 | 15 | ||
| 17 | - @ApiModelProperty(value = "标签名称", required = true, example = "快乐") | 16 | + @Schema(description = "标签名称", required = true, example = "快乐") |
| 18 | private String name; | 17 | private String name; |
| 19 | 18 | ||
| 20 | } | 19 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | +import lombok.Data; | ||
| 5 | +import lombok.EqualsAndHashCode; | ||
| 6 | +import lombok.ToString; | ||
| 5 | 7 | ||
| 6 | -import javax.validation.constraints.*; | 8 | +import javax.validation.constraints.NotNull; |
| 7 | 9 | ||
| 8 | -@ApiModel("管理后台 - 公众号标签更新 Request VO") | 10 | +@Schema(description = "管理后台 - 公众号标签更新 Request VO") |
| 9 | @Data | 11 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 12 | public class MpTagUpdateReqVO extends MpTagBaseVO { | 14 | public class MpTagUpdateReqVO extends MpTagBaseVO { |
| 13 | 15 | ||
| 14 | - @ApiModelProperty(value = "编号", required = true) | 16 | + @Schema(description = "编号", required = true) |
| 15 | @NotNull(message = "编号不能为空") | 17 | @NotNull(message = "编号不能为空") |
| 16 | private Long id; | 18 | private Long id; |
| 17 | 19 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/MpUserController.java
| @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.user.vo.MpUserUpdateReqVO; | @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.user.vo.MpUserUpdateReqVO; | ||
| 8 | import cn.iocoder.yudao.module.mp.convert.user.MpUserConvert; | 8 | import cn.iocoder.yudao.module.mp.convert.user.MpUserConvert; |
| 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.user.MpUserDO; | 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.user.MpUserDO; |
| 10 | import cn.iocoder.yudao.module.mp.service.user.MpUserService; | 10 | import cn.iocoder.yudao.module.mp.service.user.MpUserService; |
| 11 | -import io.swagger.annotations.Api; | ||
| 12 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 13 | -import io.swagger.annotations.ApiOperation; | 11 | +import io.swagger.v3.oas.annotations.Operation; |
| 12 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 13 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 14 | import org.springframework.security.access.prepost.PreAuthorize; | 14 | import org.springframework.security.access.prepost.PreAuthorize; |
| 15 | import org.springframework.validation.annotation.Validated; | 15 | import org.springframework.validation.annotation.Validated; |
| 16 | import org.springframework.web.bind.annotation.*; | 16 | import org.springframework.web.bind.annotation.*; |
| @@ -20,7 +20,7 @@ import javax.validation.Valid; | @@ -20,7 +20,7 @@ import javax.validation.Valid; | ||
| 20 | 20 | ||
| 21 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 21 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 22 | 22 | ||
| 23 | -@Api(tags = "管理后台 - 公众号粉丝") | 23 | +@Tag(name = "管理后台 - 公众号粉丝") |
| 24 | @RestController | 24 | @RestController |
| 25 | @RequestMapping("/mp/user") | 25 | @RequestMapping("/mp/user") |
| 26 | @Validated | 26 | @Validated |
| @@ -30,7 +30,7 @@ public class MpUserController { | @@ -30,7 +30,7 @@ public class MpUserController { | ||
| 30 | private MpUserService mpUserService; | 30 | private MpUserService mpUserService; |
| 31 | 31 | ||
| 32 | @GetMapping("/page") | 32 | @GetMapping("/page") |
| 33 | - @ApiOperation("获得公众号粉丝分页") | 33 | + @Operation(summary = "获得公众号粉丝分页") |
| 34 | @PreAuthorize("@ss.hasPermission('mp:user:query')") | 34 | @PreAuthorize("@ss.hasPermission('mp:user:query')") |
| 35 | public CommonResult<PageResult<MpUserRespVO>> getUserPage(@Valid MpUserPageReqVO pageVO) { | 35 | public CommonResult<PageResult<MpUserRespVO>> getUserPage(@Valid MpUserPageReqVO pageVO) { |
| 36 | PageResult<MpUserDO> pageResult = mpUserService.getUserPage(pageVO); | 36 | PageResult<MpUserDO> pageResult = mpUserService.getUserPage(pageVO); |
| @@ -38,15 +38,15 @@ public class MpUserController { | @@ -38,15 +38,15 @@ public class MpUserController { | ||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | @GetMapping("/get") | 40 | @GetMapping("/get") |
| 41 | - @ApiOperation("获得公众号粉丝") | ||
| 42 | - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | 41 | + @Operation(summary = "获得公众号粉丝") |
| 42 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 43 | @PreAuthorize("@ss.hasPermission('mp:user:query')") | 43 | @PreAuthorize("@ss.hasPermission('mp:user:query')") |
| 44 | public CommonResult<MpUserRespVO> getUser(@RequestParam("id") Long id) { | 44 | public CommonResult<MpUserRespVO> getUser(@RequestParam("id") Long id) { |
| 45 | return success(MpUserConvert.INSTANCE.convert(mpUserService.getUser(id))); | 45 | return success(MpUserConvert.INSTANCE.convert(mpUserService.getUser(id))); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | @PutMapping("/update") | 48 | @PutMapping("/update") |
| 49 | - @ApiOperation("更新公众号粉丝") | 49 | + @Operation(summary = "更新公众号粉丝") |
| 50 | @PreAuthorize("@ss.hasPermission('mp:user:update')") | 50 | @PreAuthorize("@ss.hasPermission('mp:user:update')") |
| 51 | public CommonResult<Boolean> updateUser(@Valid @RequestBody MpUserUpdateReqVO updateReqVO) { | 51 | public CommonResult<Boolean> updateUser(@Valid @RequestBody MpUserUpdateReqVO updateReqVO) { |
| 52 | mpUserService.updateUser(updateReqVO); | 52 | mpUserService.updateUser(updateReqVO); |
| @@ -54,8 +54,8 @@ public class MpUserController { | @@ -54,8 +54,8 @@ public class MpUserController { | ||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | @PostMapping("/sync") | 56 | @PostMapping("/sync") |
| 57 | - @ApiOperation("同步公众号粉丝") | ||
| 58 | - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, dataTypeClass = Long.class) | 57 | + @Operation(summary = "同步公众号粉丝") |
| 58 | + @Parameter(name = "accountId", description = "公众号账号的编号", required = true) | ||
| 59 | @PreAuthorize("@ss.hasPermission('mp:user:sync')") | 59 | @PreAuthorize("@ss.hasPermission('mp:user:sync')") |
| 60 | public CommonResult<Boolean> syncUser(@RequestParam("accountId") Long accountId) { | 60 | public CommonResult<Boolean> syncUser(@RequestParam("accountId") Long accountId) { |
| 61 | mpUserService.syncUser(accountId); | 61 | mpUserService.syncUser(accountId); |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserPageReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.user.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.user.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | -import io.swagger.annotations.ApiModel; | ||
| 5 | -import io.swagger.annotations.ApiModelProperty; | 4 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 8 | import lombok.ToString; | 7 | import lombok.ToString; |
| 9 | 8 | ||
| 10 | import javax.validation.constraints.NotNull; | 9 | import javax.validation.constraints.NotNull; |
| 11 | 10 | ||
| 12 | -@ApiModel("管理后台 - 公众号粉丝分页 Request VO") | 11 | +@Schema(description = "管理后台 - 公众号粉丝分页 Request VO") |
| 13 | @Data | 12 | @Data |
| 14 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| 15 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 16 | public class MpUserPageReqVO extends PageParam { | 15 | public class MpUserPageReqVO extends PageParam { |
| 17 | 16 | ||
| 18 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | 17 | + @Schema(description = "公众号账号的编号", required = true, example = "2048") |
| 19 | @NotNull(message = "公众号账号的编号不能为空") | 18 | @NotNull(message = "公众号账号的编号不能为空") |
| 20 | private Long accountId; | 19 | private Long accountId; |
| 21 | 20 | ||
| 22 | - @ApiModelProperty(value = "公众号粉丝标识", example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M", notes = "模糊匹配") | 21 | + @Schema(description = "公众号粉丝标识 模糊匹配", example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") |
| 23 | private String openid; | 22 | private String openid; |
| 24 | 23 | ||
| 25 | - @ApiModelProperty(value = "公众号粉丝昵称", example = "芋艿", notes = "模糊匹配") | 24 | + @Schema(description = "公众号粉丝昵称 模糊匹配", example = "芋艿") |
| 26 | private String nickname; | 25 | private String nickname; |
| 27 | 26 | ||
| 28 | } | 27 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserRespVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.user.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.user.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
| 8 | import java.util.Date; | 7 | import java.util.Date; |
| 9 | import java.util.List; | 8 | import java.util.List; |
| 10 | 9 | ||
| 11 | -@ApiModel("管理后台 - 公众号粉丝 Response VO") | 10 | +@Schema(description = "管理后台 - 公众号粉丝 Response VO") |
| 12 | @Data | 11 | @Data |
| 13 | public class MpUserRespVO { | 12 | public class MpUserRespVO { |
| 14 | 13 | ||
| 15 | - @ApiModelProperty(value = "编号", required = true, example = "1024") | 14 | + @Schema(description = "编号", required = true, example = "1024") |
| 16 | private Long id; | 15 | private Long id; |
| 17 | 16 | ||
| 18 | - @ApiModelProperty(value = "公众号粉丝标识", required = true, example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") | 17 | + @Schema(description = "公众号粉丝标识", required = true, example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") |
| 19 | private String openid; | 18 | private String openid; |
| 20 | 19 | ||
| 21 | - @ApiModelProperty(value = "关注状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") | 20 | + @Schema(description = "关注状态 参见 CommonStatusEnum 枚举", required = true, example = "1") |
| 22 | private Integer subscribeStatus; | 21 | private Integer subscribeStatus; |
| 23 | - @ApiModelProperty(value = "关注时间", required = true) | 22 | + @Schema(description = "关注时间", required = true) |
| 24 | private LocalDateTime subscribeTime; | 23 | private LocalDateTime subscribeTime; |
| 25 | - @ApiModelProperty(value = "取消关注时间") | 24 | + @Schema(description = "取消关注时间") |
| 26 | private LocalDateTime unsubscribeTime; | 25 | private LocalDateTime unsubscribeTime; |
| 27 | 26 | ||
| 28 | - @ApiModelProperty(value = "昵称", example = "芋道") | 27 | + @Schema(description = "昵称", example = "芋道") |
| 29 | private String nickname; | 28 | private String nickname; |
| 30 | - @ApiModelProperty(value = "头像地址", example = "https://www.iocoder.cn/1.png") | 29 | + @Schema(description = "头像地址", example = "https://www.iocoder.cn/1.png") |
| 31 | private String headImageUrl; | 30 | private String headImageUrl; |
| 32 | - @ApiModelProperty(value = "语言", example = "zh_CN") | 31 | + @Schema(description = "语言", example = "zh_CN") |
| 33 | private String language; | 32 | private String language; |
| 34 | - @ApiModelProperty(value = "国家", example = "中国") | 33 | + @Schema(description = "国家", example = "中国") |
| 35 | private String country; | 34 | private String country; |
| 36 | - @ApiModelProperty(value = "省份", example = "广东省") | 35 | + @Schema(description = "省份", example = "广东省") |
| 37 | private String province; | 36 | private String province; |
| 38 | - @ApiModelProperty(value = "城市", example = "广州市") | 37 | + @Schema(description = "城市", example = "广州市") |
| 39 | private String city; | 38 | private String city; |
| 40 | - @ApiModelProperty(value = "备注", example = "你是一个芋头嘛") | 39 | + @Schema(description = "备注", example = "你是一个芋头嘛") |
| 41 | private String remark; | 40 | private String remark; |
| 42 | 41 | ||
| 43 | - @ApiModelProperty(value = "标签编号数组", example = "1,2,3") | 42 | + @Schema(description = "标签编号数组", example = "1,2,3") |
| 44 | private List<Long> tagIds; | 43 | private List<Long> tagIds; |
| 45 | 44 | ||
| 46 | - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1") | 45 | + @Schema(description = "公众号账号的编号", required = true, example = "1") |
| 47 | private Long accountId; | 46 | private Long accountId; |
| 48 | - @ApiModelProperty(value = "公众号账号的 appId", required = true, example = "wx1234567890") | 47 | + @Schema(description = "公众号账号的 appId", required = true, example = "wx1234567890") |
| 49 | private String appId; | 48 | private String appId; |
| 50 | 49 | ||
| 51 | - @ApiModelProperty(value = "创建时间", required = true) | 50 | + @Schema(description = "创建时间", required = true) |
| 52 | private Date createTime; | 51 | private Date createTime; |
| 53 | 52 | ||
| 54 | } | 53 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserUpdateReqVO.java
| 1 | package cn.iocoder.yudao.module.mp.controller.admin.user.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.user.vo; |
| 2 | 2 | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | 3 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | 5 | ||
| 7 | import javax.validation.constraints.NotNull; | 6 | import javax.validation.constraints.NotNull; |
| 8 | import java.util.List; | 7 | import java.util.List; |
| 9 | 8 | ||
| 10 | -@ApiModel("管理后台 - 公众号粉丝更新 Request VO") | 9 | +@Schema(description = "管理后台 - 公众号粉丝更新 Request VO") |
| 11 | @Data | 10 | @Data |
| 12 | public class MpUserUpdateReqVO { | 11 | public class MpUserUpdateReqVO { |
| 13 | 12 | ||
| 14 | - @ApiModelProperty(value = "编号", required = true, example = "1024") | 13 | + @Schema(description = "编号", required = true, example = "1024") |
| 15 | @NotNull(message = "编号不能为空") | 14 | @NotNull(message = "编号不能为空") |
| 16 | private Long id; | 15 | private Long id; |
| 17 | 16 | ||
| 18 | - @ApiModelProperty(value = "昵称", example = "芋道") | 17 | + @Schema(description = "昵称", example = "芋道") |
| 19 | private String nickname; | 18 | private String nickname; |
| 20 | 19 | ||
| 21 | - @ApiModelProperty(value = "备注", example = "你是一个芋头嘛") | 20 | + @Schema(description = "备注", example = "你是一个芋头嘛") |
| 22 | private String remark; | 21 | private String remark; |
| 23 | 22 | ||
| 24 | - @ApiModelProperty(value = "标签编号数组", example = "1,2,3") | 23 | + @Schema(description = "标签编号数组", example = "1,2,3") |
| 25 | private List<Long> tagIds; | 24 | private List<Long> tagIds; |
| 26 | 25 | ||
| 27 | } | 26 | } |
yudao-server/src/main/resources/application-local.yaml
| @@ -44,34 +44,34 @@ spring: | @@ -44,34 +44,34 @@ spring: | ||
| 44 | primary: master | 44 | primary: master |
| 45 | datasource: | 45 | datasource: |
| 46 | master: | 46 | master: |
| 47 | - name: ruoyi-vue-pro | ||
| 48 | - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 | 47 | + name: pro |
| 48 | + url: jdbc:mysql://101.201.151.212:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 | ||
| 49 | # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 | 49 | # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 |
| 50 | # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 | 50 | # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 |
| 51 | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 | 51 | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 |
| 52 | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例 | 52 | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例 |
| 53 | - username: root | ||
| 54 | - password: 123456 | 53 | + username: luoqi |
| 54 | + password: luoqikeji | ||
| 55 | # username: sa | 55 | # username: sa |
| 56 | # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W | 56 | # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W |
| 57 | slave: # 模拟从库,可根据自己需要修改 | 57 | slave: # 模拟从库,可根据自己需要修改 |
| 58 | - name: ruoyi-vue-pro | ||
| 59 | - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 | 58 | + name: pro |
| 59 | + url: jdbc:mysql://101.201.151.212:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 | ||
| 60 | # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 | 60 | # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 |
| 61 | # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 | 61 | # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 |
| 62 | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 | 62 | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 |
| 63 | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例 | 63 | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例 |
| 64 | - username: root | ||
| 65 | - password: 123456 | 64 | + username: luoqi |
| 65 | + password: luoqikeji | ||
| 66 | # username: sa | 66 | # username: sa |
| 67 | # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W | 67 | # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W |
| 68 | 68 | ||
| 69 | # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 | 69 | # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 |
| 70 | redis: | 70 | redis: |
| 71 | - host: 127.0.0.1 # 地址 | 71 | + host: 39.107.87.6 # 地址 |
| 72 | port: 6379 # 端口 | 72 | port: 6379 # 端口 |
| 73 | - database: 0 # 数据库索引 | ||
| 74 | -# password: 123456 # 密码,建议生产环境开启 | 73 | + database: 5 # 数据库索引 |
| 74 | + password: xingyu4j # 密码,建议生产环境开启 | ||
| 75 | 75 | ||
| 76 | --- #################### 定时任务相关配置 #################### | 76 | --- #################### 定时任务相关配置 #################### |
| 77 | 77 |