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