mp:调整自动回复的表结构

This commit is contained in:
YunaiV 2023-01-03 23:32:33 +08:00
parent c141ebef3f
commit 3cf8575317
45 changed files with 157 additions and 1683 deletions

View File

@ -0,0 +1,28 @@
package cn.iocoder.yudao.module.mp.enums.message;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 微信消息自动回复的匹配模式
*
* @author 芋道源码
*/
@Getter
@AllArgsConstructor
public enum MpAutoReplyMatchEnum {
ALL(1, "完全匹配"),
LIKE(2, "半匹配"),
;
/**
* 匹配
*/
private final Integer match;
/**
* 匹配的名字
*/
private final String name;
}

View File

@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.mp.enums.message;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 微信消息自动回复的类型
*
* @author 芋道源码
*/
@Getter
@AllArgsConstructor
public enum MpAutoReplyTypeEnum {
SUBSCRIBE(1, "关注时回复"),
MESSAGE(2, "收到消息回复"),
KEYWORD(2, "关键词回复"),
;
/**
* 来源
*/
private final Integer type;
/**
* 类型的名字
*/
private final String name;
}

View File

@ -1,103 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.mediaupload.WxMediaUploadDO;
import cn.iocoder.yudao.module.mp.convert.mediaupload.WxMediaUploadConvert;
import cn.iocoder.yudao.module.mp.service.mediaupload.WxMediaUploadService;
@Api(tags = "管理后台 - 微信素材上传表 ")
@RestController
@RequestMapping("/wechatMp/wx-media-upload")
@Validated
public class WxMediaUploadController {
@Resource
private WxMediaUploadService wxMediaUploadService;
@PostMapping("/create")
@ApiOperation("创建微信素材上传表 ")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:create')")
public CommonResult<Integer> createWxMediaUpload(@Valid @RequestBody WxMediaUploadCreateReqVO createReqVO) {
return success(wxMediaUploadService.createWxMediaUpload(createReqVO));
}
@PutMapping("/update")
@ApiOperation("更新微信素材上传表 ")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:update')")
public CommonResult<Boolean> updateWxMediaUpload(@Valid @RequestBody WxMediaUploadUpdateReqVO updateReqVO) {
wxMediaUploadService.updateWxMediaUpload(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@ApiOperation("删除微信素材上传表 ")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:delete')")
public CommonResult<Boolean> deleteWxMediaUpload(@RequestParam("id") Integer id) {
wxMediaUploadService.deleteWxMediaUpload(id);
return success(true);
}
@GetMapping("/get")
@ApiOperation("获得微信素材上传表 ")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:query')")
public CommonResult<WxMediaUploadRespVO> getWxMediaUpload(@RequestParam("id") Integer id) {
WxMediaUploadDO wxMediaUpload = wxMediaUploadService.getWxMediaUpload(id);
return success(WxMediaUploadConvert.INSTANCE.convert(wxMediaUpload));
}
@GetMapping("/list")
@ApiOperation("获得微信素材上传表 列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:query')")
public CommonResult<List<WxMediaUploadRespVO>> getWxMediaUploadList(@RequestParam("ids") Collection<Integer> ids) {
List<WxMediaUploadDO> list = wxMediaUploadService.getWxMediaUploadList(ids);
return success(WxMediaUploadConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@ApiOperation("获得微信素材上传表 分页")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:query')")
public CommonResult<PageResult<WxMediaUploadRespVO>> getWxMediaUploadPage(@Valid WxMediaUploadPageReqVO pageVO) {
PageResult<WxMediaUploadDO> pageResult = wxMediaUploadService.getWxMediaUploadPage(pageVO);
return success(WxMediaUploadConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@ApiOperation("导出微信素材上传表 Excel")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:export')")
@OperateLog(type = EXPORT)
public void exportWxMediaUploadExcel(@Valid WxMediaUploadExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<WxMediaUploadDO> list = wxMediaUploadService.getWxMediaUploadList(exportReqVO);
// 导出 Excel
List<WxMediaUploadExcelVO> datas = WxMediaUploadConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "微信素材上传表 .xls", "数据", WxMediaUploadExcelVO.class, datas);
}
}

View File

@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
import lombok.*;
import io.swagger.annotations.*;
/**
* 微信素材上传表 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class WxMediaUploadBaseVO {
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "图片URL")
private String url;
@ApiModelProperty(value = "素材ID")
private String mediaId;
@ApiModelProperty(value = "缩略图素材ID")
private String thumbMediaId;
@ApiModelProperty(value = "微信账号ID")
private String wxAccountId;
}

View File

@ -1,12 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
import lombok.*;
import io.swagger.annotations.*;
@ApiModel("管理后台 - 微信素材上传表 创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxMediaUploadCreateReqVO extends WxMediaUploadBaseVO {
}

View File

@ -1,38 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
import lombok.*;
import java.util.*;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* 微信素材上传表 Excel VO
*
* @author 芋道源码
*/
@Data
public class WxMediaUploadExcelVO {
@ExcelProperty("主键")
private Integer id;
@ExcelProperty("类型")
private String type;
@ExcelProperty("图片URL")
private String url;
@ExcelProperty("素材ID")
private String mediaId;
@ExcelProperty("缩略图素材ID")
private String thumbMediaId;
@ExcelProperty("微信账号ID")
private String wxAccountId;
@ExcelProperty("创建时间")
private Date createTime;
}

View File

@ -1,39 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "管理后台 - 微信素材上传表 Excel 导出 Request VO", description = "参数和 WxMediaUploadPageReqVO 是一致的")
@Data
public class WxMediaUploadExportReqVO {
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "图片URL")
private String url;
@ApiModelProperty(value = "素材ID")
private String mediaId;
@ApiModelProperty(value = "缩略图素材ID")
private String thumbMediaId;
@ApiModelProperty(value = "微信账号ID")
private String wxAccountId;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
}

View File

@ -1,42 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("管理后台 - 微信素材上传表 分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxMediaUploadPageReqVO extends PageParam {
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "图片URL")
private String url;
@ApiModelProperty(value = "素材ID")
private String mediaId;
@ApiModelProperty(value = "缩略图素材ID")
private String thumbMediaId;
@ApiModelProperty(value = "微信账号ID")
private String wxAccountId;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
}

View File

@ -1,21 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
@ApiModel("管理后台 - 微信素材上传表 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxMediaUploadRespVO extends WxMediaUploadBaseVO {
@ApiModelProperty(value = "主键", required = true)
private Integer id;
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
}

View File

@ -1,18 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
import lombok.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
@ApiModel("管理后台 - 微信素材上传表 更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxMediaUploadUpdateReqVO extends WxMediaUploadBaseVO {
@ApiModelProperty(value = "主键", required = true)
@NotNull(message = "主键不能为空")
private Integer id;
}

View File

@ -1,103 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.receivetext;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.receivetext.WxReceiveTextDO;
import cn.iocoder.yudao.module.mp.convert.receivetext.WxReceiveTextConvert;
import cn.iocoder.yudao.module.mp.service.receivetext.WxReceiveTextService;
@Api(tags = "管理后台 - 回复关键字")
@RestController
@RequestMapping("/wechatMp/wx-receive-text")
@Validated
public class WxReceiveTextController {
@Resource
private WxReceiveTextService wxReceiveTextService;
@PostMapping("/create")
@ApiOperation("创建回复关键字")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:create')")
public CommonResult<Integer> createWxReceiveText(@Valid @RequestBody WxReceiveTextCreateReqVO createReqVO) {
return success(wxReceiveTextService.createWxReceiveText(createReqVO));
}
@PutMapping("/update")
@ApiOperation("更新回复关键字")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:update')")
public CommonResult<Boolean> updateWxReceiveText(@Valid @RequestBody WxReceiveTextUpdateReqVO updateReqVO) {
wxReceiveTextService.updateWxReceiveText(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@ApiOperation("删除回复关键字")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:delete')")
public CommonResult<Boolean> deleteWxReceiveText(@RequestParam("id") Integer id) {
wxReceiveTextService.deleteWxReceiveText(id);
return success(true);
}
@GetMapping("/get")
@ApiOperation("获得回复关键字")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:query')")
public CommonResult<WxReceiveTextRespVO> getWxReceiveText(@RequestParam("id") Integer id) {
WxReceiveTextDO wxReceiveText = wxReceiveTextService.getWxReceiveText(id);
return success(WxReceiveTextConvert.INSTANCE.convert(wxReceiveText));
}
@GetMapping("/list")
@ApiOperation("获得回复关键字列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:query')")
public CommonResult<List<WxReceiveTextRespVO>> getWxReceiveTextList(@RequestParam("ids") Collection<Integer> ids) {
List<WxReceiveTextDO> list = wxReceiveTextService.getWxReceiveTextList(ids);
return success(WxReceiveTextConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@ApiOperation("获得回复关键字分页")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:query')")
public CommonResult<PageResult<WxReceiveTextRespVO>> getWxReceiveTextPage(@Valid WxReceiveTextPageReqVO pageVO) {
PageResult<WxReceiveTextDO> pageResult = wxReceiveTextService.getWxReceiveTextPage(pageVO);
return success(WxReceiveTextConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@ApiOperation("导出回复关键字 Excel")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:export')")
@OperateLog(type = EXPORT)
public void exportWxReceiveTextExcel(@Valid WxReceiveTextExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<WxReceiveTextDO> list = wxReceiveTextService.getWxReceiveTextList(exportReqVO);
// 导出 Excel
List<WxReceiveTextExcelVO> datas = WxReceiveTextConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "回复关键字.xls", "数据", WxReceiveTextExcelVO.class, datas);
}
}

View File

@ -1,25 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
import lombok.*;
import io.swagger.annotations.*;
/**
* 回复关键字 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class WxReceiveTextBaseVO {
@ApiModelProperty(value = "关键字")
private String receiveText;
@ApiModelProperty(value = "消息类型 1文本消息2图文消息")
private String msgType;
@ApiModelProperty(value = "模板ID")
private String tplId;
@ApiModelProperty(value = "微信账号ID")
private String wxAccountId;
}

View File

@ -1,12 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
import lombok.*;
import io.swagger.annotations.*;
@ApiModel("管理后台 - 回复关键字创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxReceiveTextCreateReqVO extends WxReceiveTextBaseVO {
}

View File

@ -1,35 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
import lombok.*;
import java.util.*;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* 回复关键字 Excel VO
*
* @author 芋道源码
*/
@Data
public class WxReceiveTextExcelVO {
@ExcelProperty("主键")
private Integer id;
@ExcelProperty("关键字")
private String receiveText;
@ExcelProperty("消息类型 1文本消息2图文消息")
private String msgType;
@ExcelProperty("模板ID")
private String tplId;
@ExcelProperty("微信账号ID")
private String wxAccountId;
@ExcelProperty("创建时间")
private Date createTime;
}

View File

@ -1,36 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "管理后台 - 回复关键字 Excel 导出 Request VO", description = "参数和 WxReceiveTextPageReqVO 是一致的")
@Data
public class WxReceiveTextExportReqVO {
@ApiModelProperty(value = "关键字")
private String receiveText;
@ApiModelProperty(value = "消息类型 1文本消息2图文消息")
private String msgType;
@ApiModelProperty(value = "模板ID")
private String tplId;
@ApiModelProperty(value = "微信账号ID")
private String wxAccountId;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
}

View File

@ -1,39 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("管理后台 - 回复关键字分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxReceiveTextPageReqVO extends PageParam {
@ApiModelProperty(value = "关键字")
private String receiveText;
@ApiModelProperty(value = "消息类型 1文本消息2图文消息")
private String msgType;
@ApiModelProperty(value = "模板ID")
private String tplId;
@ApiModelProperty(value = "微信账号ID")
private String wxAccountId;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
}

View File

@ -1,21 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
@ApiModel("管理后台 - 回复关键字 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxReceiveTextRespVO extends WxReceiveTextBaseVO {
@ApiModelProperty(value = "主键", required = true)
private Integer id;
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
}

View File

@ -1,18 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
import lombok.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
@ApiModel("管理后台 - 回复关键字更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxReceiveTextUpdateReqVO extends WxReceiveTextBaseVO {
@ApiModelProperty(value = "主键", required = true)
@NotNull(message = "主键不能为空")
private Integer id;
}

View File

@ -1,103 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.texttemplate;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate.WxTextTemplateDO;
import cn.iocoder.yudao.module.mp.convert.texttemplate.WxTextTemplateConvert;
import cn.iocoder.yudao.module.mp.service.texttemplate.WxTextTemplateService;
@Api(tags = "管理后台 - 文本模板")
@RestController
@RequestMapping("/wechatMp/wx-text-template")
@Validated
public class WxTextTemplateController {
@Resource
private WxTextTemplateService wxTextTemplateService;
@PostMapping("/create")
@ApiOperation("创建文本模板")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-text-template:create')")
public CommonResult<Integer> createWxTextTemplate(@Valid @RequestBody WxTextTemplateCreateReqVO createReqVO) {
return success(wxTextTemplateService.createWxTextTemplate(createReqVO));
}
@PutMapping("/update")
@ApiOperation("更新文本模板")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-text-template:update')")
public CommonResult<Boolean> updateWxTextTemplate(@Valid @RequestBody WxTextTemplateUpdateReqVO updateReqVO) {
wxTextTemplateService.updateWxTextTemplate(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@ApiOperation("删除文本模板")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
@PreAuthorize("@ss.hasPermission('wechatMp:wx-text-template:delete')")
public CommonResult<Boolean> deleteWxTextTemplate(@RequestParam("id") Integer id) {
wxTextTemplateService.deleteWxTextTemplate(id);
return success(true);
}
@GetMapping("/get")
@ApiOperation("获得文本模板")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
@PreAuthorize("@ss.hasPermission('wechatMp:wx-text-template:query')")
public CommonResult<WxTextTemplateRespVO> getWxTextTemplate(@RequestParam("id") Integer id) {
WxTextTemplateDO wxTextTemplate = wxTextTemplateService.getWxTextTemplate(id);
return success(WxTextTemplateConvert.INSTANCE.convert(wxTextTemplate));
}
@GetMapping("/list")
@ApiOperation("获得文本模板列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('wechatMp:wx-text-template:query')")
public CommonResult<List<WxTextTemplateRespVO>> getWxTextTemplateList(@RequestParam("ids") Collection<Integer> ids) {
List<WxTextTemplateDO> list = wxTextTemplateService.getWxTextTemplateList(ids);
return success(WxTextTemplateConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@ApiOperation("获得文本模板分页")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-text-template:query')")
public CommonResult<PageResult<WxTextTemplateRespVO>> getWxTextTemplatePage(@Valid WxTextTemplatePageReqVO pageVO) {
PageResult<WxTextTemplateDO> pageResult = wxTextTemplateService.getWxTextTemplatePage(pageVO);
return success(WxTextTemplateConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@ApiOperation("导出文本模板 Excel")
@PreAuthorize("@ss.hasPermission('wechatMp:wx-text-template:export')")
@OperateLog(type = EXPORT)
public void exportWxTextTemplateExcel(@Valid WxTextTemplateExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<WxTextTemplateDO> list = wxTextTemplateService.getWxTextTemplateList(exportReqVO);
// 导出 Excel
List<WxTextTemplateExcelVO> datas = WxTextTemplateConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "文本模板.xls", "数据", WxTextTemplateExcelVO.class, datas);
}
}

View File

@ -1,19 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo;
import lombok.*;
import io.swagger.annotations.*;
/**
* 文本模板 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class WxTextTemplateBaseVO {
@ApiModelProperty(value = "模板名字")
private String tplName;
@ApiModelProperty(value = "模板内容")
private String content;
}

View File

@ -1,12 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo;
import lombok.*;
import io.swagger.annotations.*;
@ApiModel("管理后台 - 文本模板创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxTextTemplateCreateReqVO extends WxTextTemplateBaseVO {
}

View File

@ -1,29 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo;
import lombok.*;
import java.util.*;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* 文本模板 Excel VO
*
* @author 芋道源码
*/
@Data
public class WxTextTemplateExcelVO {
@ExcelProperty("主键")
private Integer id;
@ExcelProperty("模板名字")
private String tplName;
@ExcelProperty("模板内容")
private String content;
@ExcelProperty("创建时间")
private Date createTime;
}

View File

@ -1,30 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel(value = "管理后台 - 文本模板 Excel 导出 Request VO", description = "参数和 WxTextTemplatePageReqVO 是一致的")
@Data
public class WxTextTemplateExportReqVO {
@ApiModelProperty(value = "模板名字")
private String tplName;
@ApiModelProperty(value = "模板内容")
private String content;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
}

View File

@ -1,33 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("管理后台 - 文本模板分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxTextTemplatePageReqVO extends PageParam {
@ApiModelProperty(value = "模板名字")
private String tplName;
@ApiModelProperty(value = "模板内容")
private String content;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
}

View File

@ -1,21 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
@ApiModel("管理后台 - 文本模板 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxTextTemplateRespVO extends WxTextTemplateBaseVO {
@ApiModelProperty(value = "主键", required = true)
private Integer id;
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
}

View File

@ -1,18 +0,0 @@
package cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo;
import lombok.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
@ApiModel("管理后台 - 文本模板更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WxTextTemplateUpdateReqVO extends WxTextTemplateBaseVO {
@ApiModelProperty(value = "主键", required = true)
@NotNull(message = "主键不能为空")
private Integer id;
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.mp.convert.mediaupload;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.mediaupload.WxMediaUploadDO;
/**
* 微信素材上传表 Convert
*
* @author 芋道源码
*/
@Mapper
public interface WxMediaUploadConvert {
WxMediaUploadConvert INSTANCE = Mappers.getMapper(WxMediaUploadConvert.class);
WxMediaUploadDO convert(WxMediaUploadCreateReqVO bean);
WxMediaUploadDO convert(WxMediaUploadUpdateReqVO bean);
WxMediaUploadRespVO convert(WxMediaUploadDO bean);
List<WxMediaUploadRespVO> convertList(List<WxMediaUploadDO> list);
PageResult<WxMediaUploadRespVO> convertPage(PageResult<WxMediaUploadDO> page);
List<WxMediaUploadExcelVO> convertList02(List<WxMediaUploadDO> list);
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.mp.convert.receivetext;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.receivetext.WxReceiveTextDO;
/**
* 回复关键字 Convert
*
* @author 芋道源码
*/
@Mapper
public interface WxReceiveTextConvert {
WxReceiveTextConvert INSTANCE = Mappers.getMapper(WxReceiveTextConvert.class);
WxReceiveTextDO convert(WxReceiveTextCreateReqVO bean);
WxReceiveTextDO convert(WxReceiveTextUpdateReqVO bean);
WxReceiveTextRespVO convert(WxReceiveTextDO bean);
List<WxReceiveTextRespVO> convertList(List<WxReceiveTextDO> list);
PageResult<WxReceiveTextRespVO> convertPage(PageResult<WxReceiveTextDO> page);
List<WxReceiveTextExcelVO> convertList02(List<WxReceiveTextDO> list);
}

View File

@ -1,34 +0,0 @@
package cn.iocoder.yudao.module.mp.convert.texttemplate;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate.WxTextTemplateDO;
/**
* 文本模板 Convert
*
* @author 芋道源码
*/
@Mapper
public interface WxTextTemplateConvert {
WxTextTemplateConvert INSTANCE = Mappers.getMapper(WxTextTemplateConvert.class);
WxTextTemplateDO convert(WxTextTemplateCreateReqVO bean);
WxTextTemplateDO convert(WxTextTemplateUpdateReqVO bean);
WxTextTemplateRespVO convert(WxTextTemplateDO bean);
List<WxTextTemplateRespVO> convertList(List<WxTextTemplateDO> list);
PageResult<WxTextTemplateRespVO> convertPage(PageResult<WxTextTemplateDO> page);
List<WxTextTemplateExcelVO> convertList02(List<WxTextTemplateDO> list);
}

View File

@ -1,51 +0,0 @@
package cn.iocoder.yudao.module.mp.dal.dataobject.mediaupload;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 微信素材上传表 DO
*
* @author 芋道源码
*/
@TableName("wx_media_upload")
@KeySequence("wx_media_upload_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WxMediaUploadDO extends BaseDO {
/**
* 主键
*/
@TableId
private Integer id;
/**
* 类型
*/
private String type;
/**
* 图片URL
*/
private String url;
/**
* 素材ID
*/
private String mediaId;
/**
* 缩略图素材ID
*/
private String thumbMediaId;
/**
* 微信账号ID
*/
private String wxAccountId;
}

View File

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.mp.dal.dataobject.message;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO;
import cn.iocoder.yudao.module.mp.enums.message.MpAutoReplyMatchEnum;
import cn.iocoder.yudao.module.mp.enums.message.MpAutoReplyTypeEnum;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.api.WxConsts.XmlMsgType;
/**
* 微信消息自动回复 DO
*
* @author 芋道源码
*/
@TableName(value = "mp_auto_reply", autoResultMap = true)
@KeySequence("mp_auto_reply_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class MpAutoReplyDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 微信公众号 ID
*
* 关联 {@link MpAccountDO#getId()}
*/
private Long accountId;
/**
* 微信公众号 appid
*
* 冗余 {@link MpAccountDO#getAppId()}
*/
private String appId;
/**
* 回复类型
*
* 枚举 {@link MpAutoReplyTypeEnum}
*/
private Integer type;
// ==================== 请求消息 ====================
/**
* 请求的关键字
*
* {@link #type} {@link MpAutoReplyTypeEnum#KEYWORD}
*/
private String requestKeyword;
/**
* 请求的关键字的匹配
*
* {@link #type} {@link MpAutoReplyTypeEnum#KEYWORD}
*
* 枚举 {@link MpAutoReplyMatchEnum}
*/
private Integer requestMatch;
/**
* 请求的消息类型
*
* {@link #type} {@link MpAutoReplyTypeEnum#MESSAGE}
*
* 枚举 {@link XmlMsgType} 中的 TEXTIMAGEVOICEVIDEOSHORTVIDEOLOCATIONLINK
*/
private String requestMessageType;
// ==================== 响应消息 ====================
/**
* 回复的消息类型
*
* 枚举 {@link XmlMsgType} 中的 TEXTIMAGEVOICEVIDEONEWS
*/
private String responseMessageType;
/**
* 回复的消息内容
*
* 消息类型为 {@link WxConsts.XmlMsgType} TEXT
*/
private String responseContent;
}

View File

@ -20,9 +20,6 @@ import me.chanjar.weixin.common.api.WxConsts;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MpMessageDO extends BaseDO { public class MpMessageDO extends BaseDO {
/** /**

View File

@ -1,47 +0,0 @@
package cn.iocoder.yudao.module.mp.dal.dataobject.receivetext;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 回复关键字 DO
*
* @author 芋道源码
*/
@TableName("wx_receive_text")
@KeySequence("wx_receive_text_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WxReceiveTextDO extends BaseDO {
/**
* 主键
*/
@TableId
private Integer id;
/**
* 关键字
*/
private String receiveText;
/**
* 消息类型 1文本消息2图文消息
*/
private String msgType;
/**
* 模板ID
*/
private String tplId;
/**
* 微信账号ID
*/
private String wxAccountId;
}

View File

@ -1,39 +0,0 @@
package cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 文本模板 DO
*
* @author 芋道源码
*/
@TableName("wx_text_template")
@KeySequence("wx_text_template_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WxTextTemplateDO extends BaseDO {
/**
* 主键
*/
@TableId
private Integer id;
/**
* 模板名字
*/
private String tplName;
/**
* 模板内容
*/
private String content;
}

View File

@ -1,42 +0,0 @@
package cn.iocoder.yudao.module.mp.dal.mysql.mediaupload;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.mp.dal.dataobject.mediaupload.WxMediaUploadDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo.*;
/**
* 微信素材上传表 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface WxMediaUploadMapper extends BaseMapperX<WxMediaUploadDO> {
default PageResult<WxMediaUploadDO> selectPage(WxMediaUploadPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<WxMediaUploadDO>()
.eqIfPresent(WxMediaUploadDO::getType, reqVO.getType())
.eqIfPresent(WxMediaUploadDO::getUrl, reqVO.getUrl())
.eqIfPresent(WxMediaUploadDO::getMediaId, reqVO.getMediaId())
.eqIfPresent(WxMediaUploadDO::getThumbMediaId, reqVO.getThumbMediaId())
.eqIfPresent(WxMediaUploadDO::getWxAccountId, reqVO.getWxAccountId())
.betweenIfPresent(WxMediaUploadDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc(WxMediaUploadDO::getId));
}
default List<WxMediaUploadDO> selectList(WxMediaUploadExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<WxMediaUploadDO>()
.eqIfPresent(WxMediaUploadDO::getType, reqVO.getType())
.eqIfPresent(WxMediaUploadDO::getUrl, reqVO.getUrl())
.eqIfPresent(WxMediaUploadDO::getMediaId, reqVO.getMediaId())
.eqIfPresent(WxMediaUploadDO::getThumbMediaId, reqVO.getThumbMediaId())
.eqIfPresent(WxMediaUploadDO::getWxAccountId, reqVO.getWxAccountId())
.betweenIfPresent(WxMediaUploadDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc(WxMediaUploadDO::getId));
}
}

View File

@ -1,40 +0,0 @@
package cn.iocoder.yudao.module.mp.dal.mysql.receivetext;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.mp.dal.dataobject.receivetext.WxReceiveTextDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo.*;
/**
* 回复关键字 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface WxReceiveTextMapper extends BaseMapperX<WxReceiveTextDO> {
default PageResult<WxReceiveTextDO> selectPage(WxReceiveTextPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<WxReceiveTextDO>()
.eqIfPresent(WxReceiveTextDO::getReceiveText, reqVO.getReceiveText())
.eqIfPresent(WxReceiveTextDO::getMsgType, reqVO.getMsgType())
.eqIfPresent(WxReceiveTextDO::getTplId, reqVO.getTplId())
.eqIfPresent(WxReceiveTextDO::getWxAccountId, reqVO.getWxAccountId())
.betweenIfPresent(WxReceiveTextDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc(WxReceiveTextDO::getId));
}
default List<WxReceiveTextDO> selectList(WxReceiveTextExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<WxReceiveTextDO>()
.eqIfPresent(WxReceiveTextDO::getReceiveText, reqVO.getReceiveText())
.eqIfPresent(WxReceiveTextDO::getMsgType, reqVO.getMsgType())
.eqIfPresent(WxReceiveTextDO::getTplId, reqVO.getTplId())
.eqIfPresent(WxReceiveTextDO::getWxAccountId, reqVO.getWxAccountId())
.betweenIfPresent(WxReceiveTextDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc(WxReceiveTextDO::getId));
}
}

View File

@ -1,36 +0,0 @@
package cn.iocoder.yudao.module.mp.dal.mysql.texttemplate;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate.WxTextTemplateDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo.*;
/**
* 文本模板 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface WxTextTemplateMapper extends BaseMapperX<WxTextTemplateDO> {
default PageResult<WxTextTemplateDO> selectPage(WxTextTemplatePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<WxTextTemplateDO>()
.likeIfPresent(WxTextTemplateDO::getTplName, reqVO.getTplName())
.eqIfPresent(WxTextTemplateDO::getContent, reqVO.getContent())
.betweenIfPresent(WxTextTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc(WxTextTemplateDO::getId));
}
default List<WxTextTemplateDO> selectList(WxTextTemplateExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<WxTextTemplateDO>()
.likeIfPresent(WxTextTemplateDO::getTplName, reqVO.getTplName())
.eqIfPresent(WxTextTemplateDO::getContent, reqVO.getContent())
.betweenIfPresent(WxTextTemplateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.orderByDesc(WxTextTemplateDO::getId));
}
}

View File

@ -46,6 +46,10 @@ public class MessageAutoReplyHandler implements WxMpMessageHandler {
@Resource @Resource
private FileApi fileApi; private FileApi fileApi;
// auto reply
// createMessage
// outmessage
@Override @Override
public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context,
WxMpService weixinService, WxSessionManager sessionManager) { WxMpService weixinService, WxSessionManager sessionManager) {

View File

@ -1,71 +0,0 @@
package cn.iocoder.yudao.module.mp.service.mediaupload;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.mediaupload.WxMediaUploadDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 微信素材上传表 Service 接口
*
* @author 芋道源码
*/
public interface WxMediaUploadService {
/**
* 创建微信素材上传表
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createWxMediaUpload(@Valid WxMediaUploadCreateReqVO createReqVO);
/**
* 更新微信素材上传表
*
* @param updateReqVO 更新信息
*/
void updateWxMediaUpload(@Valid WxMediaUploadUpdateReqVO updateReqVO);
/**
* 删除微信素材上传表
*
* @param id 编号
*/
void deleteWxMediaUpload(Integer id);
/**
* 获得微信素材上传表
*
* @param id 编号
* @return 微信素材上传表
*/
WxMediaUploadDO getWxMediaUpload(Integer id);
/**
* 获得微信素材上传表 列表
*
* @param ids 编号
* @return 微信素材上传表 列表
*/
List<WxMediaUploadDO> getWxMediaUploadList(Collection<Integer> ids);
/**
* 获得微信素材上传表 分页
*
* @param pageReqVO 分页查询
* @return 微信素材上传表 分页
*/
PageResult<WxMediaUploadDO> getWxMediaUploadPage(WxMediaUploadPageReqVO pageReqVO);
/**
* 获得微信素材上传表 列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 微信素材上传表 列表
*/
List<WxMediaUploadDO> getWxMediaUploadList(WxMediaUploadExportReqVO exportReqVO);
}

View File

@ -1,85 +0,0 @@
package cn.iocoder.yudao.module.mp.service.mediaupload;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.mediaupload.WxMediaUploadDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mp.convert.mediaupload.WxMediaUploadConvert;
import cn.iocoder.yudao.module.mp.dal.mysql.mediaupload.WxMediaUploadMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*;
/**
* 微信素材上传表 Service 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class WxMediaUploadServiceImpl implements WxMediaUploadService {
@Resource
private WxMediaUploadMapper wxMediaUploadMapper;
@Override
public Integer createWxMediaUpload(WxMediaUploadCreateReqVO createReqVO) {
// 插入
WxMediaUploadDO wxMediaUpload = WxMediaUploadConvert.INSTANCE.convert(createReqVO);
wxMediaUploadMapper.insert(wxMediaUpload);
// 返回
return wxMediaUpload.getId();
}
@Override
public void updateWxMediaUpload(WxMediaUploadUpdateReqVO updateReqVO) {
// 校验存在
this.validateWxMediaUploadExists(updateReqVO.getId());
// 更新
WxMediaUploadDO updateObj = WxMediaUploadConvert.INSTANCE.convert(updateReqVO);
wxMediaUploadMapper.updateById(updateObj);
}
@Override
public void deleteWxMediaUpload(Integer id) {
// 校验存在
this.validateWxMediaUploadExists(id);
// 删除
wxMediaUploadMapper.deleteById(id);
}
private void validateWxMediaUploadExists(Integer id) {
if (wxMediaUploadMapper.selectById(id) == null) {
throw exception(COMMON_NOT_EXISTS);
}
}
@Override
public WxMediaUploadDO getWxMediaUpload(Integer id) {
return wxMediaUploadMapper.selectById(id);
}
@Override
public List<WxMediaUploadDO> getWxMediaUploadList(Collection<Integer> ids) {
return wxMediaUploadMapper.selectBatchIds(ids);
}
@Override
public PageResult<WxMediaUploadDO> getWxMediaUploadPage(WxMediaUploadPageReqVO pageReqVO) {
return wxMediaUploadMapper.selectPage(pageReqVO);
}
@Override
public List<WxMediaUploadDO> getWxMediaUploadList(WxMediaUploadExportReqVO exportReqVO) {
return wxMediaUploadMapper.selectList(exportReqVO);
}
}

View File

@ -12,6 +12,7 @@ import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
*/ */
public interface MpMessageService { public interface MpMessageService {
// TODO 芋艿方法名要优化下
/** /**
* 获得粉丝消息表分页 * 获得粉丝消息表分页
* *

View File

@ -1,71 +0,0 @@
package cn.iocoder.yudao.module.mp.service.receivetext;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.receivetext.WxReceiveTextDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 回复关键字 Service 接口
*
* @author 芋道源码
*/
public interface WxReceiveTextService {
/**
* 创建回复关键字
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createWxReceiveText(@Valid WxReceiveTextCreateReqVO createReqVO);
/**
* 更新回复关键字
*
* @param updateReqVO 更新信息
*/
void updateWxReceiveText(@Valid WxReceiveTextUpdateReqVO updateReqVO);
/**
* 删除回复关键字
*
* @param id 编号
*/
void deleteWxReceiveText(Integer id);
/**
* 获得回复关键字
*
* @param id 编号
* @return 回复关键字
*/
WxReceiveTextDO getWxReceiveText(Integer id);
/**
* 获得回复关键字列表
*
* @param ids 编号
* @return 回复关键字列表
*/
List<WxReceiveTextDO> getWxReceiveTextList(Collection<Integer> ids);
/**
* 获得回复关键字分页
*
* @param pageReqVO 分页查询
* @return 回复关键字分页
*/
PageResult<WxReceiveTextDO> getWxReceiveTextPage(WxReceiveTextPageReqVO pageReqVO);
/**
* 获得回复关键字列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 回复关键字列表
*/
List<WxReceiveTextDO> getWxReceiveTextList(WxReceiveTextExportReqVO exportReqVO);
}

View File

@ -1,85 +0,0 @@
package cn.iocoder.yudao.module.mp.service.receivetext;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.receivetext.WxReceiveTextDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mp.convert.receivetext.WxReceiveTextConvert;
import cn.iocoder.yudao.module.mp.dal.mysql.receivetext.WxReceiveTextMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*;
/**
* 回复关键字 Service 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class WxReceiveTextServiceImpl implements WxReceiveTextService {
@Resource
private WxReceiveTextMapper wxReceiveTextMapper;
@Override
public Integer createWxReceiveText(WxReceiveTextCreateReqVO createReqVO) {
// 插入
WxReceiveTextDO wxReceiveText = WxReceiveTextConvert.INSTANCE.convert(createReqVO);
wxReceiveTextMapper.insert(wxReceiveText);
// 返回
return wxReceiveText.getId();
}
@Override
public void updateWxReceiveText(WxReceiveTextUpdateReqVO updateReqVO) {
// 校验存在
this.validateWxReceiveTextExists(updateReqVO.getId());
// 更新
WxReceiveTextDO updateObj = WxReceiveTextConvert.INSTANCE.convert(updateReqVO);
wxReceiveTextMapper.updateById(updateObj);
}
@Override
public void deleteWxReceiveText(Integer id) {
// 校验存在
this.validateWxReceiveTextExists(id);
// 删除
wxReceiveTextMapper.deleteById(id);
}
private void validateWxReceiveTextExists(Integer id) {
if (wxReceiveTextMapper.selectById(id) == null) {
throw exception(COMMON_NOT_EXISTS);
}
}
@Override
public WxReceiveTextDO getWxReceiveText(Integer id) {
return wxReceiveTextMapper.selectById(id);
}
@Override
public List<WxReceiveTextDO> getWxReceiveTextList(Collection<Integer> ids) {
return wxReceiveTextMapper.selectBatchIds(ids);
}
@Override
public PageResult<WxReceiveTextDO> getWxReceiveTextPage(WxReceiveTextPageReqVO pageReqVO) {
return wxReceiveTextMapper.selectPage(pageReqVO);
}
@Override
public List<WxReceiveTextDO> getWxReceiveTextList(WxReceiveTextExportReqVO exportReqVO) {
return wxReceiveTextMapper.selectList(exportReqVO);
}
}

View File

@ -1,71 +0,0 @@
package cn.iocoder.yudao.module.mp.service.texttemplate;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate.WxTextTemplateDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 文本模板 Service 接口
*
* @author 芋道源码
*/
public interface WxTextTemplateService {
/**
* 创建文本模板
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createWxTextTemplate(@Valid WxTextTemplateCreateReqVO createReqVO);
/**
* 更新文本模板
*
* @param updateReqVO 更新信息
*/
void updateWxTextTemplate(@Valid WxTextTemplateUpdateReqVO updateReqVO);
/**
* 删除文本模板
*
* @param id 编号
*/
void deleteWxTextTemplate(Integer id);
/**
* 获得文本模板
*
* @param id 编号
* @return 文本模板
*/
WxTextTemplateDO getWxTextTemplate(Integer id);
/**
* 获得文本模板列表
*
* @param ids 编号
* @return 文本模板列表
*/
List<WxTextTemplateDO> getWxTextTemplateList(Collection<Integer> ids);
/**
* 获得文本模板分页
*
* @param pageReqVO 分页查询
* @return 文本模板分页
*/
PageResult<WxTextTemplateDO> getWxTextTemplatePage(WxTextTemplatePageReqVO pageReqVO);
/**
* 获得文本模板列表, 用于 Excel 导出
*
* @param exportReqVO 查询条件
* @return 文本模板列表
*/
List<WxTextTemplateDO> getWxTextTemplateList(WxTextTemplateExportReqVO exportReqVO);
}

View File

@ -1,85 +0,0 @@
package cn.iocoder.yudao.module.mp.service.texttemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.mp.controller.admin.texttemplate.vo.*;
import cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate.WxTextTemplateDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mp.convert.texttemplate.WxTextTemplateConvert;
import cn.iocoder.yudao.module.mp.dal.mysql.texttemplate.WxTextTemplateMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*;
/**
* 文本模板 Service 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class WxTextTemplateServiceImpl implements WxTextTemplateService {
@Resource
private WxTextTemplateMapper wxTextTemplateMapper;
@Override
public Integer createWxTextTemplate(WxTextTemplateCreateReqVO createReqVO) {
// 插入
WxTextTemplateDO wxTextTemplate = WxTextTemplateConvert.INSTANCE.convert(createReqVO);
wxTextTemplateMapper.insert(wxTextTemplate);
// 返回
return wxTextTemplate.getId();
}
@Override
public void updateWxTextTemplate(WxTextTemplateUpdateReqVO updateReqVO) {
// 校验存在
this.validateWxTextTemplateExists(updateReqVO.getId());
// 更新
WxTextTemplateDO updateObj = WxTextTemplateConvert.INSTANCE.convert(updateReqVO);
wxTextTemplateMapper.updateById(updateObj);
}
@Override
public void deleteWxTextTemplate(Integer id) {
// 校验存在
this.validateWxTextTemplateExists(id);
// 删除
wxTextTemplateMapper.deleteById(id);
}
private void validateWxTextTemplateExists(Integer id) {
if (wxTextTemplateMapper.selectById(id) == null) {
throw exception(COMMON_NOT_EXISTS);
}
}
@Override
public WxTextTemplateDO getWxTextTemplate(Integer id) {
return wxTextTemplateMapper.selectById(id);
}
@Override
public List<WxTextTemplateDO> getWxTextTemplateList(Collection<Integer> ids) {
return wxTextTemplateMapper.selectBatchIds(ids);
}
@Override
public PageResult<WxTextTemplateDO> getWxTextTemplatePage(WxTextTemplatePageReqVO pageReqVO) {
return wxTextTemplateMapper.selectPage(pageReqVO);
}
@Override
public List<WxTextTemplateDO> getWxTextTemplateList(WxTextTemplateExportReqVO exportReqVO) {
return wxTextTemplateMapper.selectList(exportReqVO);
}
}