Commit fefad029ad062c4ad9a022504d2c7268cf0fdc54
1 parent
39d377b0
mp:重构部分 message 的实现
Showing
46 changed files
with
447 additions
and
1187 deletions
yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/enums/message/MpMessageSendFrom.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.enums.message; | ||
| 2 | + | ||
| 3 | +import lombok.AllArgsConstructor; | ||
| 4 | +import lombok.Getter; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 微信公众号消息的发送来源 | ||
| 8 | + * | ||
| 9 | + * @author 芋道源码 | ||
| 10 | + */ | ||
| 11 | +@Getter | ||
| 12 | +@AllArgsConstructor | ||
| 13 | +public enum MpMessageSendFrom { | ||
| 14 | + | ||
| 15 | + USER_TO_MP(1, "用户发送给公众号"), | ||
| 16 | + MP_TO_USER(2, "公众号发给用户"), | ||
| 17 | + ; | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * 来源 | ||
| 21 | + */ | ||
| 22 | + private final Integer from; | ||
| 23 | + /** | ||
| 24 | + * 来源的名字 | ||
| 25 | + */ | ||
| 26 | + private final String name; | ||
| 27 | + | ||
| 28 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsg/WxFansMsgController.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsg; | ||
| 2 | - | ||
| 3 | -import org.springframework.web.bind.annotation.*; | ||
| 4 | - | ||
| 5 | -import javax.annotation.Resource; | ||
| 6 | - | ||
| 7 | -import org.springframework.validation.annotation.Validated; | ||
| 8 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
| 9 | -import io.swagger.annotations.*; | ||
| 10 | - | ||
| 11 | -import javax.validation.*; | ||
| 12 | -import javax.servlet.http.*; | ||
| 13 | -import java.util.*; | ||
| 14 | -import java.io.IOException; | ||
| 15 | - | ||
| 16 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 17 | -import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 18 | - | ||
| 19 | -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 20 | - | ||
| 21 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||
| 22 | - | ||
| 23 | -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 24 | - | ||
| 25 | -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; | ||
| 26 | - | ||
| 27 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.*; | ||
| 28 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsg.WxFansMsgDO; | ||
| 29 | -import cn.iocoder.yudao.module.mp.convert.fansmsg.WxFansMsgConvert; | ||
| 30 | -import cn.iocoder.yudao.module.mp.service.fansmsg.WxFansMsgService; | ||
| 31 | - | ||
| 32 | -@Api(tags = "管理后台 - 粉丝消息表 ") | ||
| 33 | -@RestController | ||
| 34 | -@RequestMapping("/wechatMp/wx-fans-msg") | ||
| 35 | -@Validated | ||
| 36 | -public class WxFansMsgController { | ||
| 37 | - | ||
| 38 | - @Resource | ||
| 39 | - private WxFansMsgService wxFansMsgService; | ||
| 40 | - | ||
| 41 | - @PostMapping("/create") | ||
| 42 | - @ApiOperation("创建粉丝消息表 ") | ||
| 43 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:create')") | ||
| 44 | - public CommonResult<Integer> createWxFansMsg(@Valid @RequestBody WxFansMsgCreateReqVO createReqVO) { | ||
| 45 | - return success(wxFansMsgService.createWxFansMsg(createReqVO)); | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - @PutMapping("/update") | ||
| 49 | - @ApiOperation("更新粉丝消息表 ") | ||
| 50 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:update')") | ||
| 51 | - public CommonResult<Boolean> updateWxFansMsg(@Valid @RequestBody WxFansMsgUpdateReqVO updateReqVO) { | ||
| 52 | - wxFansMsgService.updateWxFansMsg(updateReqVO); | ||
| 53 | - return success(true); | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - @DeleteMapping("/delete") | ||
| 57 | - @ApiOperation("删除粉丝消息表 ") | ||
| 58 | - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class) | ||
| 59 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:delete')") | ||
| 60 | - public CommonResult<Boolean> deleteWxFansMsg(@RequestParam("id") Integer id) { | ||
| 61 | - wxFansMsgService.deleteWxFansMsg(id); | ||
| 62 | - return success(true); | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - @GetMapping("/get") | ||
| 66 | - @ApiOperation("获得粉丝消息表 ") | ||
| 67 | - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class) | ||
| 68 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:query')") | ||
| 69 | - public CommonResult<WxFansMsgRespVO> getWxFansMsg(@RequestParam("id") Integer id) { | ||
| 70 | - WxFansMsgDO wxFansMsg = wxFansMsgService.getWxFansMsg(id); | ||
| 71 | - return success(WxFansMsgConvert.INSTANCE.convert(wxFansMsg)); | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - @GetMapping("/list") | ||
| 75 | - @ApiOperation("获得粉丝消息表 列表") | ||
| 76 | - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) | ||
| 77 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:query')") | ||
| 78 | - public CommonResult<List<WxFansMsgRespVO>> getWxFansMsgList(@RequestParam("ids") Collection<Integer> ids) { | ||
| 79 | - List<WxFansMsgDO> list = wxFansMsgService.getWxFansMsgList(ids); | ||
| 80 | - return success(WxFansMsgConvert.INSTANCE.convertList(list)); | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - @GetMapping("/page") | ||
| 84 | - @ApiOperation("获得粉丝消息表 分页") | ||
| 85 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:query')") | ||
| 86 | - public CommonResult<PageResult<WxFansMsgRespVO>> getWxFansMsgPage(@Valid WxFansMsgPageReqVO pageVO) { | ||
| 87 | - PageResult<WxFansMsgDO> pageResult = wxFansMsgService.getWxFansMsgPage(pageVO); | ||
| 88 | - return success(WxFansMsgConvert.INSTANCE.convertPage(pageResult)); | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - @GetMapping("/export-excel") | ||
| 92 | - @ApiOperation("导出粉丝消息表 Excel") | ||
| 93 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:export')") | ||
| 94 | - @OperateLog(type = EXPORT) | ||
| 95 | - public void exportWxFansMsgExcel(@Valid WxFansMsgExportReqVO exportReqVO, | ||
| 96 | - HttpServletResponse response) throws IOException { | ||
| 97 | - List<WxFansMsgDO> list = wxFansMsgService.getWxFansMsgList(exportReqVO); | ||
| 98 | - // 导出 Excel | ||
| 99 | - List<WxFansMsgExcelVO> datas = WxFansMsgConvert.INSTANCE.convertList02(list); | ||
| 100 | - ExcelUtils.write(response, "粉丝消息表 .xls", "数据", WxFansMsgExcelVO.class, datas); | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsg/vo/WxFansMsgCreateReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | - | ||
| 6 | -@ApiModel("管理后台 - 粉丝消息表 创建 Request VO") | ||
| 7 | -@Data | ||
| 8 | -@EqualsAndHashCode(callSuper = true) | ||
| 9 | -@ToString(callSuper = true) | ||
| 10 | -public class WxFansMsgCreateReqVO extends WxFansMsgBaseVO { | ||
| 11 | - | ||
| 12 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsg/vo/WxFansMsgExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * 粉丝消息表 Excel VO | ||
| 11 | - * | ||
| 12 | - * @author 芋道源码 | ||
| 13 | - */ | ||
| 14 | -@Data | ||
| 15 | -public class WxFansMsgExcelVO { | ||
| 16 | - | ||
| 17 | - @ExcelProperty("主键") | ||
| 18 | - private Integer id; | ||
| 19 | - | ||
| 20 | - @ExcelProperty("用户标识") | ||
| 21 | - private String openid; | ||
| 22 | - | ||
| 23 | - @ExcelProperty("昵称") | ||
| 24 | - private byte[] nickname; | ||
| 25 | - | ||
| 26 | - @ExcelProperty("头像地址") | ||
| 27 | - private String headimgUrl; | ||
| 28 | - | ||
| 29 | - @ExcelProperty("微信账号ID") | ||
| 30 | - private String wxAccountId; | ||
| 31 | - | ||
| 32 | - @ExcelProperty("消息类型") | ||
| 33 | - private String msgType; | ||
| 34 | - | ||
| 35 | - @ExcelProperty("内容") | ||
| 36 | - private String content; | ||
| 37 | - | ||
| 38 | - @ExcelProperty("最近一条回复内容") | ||
| 39 | - private String resContent; | ||
| 40 | - | ||
| 41 | - @ExcelProperty("是否已回复") | ||
| 42 | - private String isRes; | ||
| 43 | - | ||
| 44 | - @ExcelProperty("微信素材ID") | ||
| 45 | - private String mediaId; | ||
| 46 | - | ||
| 47 | - @ExcelProperty("微信图片URL") | ||
| 48 | - private String picUrl; | ||
| 49 | - | ||
| 50 | - @ExcelProperty("本地图片路径") | ||
| 51 | - private String picPath; | ||
| 52 | - | ||
| 53 | - @ExcelProperty("创建时间") | ||
| 54 | - private Date createTime; | ||
| 55 | - | ||
| 56 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsg/vo/WxFansMsgExportReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | - | ||
| 10 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 11 | - | ||
| 12 | -@ApiModel(value = "管理后台 - 粉丝消息表 Excel 导出 Request VO", description = "参数和 WxFansMsgPageReqVO 是一致的") | ||
| 13 | -@Data | ||
| 14 | -public class WxFansMsgExportReqVO { | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "用户标识") | ||
| 17 | - private String openid; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "昵称") | ||
| 20 | - private String nickname; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "头像地址") | ||
| 23 | - private String headimgUrl; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "微信账号ID") | ||
| 26 | - private String wxAccountId; | ||
| 27 | - | ||
| 28 | - @ApiModelProperty(value = "消息类型") | ||
| 29 | - private String msgType; | ||
| 30 | - | ||
| 31 | - @ApiModelProperty(value = "内容") | ||
| 32 | - private String content; | ||
| 33 | - | ||
| 34 | - @ApiModelProperty(value = "最近一条回复内容") | ||
| 35 | - private String resContent; | ||
| 36 | - | ||
| 37 | - @ApiModelProperty(value = "是否已回复") | ||
| 38 | - private String isRes; | ||
| 39 | - | ||
| 40 | - @ApiModelProperty(value = "微信素材ID") | ||
| 41 | - private String mediaId; | ||
| 42 | - | ||
| 43 | - @ApiModelProperty(value = "微信图片URL") | ||
| 44 | - private String picUrl; | ||
| 45 | - | ||
| 46 | - @ApiModelProperty(value = "本地图片路径") | ||
| 47 | - private String picPath; | ||
| 48 | - | ||
| 49 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 50 | - @ApiModelProperty(value = "开始创建时间") | ||
| 51 | - private Date beginCreateTime; | ||
| 52 | - | ||
| 53 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 54 | - @ApiModelProperty(value = "结束创建时间") | ||
| 55 | - private Date endCreateTime; | ||
| 56 | - | ||
| 57 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsg/vo/WxFansMsgPageReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 9 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 10 | - | ||
| 11 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 12 | - | ||
| 13 | -@ApiModel("管理后台 - 粉丝消息表 分页 Request VO") | ||
| 14 | -@Data | ||
| 15 | -@EqualsAndHashCode(callSuper = true) | ||
| 16 | -@ToString(callSuper = true) | ||
| 17 | -public class WxFansMsgPageReqVO extends PageParam { | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "用户标识") | ||
| 20 | - private String openid; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "昵称") | ||
| 23 | - private String nickname; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "头像地址") | ||
| 26 | - private String headimgUrl; | ||
| 27 | - | ||
| 28 | - @ApiModelProperty(value = "微信账号ID") | ||
| 29 | - private String wxAccountId; | ||
| 30 | - | ||
| 31 | - @ApiModelProperty(value = "消息类型") | ||
| 32 | - private String msgType; | ||
| 33 | - | ||
| 34 | - @ApiModelProperty(value = "内容") | ||
| 35 | - private String content; | ||
| 36 | - | ||
| 37 | - @ApiModelProperty(value = "最近一条回复内容") | ||
| 38 | - private String resContent; | ||
| 39 | - | ||
| 40 | - @ApiModelProperty(value = "是否已回复") | ||
| 41 | - private String isRes; | ||
| 42 | - | ||
| 43 | - @ApiModelProperty(value = "微信素材ID") | ||
| 44 | - private String mediaId; | ||
| 45 | - | ||
| 46 | - @ApiModelProperty(value = "微信图片URL") | ||
| 47 | - private String picUrl; | ||
| 48 | - | ||
| 49 | - @ApiModelProperty(value = "本地图片路径") | ||
| 50 | - private String picPath; | ||
| 51 | - | ||
| 52 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 53 | - @ApiModelProperty(value = "开始创建时间") | ||
| 54 | - private Date beginCreateTime; | ||
| 55 | - | ||
| 56 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 57 | - @ApiModelProperty(value = "结束创建时间") | ||
| 58 | - private Date endCreateTime; | ||
| 59 | - | ||
| 60 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsg/vo/WxFansMsgUpdateReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | - | ||
| 6 | -import javax.validation.constraints.*; | ||
| 7 | - | ||
| 8 | -@ApiModel("管理后台 - 粉丝消息表 更新 Request VO") | ||
| 9 | -@Data | ||
| 10 | -@EqualsAndHashCode(callSuper = true) | ||
| 11 | -@ToString(callSuper = true) | ||
| 12 | -public class WxFansMsgUpdateReqVO extends WxFansMsgBaseVO { | ||
| 13 | - | ||
| 14 | - @ApiModelProperty(value = "主键", required = true) | ||
| 15 | - @NotNull(message = "主键不能为空") | ||
| 16 | - private Integer id; | ||
| 17 | - | ||
| 18 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsgres/WxFansMsgResController.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres; | ||
| 2 | - | ||
| 3 | -import org.springframework.web.bind.annotation.*; | ||
| 4 | - | ||
| 5 | -import javax.annotation.Resource; | ||
| 6 | - | ||
| 7 | -import org.springframework.validation.annotation.Validated; | ||
| 8 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
| 9 | -import io.swagger.annotations.*; | ||
| 10 | - | ||
| 11 | -import javax.validation.*; | ||
| 12 | -import javax.servlet.http.*; | ||
| 13 | -import java.util.*; | ||
| 14 | -import java.io.IOException; | ||
| 15 | - | ||
| 16 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 17 | -import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 18 | - | ||
| 19 | -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 20 | - | ||
| 21 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||
| 22 | - | ||
| 23 | -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 24 | - | ||
| 25 | -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; | ||
| 26 | - | ||
| 27 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo.*; | ||
| 28 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsgres.WxFansMsgResDO; | ||
| 29 | -import cn.iocoder.yudao.module.mp.convert.fansmsgres.WxFansMsgResConvert; | ||
| 30 | -import cn.iocoder.yudao.module.mp.service.fansmsgres.WxFansMsgResService; | ||
| 31 | - | ||
| 32 | -@Api(tags = "管理后台 - 回复粉丝消息历史表 ") | ||
| 33 | -@RestController | ||
| 34 | -@RequestMapping("/wechatMp/wx-fans-msg-res") | ||
| 35 | -@Validated | ||
| 36 | -public class WxFansMsgResController { | ||
| 37 | - | ||
| 38 | - @Resource | ||
| 39 | - private WxFansMsgResService wxFansMsgResService; | ||
| 40 | - | ||
| 41 | - @PostMapping("/create") | ||
| 42 | - @ApiOperation("创建回复粉丝消息历史表 ") | ||
| 43 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:create')") | ||
| 44 | - public CommonResult<Integer> createWxFansMsgRes(@Valid @RequestBody WxFansMsgResCreateReqVO createReqVO) { | ||
| 45 | - return success(wxFansMsgResService.createWxFansMsgRes(createReqVO)); | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - @PutMapping("/update") | ||
| 49 | - @ApiOperation("更新回复粉丝消息历史表 ") | ||
| 50 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:update')") | ||
| 51 | - public CommonResult<Boolean> updateWxFansMsgRes(@Valid @RequestBody WxFansMsgResUpdateReqVO updateReqVO) { | ||
| 52 | - wxFansMsgResService.updateWxFansMsgRes(updateReqVO); | ||
| 53 | - return success(true); | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - @DeleteMapping("/delete") | ||
| 57 | - @ApiOperation("删除回复粉丝消息历史表 ") | ||
| 58 | - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class) | ||
| 59 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:delete')") | ||
| 60 | - public CommonResult<Boolean> deleteWxFansMsgRes(@RequestParam("id") Integer id) { | ||
| 61 | - wxFansMsgResService.deleteWxFansMsgRes(id); | ||
| 62 | - return success(true); | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - @GetMapping("/get") | ||
| 66 | - @ApiOperation("获得回复粉丝消息历史表 ") | ||
| 67 | - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class) | ||
| 68 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:query')") | ||
| 69 | - public CommonResult<WxFansMsgResRespVO> getWxFansMsgRes(@RequestParam("id") Integer id) { | ||
| 70 | - WxFansMsgResDO wxFansMsgRes = wxFansMsgResService.getWxFansMsgRes(id); | ||
| 71 | - return success(WxFansMsgResConvert.INSTANCE.convert(wxFansMsgRes)); | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - @GetMapping("/list") | ||
| 75 | - @ApiOperation("获得回复粉丝消息历史表 列表") | ||
| 76 | - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) | ||
| 77 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:query')") | ||
| 78 | - public CommonResult<List<WxFansMsgResRespVO>> getWxFansMsgResList(@RequestParam("ids") Collection<Integer> ids) { | ||
| 79 | - List<WxFansMsgResDO> list = wxFansMsgResService.getWxFansMsgResList(ids); | ||
| 80 | - return success(WxFansMsgResConvert.INSTANCE.convertList(list)); | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - @GetMapping("/page") | ||
| 84 | - @ApiOperation("获得回复粉丝消息历史表 分页") | ||
| 85 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:query')") | ||
| 86 | - public CommonResult<PageResult<WxFansMsgResRespVO>> getWxFansMsgResPage(@Valid WxFansMsgResPageReqVO pageVO) { | ||
| 87 | - PageResult<WxFansMsgResDO> pageResult = wxFansMsgResService.getWxFansMsgResPage(pageVO); | ||
| 88 | - return success(WxFansMsgResConvert.INSTANCE.convertPage(pageResult)); | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - @GetMapping("/export-excel") | ||
| 92 | - @ApiOperation("导出回复粉丝消息历史表 Excel") | ||
| 93 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:export')") | ||
| 94 | - @OperateLog(type = EXPORT) | ||
| 95 | - public void exportWxFansMsgResExcel(@Valid WxFansMsgResExportReqVO exportReqVO, | ||
| 96 | - HttpServletResponse response) throws IOException { | ||
| 97 | - List<WxFansMsgResDO> list = wxFansMsgResService.getWxFansMsgResList(exportReqVO); | ||
| 98 | - // 导出 Excel | ||
| 99 | - List<WxFansMsgResExcelVO> datas = WxFansMsgResConvert.INSTANCE.convertList02(list); | ||
| 100 | - ExcelUtils.write(response, "回复粉丝消息历史表 .xls", "数据", WxFansMsgResExcelVO.class, datas); | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsgres/vo/WxFansMsgResBaseVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 回复粉丝消息历史表 Base VO,提供给添加、修改、详细的子 VO 使用 | ||
| 8 | - * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||
| 9 | - */ | ||
| 10 | -@Data | ||
| 11 | -public class WxFansMsgResBaseVO { | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "粉丝消息ID") | ||
| 14 | - private String fansMsgId; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "回复内容") | ||
| 17 | - private String resContent; | ||
| 18 | - | ||
| 19 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsgres/vo/WxFansMsgResCreateReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | - | ||
| 6 | -@ApiModel("管理后台 - 回复粉丝消息历史表 创建 Request VO") | ||
| 7 | -@Data | ||
| 8 | -@EqualsAndHashCode(callSuper = true) | ||
| 9 | -@ToString(callSuper = true) | ||
| 10 | -public class WxFansMsgResCreateReqVO extends WxFansMsgResBaseVO { | ||
| 11 | - | ||
| 12 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsgres/vo/WxFansMsgResExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * 回复粉丝消息历史表 Excel VO | ||
| 11 | - * | ||
| 12 | - * @author 芋道源码 | ||
| 13 | - */ | ||
| 14 | -@Data | ||
| 15 | -public class WxFansMsgResExcelVO { | ||
| 16 | - | ||
| 17 | - @ExcelProperty("主键") | ||
| 18 | - private Integer id; | ||
| 19 | - | ||
| 20 | - @ExcelProperty("粉丝消息ID") | ||
| 21 | - private String fansMsgId; | ||
| 22 | - | ||
| 23 | - @ExcelProperty("回复内容") | ||
| 24 | - private String resContent; | ||
| 25 | - | ||
| 26 | - @ExcelProperty("创建时间") | ||
| 27 | - private Date createTime; | ||
| 28 | - | ||
| 29 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsgres/vo/WxFansMsgResExportReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | - | ||
| 10 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 11 | - | ||
| 12 | -@ApiModel(value = "管理后台 - 回复粉丝消息历史表 Excel 导出 Request VO", description = "参数和 WxFansMsgResPageReqVO 是一致的") | ||
| 13 | -@Data | ||
| 14 | -public class WxFansMsgResExportReqVO { | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "粉丝消息ID") | ||
| 17 | - private String fansMsgId; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "回复内容") | ||
| 20 | - private String resContent; | ||
| 21 | - | ||
| 22 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 23 | - @ApiModelProperty(value = "开始创建时间") | ||
| 24 | - private Date beginCreateTime; | ||
| 25 | - | ||
| 26 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 27 | - @ApiModelProperty(value = "结束创建时间") | ||
| 28 | - private Date endCreateTime; | ||
| 29 | - | ||
| 30 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsgres/vo/WxFansMsgResPageReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 9 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 10 | - | ||
| 11 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 12 | - | ||
| 13 | -@ApiModel("管理后台 - 回复粉丝消息历史表 分页 Request VO") | ||
| 14 | -@Data | ||
| 15 | -@EqualsAndHashCode(callSuper = true) | ||
| 16 | -@ToString(callSuper = true) | ||
| 17 | -public class WxFansMsgResPageReqVO extends PageParam { | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "粉丝消息ID") | ||
| 20 | - private String fansMsgId; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "回复内容") | ||
| 23 | - private String resContent; | ||
| 24 | - | ||
| 25 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 26 | - @ApiModelProperty(value = "开始创建时间") | ||
| 27 | - private Date beginCreateTime; | ||
| 28 | - | ||
| 29 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 30 | - @ApiModelProperty(value = "结束创建时间") | ||
| 31 | - private Date endCreateTime; | ||
| 32 | - | ||
| 33 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsgres/vo/WxFansMsgResRespVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | - | ||
| 9 | -@ApiModel("管理后台 - 回复粉丝消息历史表 Response VO") | ||
| 10 | -@Data | ||
| 11 | -@EqualsAndHashCode(callSuper = true) | ||
| 12 | -@ToString(callSuper = true) | ||
| 13 | -public class WxFansMsgResRespVO extends WxFansMsgResBaseVO { | ||
| 14 | - | ||
| 15 | - @ApiModelProperty(value = "主键", required = true) | ||
| 16 | - private Integer id; | ||
| 17 | - | ||
| 18 | - @ApiModelProperty(value = "创建时间", required = true) | ||
| 19 | - private Date createTime; | ||
| 20 | - | ||
| 21 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsgres/vo/WxFansMsgResUpdateReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | - | ||
| 6 | -import javax.validation.constraints.*; | ||
| 7 | - | ||
| 8 | -@ApiModel("管理后台 - 回复粉丝消息历史表 更新 Request VO") | ||
| 9 | -@Data | ||
| 10 | -@EqualsAndHashCode(callSuper = true) | ||
| 11 | -@ToString(callSuper = true) | ||
| 12 | -public class WxFansMsgResUpdateReqVO extends WxFansMsgResBaseVO { | ||
| 13 | - | ||
| 14 | - @ApiModelProperty(value = "主键", required = true) | ||
| 15 | - @NotNull(message = "主键不能为空") | ||
| 16 | - private Integer id; | ||
| 17 | - | ||
| 18 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpMessageController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.controller.admin.message; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | ||
| 4 | +import org.springframework.web.bind.annotation.*; | ||
| 5 | + | ||
| 6 | +import javax.annotation.Resource; | ||
| 7 | + | ||
| 8 | +import org.springframework.validation.annotation.Validated; | ||
| 9 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 10 | +import io.swagger.annotations.*; | ||
| 11 | + | ||
| 12 | +import javax.validation.*; | ||
| 13 | + | ||
| 14 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 15 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 16 | + | ||
| 17 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 18 | + | ||
| 19 | +import cn.iocoder.yudao.module.mp.controller.admin.message.vo.*; | ||
| 20 | +import cn.iocoder.yudao.module.mp.convert.message.MpMessageConvert; | ||
| 21 | +import cn.iocoder.yudao.module.mp.service.message.MpMessageService; | ||
| 22 | + | ||
| 23 | +@Api(tags = "管理后台 - 粉丝消息表") | ||
| 24 | +@RestController | ||
| 25 | +@RequestMapping("/mp/message") | ||
| 26 | +@Validated | ||
| 27 | +public class MpMessageController { | ||
| 28 | + | ||
| 29 | + @Resource | ||
| 30 | + private MpMessageService mpMessageService; | ||
| 31 | + | ||
| 32 | + @GetMapping("/page") | ||
| 33 | + @ApiOperation("获得粉丝消息表分页") | ||
| 34 | + @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:query')") | ||
| 35 | + public CommonResult<PageResult<MpMessageRespVO>> getWxFansMsgPage(@Valid MpMessagePageReqVO pageVO) { | ||
| 36 | + PageResult<MpMessageDO> pageResult = mpMessageService.getWxFansMsgPage(pageVO); | ||
| 37 | + return success(MpMessageConvert.INSTANCE.convertPage(pageResult)); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsg/vo/WxFansMsgBaseVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/MpMessageBaseVO.java
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo; | 1 | +package cn.iocoder.yudao.module.mp.controller.admin.message.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| @@ -8,7 +8,7 @@ import io.swagger.annotations.*; | @@ -8,7 +8,7 @@ import io.swagger.annotations.*; | ||
| 8 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | 8 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 9 | */ | 9 | */ |
| 10 | @Data | 10 | @Data |
| 11 | -public class WxFansMsgBaseVO { | 11 | +public class MpMessageBaseVO { |
| 12 | 12 | ||
| 13 | @ApiModelProperty(value = "用户标识") | 13 | @ApiModelProperty(value = "用户标识") |
| 14 | private String openid; | 14 | private String openid; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/MpMessagePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.controller.admin.message.vo; | ||
| 2 | + | ||
| 3 | +import lombok.*; | ||
| 4 | + | ||
| 5 | +import io.swagger.annotations.*; | ||
| 6 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 7 | + | ||
| 8 | +@ApiModel("管理后台 - 粉丝消息表分页 Request VO") | ||
| 9 | +@Data | ||
| 10 | +@EqualsAndHashCode(callSuper = true) | ||
| 11 | +@ToString(callSuper = true) | ||
| 12 | +public class MpMessagePageReqVO extends PageParam { | ||
| 13 | + | ||
| 14 | + @ApiModelProperty(value = "用户标识") | ||
| 15 | + private String openId; | ||
| 16 | + | ||
| 17 | + @ApiModelProperty(value = "昵称") | ||
| 18 | + private String nickname; | ||
| 19 | + | ||
| 20 | + @ApiModelProperty(value = "微信账号ID") | ||
| 21 | + private Long accountId; | ||
| 22 | + | ||
| 23 | + @ApiModelProperty(value = "消息类型") | ||
| 24 | + private String type; | ||
| 25 | + | ||
| 26 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fansmsg/vo/WxFansMsgRespVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/MpMessageRespVO.java
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo; | 1 | +package cn.iocoder.yudao.module.mp.controller.admin.message.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | 4 | ||
| @@ -10,7 +10,7 @@ import io.swagger.annotations.*; | @@ -10,7 +10,7 @@ import io.swagger.annotations.*; | ||
| 10 | @Data | 10 | @Data |
| 11 | @EqualsAndHashCode(callSuper = true) | 11 | @EqualsAndHashCode(callSuper = true) |
| 12 | @ToString(callSuper = true) | 12 | @ToString(callSuper = true) |
| 13 | -public class WxFansMsgRespVO extends WxFansMsgBaseVO { | 13 | +public class MpMessageRespVO extends MpMessageBaseVO { |
| 14 | 14 | ||
| 15 | @ApiModelProperty(value = "主键", required = true) | 15 | @ApiModelProperty(value = "主键", required = true) |
| 16 | private Integer id; | 16 | private Integer id; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/fansmsg/WxFansMsgConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.convert.fansmsg; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | - | ||
| 7 | -import org.mapstruct.Mapper; | ||
| 8 | -import org.mapstruct.factory.Mappers; | ||
| 9 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.*; | ||
| 10 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsg.WxFansMsgDO; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 粉丝消息表 Convert | ||
| 14 | - * | ||
| 15 | - * @author 芋道源码 | ||
| 16 | - */ | ||
| 17 | -@Mapper | ||
| 18 | -public interface WxFansMsgConvert { | ||
| 19 | - | ||
| 20 | - WxFansMsgConvert INSTANCE = Mappers.getMapper(WxFansMsgConvert.class); | ||
| 21 | - | ||
| 22 | - WxFansMsgDO convert(WxFansMsgCreateReqVO bean); | ||
| 23 | - | ||
| 24 | - WxFansMsgDO convert(WxFansMsgUpdateReqVO bean); | ||
| 25 | - | ||
| 26 | - WxFansMsgRespVO convert(WxFansMsgDO bean); | ||
| 27 | - | ||
| 28 | - List<WxFansMsgRespVO> convertList(List<WxFansMsgDO> list); | ||
| 29 | - | ||
| 30 | - PageResult<WxFansMsgRespVO> convertPage(PageResult<WxFansMsgDO> page); | ||
| 31 | - | ||
| 32 | - List<WxFansMsgExcelVO> convertList02(List<WxFansMsgDO> list); | ||
| 33 | - | ||
| 34 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/fansmsgres/WxFansMsgResConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.convert.fansmsgres; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | - | ||
| 7 | -import org.mapstruct.Mapper; | ||
| 8 | -import org.mapstruct.factory.Mappers; | ||
| 9 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo.*; | ||
| 10 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsgres.WxFansMsgResDO; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 回复粉丝消息历史表 Convert | ||
| 14 | - * | ||
| 15 | - * @author 芋道源码 | ||
| 16 | - */ | ||
| 17 | -@Mapper | ||
| 18 | -public interface WxFansMsgResConvert { | ||
| 19 | - | ||
| 20 | - WxFansMsgResConvert INSTANCE = Mappers.getMapper(WxFansMsgResConvert.class); | ||
| 21 | - | ||
| 22 | - WxFansMsgResDO convert(WxFansMsgResCreateReqVO bean); | ||
| 23 | - | ||
| 24 | - WxFansMsgResDO convert(WxFansMsgResUpdateReqVO bean); | ||
| 25 | - | ||
| 26 | - WxFansMsgResRespVO convert(WxFansMsgResDO bean); | ||
| 27 | - | ||
| 28 | - List<WxFansMsgResRespVO> convertList(List<WxFansMsgResDO> list); | ||
| 29 | - | ||
| 30 | - PageResult<WxFansMsgResRespVO> convertPage(PageResult<WxFansMsgResDO> page); | ||
| 31 | - | ||
| 32 | - List<WxFansMsgResExcelVO> convertList02(List<WxFansMsgResDO> list); | ||
| 33 | - | ||
| 34 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/message/MpMessageConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.convert.message; | ||
| 2 | + | ||
| 3 | +import java.util.*; | ||
| 4 | + | ||
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | + | ||
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | ||
| 8 | +import org.mapstruct.Mapper; | ||
| 9 | +import org.mapstruct.factory.Mappers; | ||
| 10 | +import cn.iocoder.yudao.module.mp.controller.admin.message.vo.*; | ||
| 11 | + | ||
| 12 | +@Mapper | ||
| 13 | +public interface MpMessageConvert { | ||
| 14 | + | ||
| 15 | + MpMessageConvert INSTANCE = Mappers.getMapper(MpMessageConvert.class); | ||
| 16 | + | ||
| 17 | + MpMessageRespVO convert(MpMessageDO bean); | ||
| 18 | + | ||
| 19 | + List<MpMessageRespVO> convertList(List<MpMessageDO> list); | ||
| 20 | + | ||
| 21 | + PageResult<MpMessageRespVO> convertPage(PageResult<MpMessageDO> page); | ||
| 22 | + | ||
| 23 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/fansmsg/WxFansMsgDO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.dal.dataobject.fansmsg; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import com.baomidou.mybatisplus.annotation.*; | ||
| 8 | -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 9 | - | ||
| 10 | -/** | ||
| 11 | - * 粉丝消息表 DO | ||
| 12 | - * | ||
| 13 | - * @author 芋道源码 | ||
| 14 | - */ | ||
| 15 | -@TableName("wx_fans_msg") | ||
| 16 | -@KeySequence("wx_fans_msg_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||
| 17 | -@Data | ||
| 18 | -@EqualsAndHashCode(callSuper = true) | ||
| 19 | -@ToString(callSuper = true) | ||
| 20 | -@Builder | ||
| 21 | -@NoArgsConstructor | ||
| 22 | -@AllArgsConstructor | ||
| 23 | -public class WxFansMsgDO extends BaseDO { | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 主键 | ||
| 27 | - */ | ||
| 28 | - @TableId | ||
| 29 | - private Integer id; | ||
| 30 | - /** | ||
| 31 | - * 用户标识 | ||
| 32 | - */ | ||
| 33 | - private String openid; | ||
| 34 | - /** | ||
| 35 | - * 昵称 | ||
| 36 | - */ | ||
| 37 | - private byte[] nickname; | ||
| 38 | - /** | ||
| 39 | - * 头像地址 | ||
| 40 | - */ | ||
| 41 | - private String headimgUrl; | ||
| 42 | - /** | ||
| 43 | - * 微信账号ID | ||
| 44 | - */ | ||
| 45 | - private String wxAccountId; | ||
| 46 | - /** | ||
| 47 | - * 消息类型 | ||
| 48 | - */ | ||
| 49 | - private String msgType; | ||
| 50 | - /** | ||
| 51 | - * 内容 | ||
| 52 | - */ | ||
| 53 | - private String content; | ||
| 54 | - /** | ||
| 55 | - * 最近一条回复内容 | ||
| 56 | - */ | ||
| 57 | - private String resContent; | ||
| 58 | - /** | ||
| 59 | - * 是否已回复 | ||
| 60 | - */ | ||
| 61 | - private String isRes; | ||
| 62 | - /** | ||
| 63 | - * 微信素材ID | ||
| 64 | - */ | ||
| 65 | - private String mediaId; | ||
| 66 | - /** | ||
| 67 | - * 微信图片URL | ||
| 68 | - */ | ||
| 69 | - private String picUrl; | ||
| 70 | - /** | ||
| 71 | - * 本地图片路径 | ||
| 72 | - */ | ||
| 73 | - private String picPath; | ||
| 74 | - | ||
| 75 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/fansmsgres/WxFansMsgResDO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.dal.dataobject.fansmsgres; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import com.baomidou.mybatisplus.annotation.*; | ||
| 8 | -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 9 | - | ||
| 10 | -/** | ||
| 11 | - * 回复粉丝消息历史表 DO | ||
| 12 | - * | ||
| 13 | - * @author 芋道源码 | ||
| 14 | - */ | ||
| 15 | -@TableName("wx_fans_msg_res") | ||
| 16 | -@KeySequence("wx_fans_msg_res_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||
| 17 | -@Data | ||
| 18 | -@EqualsAndHashCode(callSuper = true) | ||
| 19 | -@ToString(callSuper = true) | ||
| 20 | -@Builder | ||
| 21 | -@NoArgsConstructor | ||
| 22 | -@AllArgsConstructor | ||
| 23 | -public class WxFansMsgResDO extends BaseDO { | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 主键 | ||
| 27 | - */ | ||
| 28 | - @TableId | ||
| 29 | - private Integer id; | ||
| 30 | - /** | ||
| 31 | - * 粉丝消息ID | ||
| 32 | - */ | ||
| 33 | - private String fansMsgId; | ||
| 34 | - /** | ||
| 35 | - * 回复内容 | ||
| 36 | - */ | ||
| 37 | - private String resContent; | ||
| 38 | - | ||
| 39 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/message/MpMessageDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.dal.dataobject.message; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | ||
| 4 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | ||
| 5 | +import cn.iocoder.yudao.module.mp.dal.dataobject.user.MpUserDO; | ||
| 6 | +import cn.iocoder.yudao.module.mp.enums.message.MpMessageSendFrom; | ||
| 7 | +import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler; | ||
| 8 | +import lombok.*; | ||
| 9 | + | ||
| 10 | +import com.baomidou.mybatisplus.annotation.*; | ||
| 11 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 12 | +import me.chanjar.weixin.common.api.WxConsts; | ||
| 13 | + | ||
| 14 | +import java.io.Serializable; | ||
| 15 | +import java.time.LocalDateTime; | ||
| 16 | +import java.util.List; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * 微信消息 DO | ||
| 20 | + * | ||
| 21 | + * @author 芋道源码 | ||
| 22 | + */ | ||
| 23 | +@TableName(value = "mp_message", autoResultMap = true) | ||
| 24 | +@KeySequence("mp_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||
| 25 | +@Data | ||
| 26 | +@EqualsAndHashCode(callSuper = true) | ||
| 27 | +@ToString(callSuper = true) | ||
| 28 | +@Builder | ||
| 29 | +@NoArgsConstructor | ||
| 30 | +@AllArgsConstructor | ||
| 31 | +public class MpMessageDO extends BaseDO { | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 主键 | ||
| 35 | + */ | ||
| 36 | + @TableId | ||
| 37 | + private Long id; | ||
| 38 | + /** | ||
| 39 | + * 微信公众号 ID | ||
| 40 | + * | ||
| 41 | + * 关联 {@link MpAccountDO#getId()} | ||
| 42 | + */ | ||
| 43 | + private Long accountId; | ||
| 44 | + /** | ||
| 45 | + * 微信公众号 appid | ||
| 46 | + * | ||
| 47 | + * 冗余 {@link MpAccountDO#getAppId()} | ||
| 48 | + */ | ||
| 49 | + private String appId; | ||
| 50 | + /** | ||
| 51 | + * 微信用户编号 | ||
| 52 | + * | ||
| 53 | + * 关联 {@link MpUserDO#getId()} | ||
| 54 | + */ | ||
| 55 | + private Long userId; | ||
| 56 | + /** | ||
| 57 | + * 用户标识 | ||
| 58 | + * | ||
| 59 | + * 冗余 {@link MpUserDO#getId()} | ||
| 60 | + */ | ||
| 61 | + private String openId; | ||
| 62 | +// /** | ||
| 63 | +// * 昵称 | ||
| 64 | +// */ | ||
| 65 | +// private String nickname; | ||
| 66 | +// /** | ||
| 67 | +// * 头像 | ||
| 68 | +// */ | ||
| 69 | +// private String headImageUrl; | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 消息类型 | ||
| 73 | + * | ||
| 74 | + * 枚举 {@link WxConsts.XmlMsgType} | ||
| 75 | + */ | ||
| 76 | + private String type; | ||
| 77 | + /** | ||
| 78 | + * 消息来源 | ||
| 79 | + * | ||
| 80 | + * 枚举 {@link MpMessageSendFrom} | ||
| 81 | + */ | ||
| 82 | + private Integer sendFrom; | ||
| 83 | + | ||
| 84 | + // ========= 消息内容 ========== | ||
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * 消息内容 | ||
| 88 | + * | ||
| 89 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 TEXT | ||
| 90 | + */ | ||
| 91 | + private String content; | ||
| 92 | + | ||
| 93 | + /** | ||
| 94 | + * 通过素材管理中的接口上传多媒体文件,得到的 id | ||
| 95 | + * | ||
| 96 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 IMAGE、VOICE、VIDEO | ||
| 97 | + */ | ||
| 98 | + private String mediaId; | ||
| 99 | + /** | ||
| 100 | + * 标题 | ||
| 101 | + * | ||
| 102 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO、MUSIC | ||
| 103 | + */ | ||
| 104 | + private String title; | ||
| 105 | + /** | ||
| 106 | + * 描述 | ||
| 107 | + * | ||
| 108 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 VIDEO、MUSIC | ||
| 109 | + */ | ||
| 110 | + private String description; | ||
| 111 | + | ||
| 112 | + /** | ||
| 113 | + * 音乐链接 | ||
| 114 | + * | ||
| 115 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC | ||
| 116 | + */ | ||
| 117 | + private String musicURL; | ||
| 118 | + /** | ||
| 119 | + * 高质量音乐链接,WIFI 环境优先使用该链接播放音乐 | ||
| 120 | + * | ||
| 121 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC | ||
| 122 | + */ | ||
| 123 | + private String hqMusicUrl; | ||
| 124 | + /** | ||
| 125 | + * 缩略图的媒体 id,通过素材管理中的接口上传多媒体文件,得到的 id | ||
| 126 | + * | ||
| 127 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 MUSIC | ||
| 128 | + */ | ||
| 129 | + private String thumbMediaId; | ||
| 130 | + | ||
| 131 | + /** | ||
| 132 | + * 图文消息个数,限制为 10 条以内 | ||
| 133 | + * | ||
| 134 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 NEWS | ||
| 135 | + */ | ||
| 136 | + private Integer articleCount; | ||
| 137 | + /** | ||
| 138 | + * 图文消息数组 | ||
| 139 | + * | ||
| 140 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 NEWS | ||
| 141 | + */ | ||
| 142 | + @TableField(typeHandler = ArticleTypeHandler.class) | ||
| 143 | + private List<Article> articles; | ||
| 144 | + | ||
| 145 | + /** | ||
| 146 | + * 地理位置维度 | ||
| 147 | + * | ||
| 148 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 LOCATION | ||
| 149 | + */ | ||
| 150 | + private Double locationX; | ||
| 151 | + /** | ||
| 152 | + * 地理位置经度 | ||
| 153 | + * | ||
| 154 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 LOCATION | ||
| 155 | + */ | ||
| 156 | + private Double locationY; | ||
| 157 | + /** | ||
| 158 | + * 地图缩放大小 | ||
| 159 | + * | ||
| 160 | + * 消息类型为 {@link WxConsts.XmlMsgType} 的 LOCATION | ||
| 161 | + */ | ||
| 162 | + private Double scale; | ||
| 163 | + | ||
| 164 | + /** | ||
| 165 | + * 文章 | ||
| 166 | + */ | ||
| 167 | + @Data | ||
| 168 | + public static class Article implements Serializable { | ||
| 169 | + | ||
| 170 | + /** | ||
| 171 | + * 图文消息标题 | ||
| 172 | + */ | ||
| 173 | + private String title; | ||
| 174 | + /** | ||
| 175 | + * 图文消息描述 | ||
| 176 | + */ | ||
| 177 | + private String description; | ||
| 178 | + /** | ||
| 179 | + * 图片链接 | ||
| 180 | + * | ||
| 181 | + * 支持JPG、PNG格式,较好的效果为大图 360*200,小图 200*200 | ||
| 182 | + */ | ||
| 183 | + private String picUrl; | ||
| 184 | + /** | ||
| 185 | + * 点击图文消息跳转链接 | ||
| 186 | + */ | ||
| 187 | + private String url; | ||
| 188 | + | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + // TODO @芋艿:可以找一些新的思路 | ||
| 192 | + public static class ArticleTypeHandler extends AbstractJsonTypeHandler<List<Article>> { | ||
| 193 | + | ||
| 194 | + @Override | ||
| 195 | + protected List<Article> parse(String json) { | ||
| 196 | + return JsonUtils.parseArray(json, Article.class); | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + @Override | ||
| 200 | + protected String toJson(List<Article> obj) { | ||
| 201 | + return JsonUtils.toJsonString(obj); | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/user/MpUserDO.java
| @@ -92,7 +92,7 @@ public class MpUserDO extends BaseDO { | @@ -92,7 +92,7 @@ public class MpUserDO extends BaseDO { | ||
| 92 | /** | 92 | /** |
| 93 | * 微信公众号 appid | 93 | * 微信公众号 appid |
| 94 | * | 94 | * |
| 95 | - * 冗余{@link MpAccountDO#getAppId()} | 95 | + * 冗余 {@link MpAccountDO#getAppId()} |
| 96 | */ | 96 | */ |
| 97 | private String appId; | 97 | private String appId; |
| 98 | 98 |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/fansmsg/MpMessageMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.dal.mysql.fansmsg; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.message.vo.MpMessagePageReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | ||
| 8 | +import org.apache.ibatis.annotations.Mapper; | ||
| 9 | + | ||
| 10 | +@Mapper | ||
| 11 | +public interface MpMessageMapper extends BaseMapperX<MpMessageDO> { | ||
| 12 | + | ||
| 13 | + default PageResult<MpMessageDO> selectPage(MpMessagePageReqVO reqVO) { | ||
| 14 | + return selectPage(reqVO, new LambdaQueryWrapperX<MpMessageDO>() | ||
| 15 | + .eqIfPresent(MpMessageDO::getAccountId, reqVO.getAccountId()) | ||
| 16 | + .eqIfPresent(MpMessageDO::getOpenId, reqVO.getOpenId()) | ||
| 17 | +// .likeIfPresent(MpMessageDO::getNickname, reqVO.getNickname()) | ||
| 18 | + .eqIfPresent(MpMessageDO::getType, reqVO.getType()) | ||
| 19 | + .orderByDesc(MpMessageDO::getId)); | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/fansmsg/WxFansMsgMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.dal.mysql.fansmsg; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 8 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsg.WxFansMsgDO; | ||
| 9 | -import org.apache.ibatis.annotations.Mapper; | ||
| 10 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.*; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 粉丝消息表 Mapper | ||
| 14 | - * | ||
| 15 | - * @author 芋道源码 | ||
| 16 | - */ | ||
| 17 | -@Mapper | ||
| 18 | -public interface WxFansMsgMapper extends BaseMapperX<WxFansMsgDO> { | ||
| 19 | - | ||
| 20 | - default PageResult<WxFansMsgDO> selectPage(WxFansMsgPageReqVO reqVO) { | ||
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<WxFansMsgDO>() | ||
| 22 | - .eqIfPresent(WxFansMsgDO::getOpenid, reqVO.getOpenid()) | ||
| 23 | - .likeIfPresent(WxFansMsgDO::getNickname, reqVO.getNickname()) | ||
| 24 | - .eqIfPresent(WxFansMsgDO::getHeadimgUrl, reqVO.getHeadimgUrl()) | ||
| 25 | - .eqIfPresent(WxFansMsgDO::getWxAccountId, reqVO.getWxAccountId()) | ||
| 26 | - .eqIfPresent(WxFansMsgDO::getMsgType, reqVO.getMsgType()) | ||
| 27 | - .eqIfPresent(WxFansMsgDO::getContent, reqVO.getContent()) | ||
| 28 | - .eqIfPresent(WxFansMsgDO::getResContent, reqVO.getResContent()) | ||
| 29 | - .eqIfPresent(WxFansMsgDO::getIsRes, reqVO.getIsRes()) | ||
| 30 | - .eqIfPresent(WxFansMsgDO::getMediaId, reqVO.getMediaId()) | ||
| 31 | - .eqIfPresent(WxFansMsgDO::getPicUrl, reqVO.getPicUrl()) | ||
| 32 | - .eqIfPresent(WxFansMsgDO::getPicPath, reqVO.getPicPath()) | ||
| 33 | - .betweenIfPresent(WxFansMsgDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 34 | - .orderByDesc(WxFansMsgDO::getId)); | ||
| 35 | - } | ||
| 36 | - | ||
| 37 | - default List<WxFansMsgDO> selectList(WxFansMsgExportReqVO reqVO) { | ||
| 38 | - return selectList(new LambdaQueryWrapperX<WxFansMsgDO>() | ||
| 39 | - .eqIfPresent(WxFansMsgDO::getOpenid, reqVO.getOpenid()) | ||
| 40 | - .likeIfPresent(WxFansMsgDO::getNickname, reqVO.getNickname()) | ||
| 41 | - .eqIfPresent(WxFansMsgDO::getHeadimgUrl, reqVO.getHeadimgUrl()) | ||
| 42 | - .eqIfPresent(WxFansMsgDO::getWxAccountId, reqVO.getWxAccountId()) | ||
| 43 | - .eqIfPresent(WxFansMsgDO::getMsgType, reqVO.getMsgType()) | ||
| 44 | - .eqIfPresent(WxFansMsgDO::getContent, reqVO.getContent()) | ||
| 45 | - .eqIfPresent(WxFansMsgDO::getResContent, reqVO.getResContent()) | ||
| 46 | - .eqIfPresent(WxFansMsgDO::getIsRes, reqVO.getIsRes()) | ||
| 47 | - .eqIfPresent(WxFansMsgDO::getMediaId, reqVO.getMediaId()) | ||
| 48 | - .eqIfPresent(WxFansMsgDO::getPicUrl, reqVO.getPicUrl()) | ||
| 49 | - .eqIfPresent(WxFansMsgDO::getPicPath, reqVO.getPicPath()) | ||
| 50 | - .betweenIfPresent(WxFansMsgDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 51 | - .orderByDesc(WxFansMsgDO::getId)); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/fansmsgres/WxFansMsgResMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.dal.mysql.fansmsgres; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 8 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsgres.WxFansMsgResDO; | ||
| 9 | -import org.apache.ibatis.annotations.Mapper; | ||
| 10 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo.*; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 回复粉丝消息历史表 Mapper | ||
| 14 | - * | ||
| 15 | - * @author 芋道源码 | ||
| 16 | - */ | ||
| 17 | -@Mapper | ||
| 18 | -public interface WxFansMsgResMapper extends BaseMapperX<WxFansMsgResDO> { | ||
| 19 | - | ||
| 20 | - default PageResult<WxFansMsgResDO> selectPage(WxFansMsgResPageReqVO reqVO) { | ||
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<WxFansMsgResDO>() | ||
| 22 | - .eqIfPresent(WxFansMsgResDO::getFansMsgId, reqVO.getFansMsgId()) | ||
| 23 | - .eqIfPresent(WxFansMsgResDO::getResContent, reqVO.getResContent()) | ||
| 24 | - .betweenIfPresent(WxFansMsgResDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 25 | - .orderByDesc(WxFansMsgResDO::getId)); | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - default List<WxFansMsgResDO> selectList(WxFansMsgResExportReqVO reqVO) { | ||
| 29 | - return selectList(new LambdaQueryWrapperX<WxFansMsgResDO>() | ||
| 30 | - .eqIfPresent(WxFansMsgResDO::getFansMsgId, reqVO.getFansMsgId()) | ||
| 31 | - .eqIfPresent(WxFansMsgResDO::getResContent, reqVO.getResContent()) | ||
| 32 | - .betweenIfPresent(WxFansMsgResDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 33 | - .orderByDesc(WxFansMsgResDO::getId)); | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/config/MpConfiguration.java
| @@ -2,8 +2,14 @@ package cn.iocoder.yudao.module.mp.framework.mp.config; | @@ -2,8 +2,14 @@ package cn.iocoder.yudao.module.mp.framework.mp.config; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.mp.framework.mp.core.DefaultMpServiceFactory; | 3 | import cn.iocoder.yudao.module.mp.framework.mp.core.DefaultMpServiceFactory; |
| 4 | import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; | 4 | import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; |
| 5 | -import cn.iocoder.yudao.module.mp.service.fansmsgres.NullHandler; | ||
| 6 | -import cn.iocoder.yudao.module.mp.service.handler.*; | 5 | +import cn.iocoder.yudao.module.mp.service.handler.menu.MenuHandler; |
| 6 | +import cn.iocoder.yudao.module.mp.service.handler.message.MessageLogHandler; | ||
| 7 | +import cn.iocoder.yudao.module.mp.service.handler.message.MessageAutoReplyHandler; | ||
| 8 | +import cn.iocoder.yudao.module.mp.service.handler.other.KfSessionHandler; | ||
| 9 | +import cn.iocoder.yudao.module.mp.service.handler.other.NullHandler; | ||
| 10 | +import cn.iocoder.yudao.module.mp.service.handler.other.ScanHandler; | ||
| 11 | +import cn.iocoder.yudao.module.mp.service.handler.other.StoreCheckNotifyHandler; | ||
| 12 | +import cn.iocoder.yudao.module.mp.service.handler.user.LocationHandler; | ||
| 7 | import cn.iocoder.yudao.module.mp.service.handler.user.SubscribeHandler; | 13 | import cn.iocoder.yudao.module.mp.service.handler.user.SubscribeHandler; |
| 8 | import cn.iocoder.yudao.module.mp.service.handler.user.UnsubscribeHandler; | 14 | import cn.iocoder.yudao.module.mp.service.handler.user.UnsubscribeHandler; |
| 9 | import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties; | 15 | import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties; |
| @@ -30,7 +36,7 @@ public class MpConfiguration { | @@ -30,7 +36,7 @@ public class MpConfiguration { | ||
| 30 | @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") | 36 | @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") |
| 31 | public MpServiceFactory mpServiceFactory(RedisTemplateWxRedisOps redisTemplateWxRedisOps, | 37 | public MpServiceFactory mpServiceFactory(RedisTemplateWxRedisOps redisTemplateWxRedisOps, |
| 32 | WxMpProperties wxMpProperties, | 38 | WxMpProperties wxMpProperties, |
| 33 | - LogHandler logHandler, | 39 | + MessageLogHandler logHandler, |
| 34 | KfSessionHandler kfSessionHandler, | 40 | KfSessionHandler kfSessionHandler, |
| 35 | StoreCheckNotifyHandler storeCheckNotifyHandler, | 41 | StoreCheckNotifyHandler storeCheckNotifyHandler, |
| 36 | MenuHandler menuHandler, | 42 | MenuHandler menuHandler, |
| @@ -39,7 +45,7 @@ public class MpConfiguration { | @@ -39,7 +45,7 @@ public class MpConfiguration { | ||
| 39 | UnsubscribeHandler unsubscribeHandler, | 45 | UnsubscribeHandler unsubscribeHandler, |
| 40 | LocationHandler locationHandler, | 46 | LocationHandler locationHandler, |
| 41 | ScanHandler scanHandler, | 47 | ScanHandler scanHandler, |
| 42 | - DefaultMessageHandler msgHandler) { | 48 | + MessageAutoReplyHandler msgHandler) { |
| 43 | return new DefaultMpServiceFactory(redisTemplateWxRedisOps, wxMpProperties, | 49 | return new DefaultMpServiceFactory(redisTemplateWxRedisOps, wxMpProperties, |
| 44 | logHandler, kfSessionHandler, storeCheckNotifyHandler, menuHandler, | 50 | logHandler, kfSessionHandler, storeCheckNotifyHandler, menuHandler, |
| 45 | nullHandler, subscribeHandler, unsubscribeHandler, locationHandler, scanHandler, msgHandler); | 51 | nullHandler, subscribeHandler, unsubscribeHandler, locationHandler, scanHandler, msgHandler); |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/mp/core/DefaultMpServiceFactory.java
| 1 | package cn.iocoder.yudao.module.mp.framework.mp.core; | 1 | package cn.iocoder.yudao.module.mp.framework.mp.core; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | 3 | import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; |
| 4 | -import cn.iocoder.yudao.module.mp.service.fansmsgres.NullHandler; | ||
| 5 | -import cn.iocoder.yudao.module.mp.service.handler.*; | 4 | +import cn.iocoder.yudao.module.mp.service.handler.menu.MenuHandler; |
| 5 | +import cn.iocoder.yudao.module.mp.service.handler.message.MessageLogHandler; | ||
| 6 | +import cn.iocoder.yudao.module.mp.service.handler.message.MessageAutoReplyHandler; | ||
| 7 | +import cn.iocoder.yudao.module.mp.service.handler.other.KfSessionHandler; | ||
| 8 | +import cn.iocoder.yudao.module.mp.service.handler.other.NullHandler; | ||
| 9 | +import cn.iocoder.yudao.module.mp.service.handler.other.ScanHandler; | ||
| 10 | +import cn.iocoder.yudao.module.mp.service.handler.other.StoreCheckNotifyHandler; | ||
| 11 | +import cn.iocoder.yudao.module.mp.service.handler.user.LocationHandler; | ||
| 6 | import cn.iocoder.yudao.module.mp.service.handler.user.SubscribeHandler; | 12 | import cn.iocoder.yudao.module.mp.service.handler.user.SubscribeHandler; |
| 7 | import cn.iocoder.yudao.module.mp.service.handler.user.UnsubscribeHandler; | 13 | import cn.iocoder.yudao.module.mp.service.handler.user.UnsubscribeHandler; |
| 8 | import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties; | 14 | import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties; |
| @@ -43,7 +49,7 @@ public class DefaultMpServiceFactory implements MpServiceFactory { | @@ -43,7 +49,7 @@ public class DefaultMpServiceFactory implements MpServiceFactory { | ||
| 43 | 49 | ||
| 44 | // ========== 各种 Handler ========== | 50 | // ========== 各种 Handler ========== |
| 45 | 51 | ||
| 46 | - private final LogHandler logHandler; | 52 | + private final MessageLogHandler logHandler; |
| 47 | private final KfSessionHandler kfSessionHandler; | 53 | private final KfSessionHandler kfSessionHandler; |
| 48 | private final StoreCheckNotifyHandler storeCheckNotifyHandler; | 54 | private final StoreCheckNotifyHandler storeCheckNotifyHandler; |
| 49 | private final MenuHandler menuHandler; | 55 | private final MenuHandler menuHandler; |
| @@ -52,7 +58,7 @@ public class DefaultMpServiceFactory implements MpServiceFactory { | @@ -52,7 +58,7 @@ public class DefaultMpServiceFactory implements MpServiceFactory { | ||
| 52 | private final UnsubscribeHandler unsubscribeHandler; | 58 | private final UnsubscribeHandler unsubscribeHandler; |
| 53 | private final LocationHandler locationHandler; | 59 | private final LocationHandler locationHandler; |
| 54 | private final ScanHandler scanHandler; | 60 | private final ScanHandler scanHandler; |
| 55 | - private final DefaultMessageHandler msgHandler; | 61 | + private final MessageAutoReplyHandler msgHandler; |
| 56 | 62 | ||
| 57 | @Override | 63 | @Override |
| 58 | public void init(List<MpAccountDO> list) { | 64 | public void init(List<MpAccountDO> list) { |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/fansmsg/WxFansMsgService.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.service.fansmsg; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | -import javax.validation.*; | ||
| 5 | - | ||
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.*; | ||
| 7 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsg.WxFansMsgDO; | ||
| 8 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 9 | - | ||
| 10 | -/** | ||
| 11 | - * 粉丝消息表 Service 接口 | ||
| 12 | - * | ||
| 13 | - * @author 芋道源码 | ||
| 14 | - */ | ||
| 15 | -public interface WxFansMsgService { | ||
| 16 | - | ||
| 17 | - /** | ||
| 18 | - * 创建粉丝消息表 | ||
| 19 | - * | ||
| 20 | - * @param createReqVO 创建信息 | ||
| 21 | - * @return 编号 | ||
| 22 | - */ | ||
| 23 | - Integer createWxFansMsg(@Valid WxFansMsgCreateReqVO createReqVO); | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 更新粉丝消息表 | ||
| 27 | - * | ||
| 28 | - * @param updateReqVO 更新信息 | ||
| 29 | - */ | ||
| 30 | - void updateWxFansMsg(@Valid WxFansMsgUpdateReqVO updateReqVO); | ||
| 31 | - | ||
| 32 | - /** | ||
| 33 | - * 删除粉丝消息表 | ||
| 34 | - * | ||
| 35 | - * @param id 编号 | ||
| 36 | - */ | ||
| 37 | - void deleteWxFansMsg(Integer id); | ||
| 38 | - | ||
| 39 | - /** | ||
| 40 | - * 获得粉丝消息表 | ||
| 41 | - * | ||
| 42 | - * @param id 编号 | ||
| 43 | - * @return 粉丝消息表 | ||
| 44 | - */ | ||
| 45 | - WxFansMsgDO getWxFansMsg(Integer id); | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 获得粉丝消息表 列表 | ||
| 49 | - * | ||
| 50 | - * @param ids 编号 | ||
| 51 | - * @return 粉丝消息表 列表 | ||
| 52 | - */ | ||
| 53 | - List<WxFansMsgDO> getWxFansMsgList(Collection<Integer> ids); | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * 获得粉丝消息表 分页 | ||
| 57 | - * | ||
| 58 | - * @param pageReqVO 分页查询 | ||
| 59 | - * @return 粉丝消息表 分页 | ||
| 60 | - */ | ||
| 61 | - PageResult<WxFansMsgDO> getWxFansMsgPage(WxFansMsgPageReqVO pageReqVO); | ||
| 62 | - | ||
| 63 | - /** | ||
| 64 | - * 获得粉丝消息表 列表, 用于 Excel 导出 | ||
| 65 | - * | ||
| 66 | - * @param exportReqVO 查询条件 | ||
| 67 | - * @return 粉丝消息表 列表 | ||
| 68 | - */ | ||
| 69 | - List<WxFansMsgDO> getWxFansMsgList(WxFansMsgExportReqVO exportReqVO); | ||
| 70 | - | ||
| 71 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/fansmsg/WxFansMsgServiceImpl.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.service.fansmsg; | ||
| 2 | - | ||
| 3 | -import org.springframework.stereotype.Service; | ||
| 4 | - | ||
| 5 | -import javax.annotation.Resource; | ||
| 6 | - | ||
| 7 | -import org.springframework.validation.annotation.Validated; | ||
| 8 | - | ||
| 9 | -import java.util.*; | ||
| 10 | - | ||
| 11 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.*; | ||
| 12 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsg.WxFansMsgDO; | ||
| 13 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 14 | - | ||
| 15 | -import cn.iocoder.yudao.module.mp.convert.fansmsg.WxFansMsgConvert; | ||
| 16 | -import cn.iocoder.yudao.module.mp.dal.mysql.fansmsg.WxFansMsgMapper; | ||
| 17 | - | ||
| 18 | -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 19 | -import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; | ||
| 20 | - | ||
| 21 | -/** | ||
| 22 | - * 粉丝消息表 Service 实现类 | ||
| 23 | - * | ||
| 24 | - * @author 芋道源码 | ||
| 25 | - */ | ||
| 26 | -@Service | ||
| 27 | -@Validated | ||
| 28 | -public class WxFansMsgServiceImpl implements WxFansMsgService { | ||
| 29 | - | ||
| 30 | - @Resource | ||
| 31 | - private WxFansMsgMapper wxFansMsgMapper; | ||
| 32 | - | ||
| 33 | - @Override | ||
| 34 | - public Integer createWxFansMsg(WxFansMsgCreateReqVO createReqVO) { | ||
| 35 | - // 插入 | ||
| 36 | - WxFansMsgDO wxFansMsg = WxFansMsgConvert.INSTANCE.convert(createReqVO); | ||
| 37 | - wxFansMsgMapper.insert(wxFansMsg); | ||
| 38 | - // 返回 | ||
| 39 | - return wxFansMsg.getId(); | ||
| 40 | - } | ||
| 41 | - | ||
| 42 | - @Override | ||
| 43 | - public void updateWxFansMsg(WxFansMsgUpdateReqVO updateReqVO) { | ||
| 44 | - // 校验存在 | ||
| 45 | - this.validateWxFansMsgExists(updateReqVO.getId()); | ||
| 46 | - // 更新 | ||
| 47 | - WxFansMsgDO updateObj = WxFansMsgConvert.INSTANCE.convert(updateReqVO); | ||
| 48 | - wxFansMsgMapper.updateById(updateObj); | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - @Override | ||
| 52 | - public void deleteWxFansMsg(Integer id) { | ||
| 53 | - // 校验存在 | ||
| 54 | - this.validateWxFansMsgExists(id); | ||
| 55 | - // 删除 | ||
| 56 | - wxFansMsgMapper.deleteById(id); | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - private void validateWxFansMsgExists(Integer id) { | ||
| 60 | - if (wxFansMsgMapper.selectById(id) == null) { | ||
| 61 | - throw exception(COMMON_NOT_EXISTS); | ||
| 62 | - } | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - @Override | ||
| 66 | - public WxFansMsgDO getWxFansMsg(Integer id) { | ||
| 67 | - return wxFansMsgMapper.selectById(id); | ||
| 68 | - } | ||
| 69 | - | ||
| 70 | - @Override | ||
| 71 | - public List<WxFansMsgDO> getWxFansMsgList(Collection<Integer> ids) { | ||
| 72 | - return wxFansMsgMapper.selectBatchIds(ids); | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - @Override | ||
| 76 | - public PageResult<WxFansMsgDO> getWxFansMsgPage(WxFansMsgPageReqVO pageReqVO) { | ||
| 77 | - return wxFansMsgMapper.selectPage(pageReqVO); | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - @Override | ||
| 81 | - public List<WxFansMsgDO> getWxFansMsgList(WxFansMsgExportReqVO exportReqVO) { | ||
| 82 | - return wxFansMsgMapper.selectList(exportReqVO); | ||
| 83 | - } | ||
| 84 | - | ||
| 85 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/fansmsgres/WxFansMsgResService.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.service.fansmsgres; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | -import javax.validation.*; | ||
| 5 | - | ||
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo.*; | ||
| 7 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsgres.WxFansMsgResDO; | ||
| 8 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 9 | - | ||
| 10 | -/** | ||
| 11 | - * 回复粉丝消息历史表 Service 接口 | ||
| 12 | - * | ||
| 13 | - * @author 芋道源码 | ||
| 14 | - */ | ||
| 15 | -public interface WxFansMsgResService { | ||
| 16 | - | ||
| 17 | - /** | ||
| 18 | - * 创建回复粉丝消息历史表 | ||
| 19 | - * | ||
| 20 | - * @param createReqVO 创建信息 | ||
| 21 | - * @return 编号 | ||
| 22 | - */ | ||
| 23 | - Integer createWxFansMsgRes(@Valid WxFansMsgResCreateReqVO createReqVO); | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 更新回复粉丝消息历史表 | ||
| 27 | - * | ||
| 28 | - * @param updateReqVO 更新信息 | ||
| 29 | - */ | ||
| 30 | - void updateWxFansMsgRes(@Valid WxFansMsgResUpdateReqVO updateReqVO); | ||
| 31 | - | ||
| 32 | - /** | ||
| 33 | - * 删除回复粉丝消息历史表 | ||
| 34 | - * | ||
| 35 | - * @param id 编号 | ||
| 36 | - */ | ||
| 37 | - void deleteWxFansMsgRes(Integer id); | ||
| 38 | - | ||
| 39 | - /** | ||
| 40 | - * 获得回复粉丝消息历史表 | ||
| 41 | - * | ||
| 42 | - * @param id 编号 | ||
| 43 | - * @return 回复粉丝消息历史表 | ||
| 44 | - */ | ||
| 45 | - WxFansMsgResDO getWxFansMsgRes(Integer id); | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 获得回复粉丝消息历史表 列表 | ||
| 49 | - * | ||
| 50 | - * @param ids 编号 | ||
| 51 | - * @return 回复粉丝消息历史表 列表 | ||
| 52 | - */ | ||
| 53 | - List<WxFansMsgResDO> getWxFansMsgResList(Collection<Integer> ids); | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * 获得回复粉丝消息历史表 分页 | ||
| 57 | - * | ||
| 58 | - * @param pageReqVO 分页查询 | ||
| 59 | - * @return 回复粉丝消息历史表 分页 | ||
| 60 | - */ | ||
| 61 | - PageResult<WxFansMsgResDO> getWxFansMsgResPage(WxFansMsgResPageReqVO pageReqVO); | ||
| 62 | - | ||
| 63 | - /** | ||
| 64 | - * 获得回复粉丝消息历史表 列表, 用于 Excel 导出 | ||
| 65 | - * | ||
| 66 | - * @param exportReqVO 查询条件 | ||
| 67 | - * @return 回复粉丝消息历史表 列表 | ||
| 68 | - */ | ||
| 69 | - List<WxFansMsgResDO> getWxFansMsgResList(WxFansMsgResExportReqVO exportReqVO); | ||
| 70 | - | ||
| 71 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/fansmsgres/WxFansMsgResServiceImpl.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.service.fansmsgres; | ||
| 2 | - | ||
| 3 | -import org.springframework.stereotype.Service; | ||
| 4 | - | ||
| 5 | -import javax.annotation.Resource; | ||
| 6 | - | ||
| 7 | -import org.springframework.validation.annotation.Validated; | ||
| 8 | - | ||
| 9 | -import java.util.*; | ||
| 10 | - | ||
| 11 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo.*; | ||
| 12 | -import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsgres.WxFansMsgResDO; | ||
| 13 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 14 | - | ||
| 15 | -import cn.iocoder.yudao.module.mp.convert.fansmsgres.WxFansMsgResConvert; | ||
| 16 | -import cn.iocoder.yudao.module.mp.dal.mysql.fansmsgres.WxFansMsgResMapper; | ||
| 17 | - | ||
| 18 | -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 19 | -import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; | ||
| 20 | - | ||
| 21 | -/** | ||
| 22 | - * 回复粉丝消息历史表 Service 实现类 | ||
| 23 | - * | ||
| 24 | - * @author 芋道源码 | ||
| 25 | - */ | ||
| 26 | -@Service | ||
| 27 | -@Validated | ||
| 28 | -public class WxFansMsgResServiceImpl implements WxFansMsgResService { | ||
| 29 | - | ||
| 30 | - @Resource | ||
| 31 | - private WxFansMsgResMapper wxFansMsgResMapper; | ||
| 32 | - | ||
| 33 | - @Override | ||
| 34 | - public Integer createWxFansMsgRes(WxFansMsgResCreateReqVO createReqVO) { | ||
| 35 | - // 插入 | ||
| 36 | - WxFansMsgResDO wxFansMsgRes = WxFansMsgResConvert.INSTANCE.convert(createReqVO); | ||
| 37 | - wxFansMsgResMapper.insert(wxFansMsgRes); | ||
| 38 | - // 返回 | ||
| 39 | - return wxFansMsgRes.getId(); | ||
| 40 | - } | ||
| 41 | - | ||
| 42 | - @Override | ||
| 43 | - public void updateWxFansMsgRes(WxFansMsgResUpdateReqVO updateReqVO) { | ||
| 44 | - // 校验存在 | ||
| 45 | - this.validateWxFansMsgResExists(updateReqVO.getId()); | ||
| 46 | - // 更新 | ||
| 47 | - WxFansMsgResDO updateObj = WxFansMsgResConvert.INSTANCE.convert(updateReqVO); | ||
| 48 | - wxFansMsgResMapper.updateById(updateObj); | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - @Override | ||
| 52 | - public void deleteWxFansMsgRes(Integer id) { | ||
| 53 | - // 校验存在 | ||
| 54 | - this.validateWxFansMsgResExists(id); | ||
| 55 | - // 删除 | ||
| 56 | - wxFansMsgResMapper.deleteById(id); | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - private void validateWxFansMsgResExists(Integer id) { | ||
| 60 | - if (wxFansMsgResMapper.selectById(id) == null) { | ||
| 61 | - throw exception(COMMON_NOT_EXISTS); | ||
| 62 | - } | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - @Override | ||
| 66 | - public WxFansMsgResDO getWxFansMsgRes(Integer id) { | ||
| 67 | - return wxFansMsgResMapper.selectById(id); | ||
| 68 | - } | ||
| 69 | - | ||
| 70 | - @Override | ||
| 71 | - public List<WxFansMsgResDO> getWxFansMsgResList(Collection<Integer> ids) { | ||
| 72 | - return wxFansMsgResMapper.selectBatchIds(ids); | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - @Override | ||
| 76 | - public PageResult<WxFansMsgResDO> getWxFansMsgResPage(WxFansMsgResPageReqVO pageReqVO) { | ||
| 77 | - return wxFansMsgResMapper.selectPage(pageReqVO); | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - @Override | ||
| 81 | - public List<WxFansMsgResDO> getWxFansMsgResList(WxFansMsgResExportReqVO exportReqVO) { | ||
| 82 | - return wxFansMsgResMapper.selectList(exportReqVO); | ||
| 83 | - } | ||
| 84 | - | ||
| 85 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/MenuHandler.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/menu/MenuHandler.java
| 1 | -package cn.iocoder.yudao.module.mp.service.handler; | 1 | +package cn.iocoder.yudao.module.mp.service.handler.menu; |
| 2 | 2 | ||
| 3 | import me.chanjar.weixin.common.session.WxSessionManager; | 3 | import me.chanjar.weixin.common.session.WxSessionManager; |
| 4 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; | 4 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/DefaultMessageHandler.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/message/MessageAutoReplyHandler.java
| 1 | -package cn.iocoder.yudao.module.mp.service.handler; | 1 | +package cn.iocoder.yudao.module.mp.service.handler.message; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.io.FileUtil; | 3 | import cn.hutool.core.io.FileUtil; |
| 4 | import cn.hutool.http.HtmlUtil; | 4 | import cn.hutool.http.HtmlUtil; |
| @@ -6,10 +6,9 @@ import cn.hutool.http.HttpUtil; | @@ -6,10 +6,9 @@ import cn.hutool.http.HttpUtil; | ||
| 6 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 6 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 7 | import cn.iocoder.yudao.module.infra.api.file.FileApi; | 7 | import cn.iocoder.yudao.module.infra.api.file.FileApi; |
| 8 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; | 8 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; |
| 9 | -import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.WxFansMsgCreateReqVO; | ||
| 10 | import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; |
| 11 | import cn.iocoder.yudao.module.mp.service.account.MpAccountService; | 10 | import cn.iocoder.yudao.module.mp.service.account.MpAccountService; |
| 12 | -import cn.iocoder.yudao.module.mp.service.fansmsg.WxFansMsgService; | 11 | +import cn.iocoder.yudao.module.mp.service.message.MpMessageService; |
| 13 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 14 | import me.chanjar.weixin.common.api.WxConsts; | 13 | import me.chanjar.weixin.common.api.WxConsts; |
| 15 | import me.chanjar.weixin.common.error.WxErrorException; | 14 | import me.chanjar.weixin.common.error.WxErrorException; |
| @@ -20,7 +19,6 @@ import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; | @@ -20,7 +19,6 @@ import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; | ||
| 20 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; | 19 | import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; |
| 21 | import me.chanjar.weixin.mp.bean.result.WxMpUser; | 20 | import me.chanjar.weixin.mp.bean.result.WxMpUser; |
| 22 | import org.apache.commons.lang3.StringUtils; | 21 | import org.apache.commons.lang3.StringUtils; |
| 23 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 24 | import org.springframework.context.annotation.Lazy; | 22 | import org.springframework.context.annotation.Lazy; |
| 25 | import org.springframework.stereotype.Component; | 23 | import org.springframework.stereotype.Component; |
| 26 | 24 | ||
| @@ -30,20 +28,20 @@ import java.io.UnsupportedEncodingException; | @@ -30,20 +28,20 @@ import java.io.UnsupportedEncodingException; | ||
| 30 | import java.util.Map; | 28 | import java.util.Map; |
| 31 | 29 | ||
| 32 | /** | 30 | /** |
| 33 | - * 默认所有消息的事件处理器 | 31 | + * 自动回复消息的事件处理器 |
| 34 | * | 32 | * |
| 35 | - * // TODO 芋艿:待实现 | 33 | + * @author 芋道源码 |
| 36 | */ | 34 | */ |
| 37 | @Component | 35 | @Component |
| 38 | @Slf4j | 36 | @Slf4j |
| 39 | -public class DefaultMessageHandler implements WxMpMessageHandler { | 37 | +public class MessageAutoReplyHandler implements WxMpMessageHandler { |
| 40 | 38 | ||
| 41 | @Resource | 39 | @Resource |
| 42 | @Lazy // 延迟加载,解决循环依赖的问题 | 40 | @Lazy // 延迟加载,解决循环依赖的问题 |
| 43 | private MpAccountService mpAccountService; | 41 | private MpAccountService mpAccountService; |
| 44 | 42 | ||
| 45 | - @Autowired | ||
| 46 | - private WxFansMsgService wxFansMsgService; | 43 | + @Resource |
| 44 | + private MpMessageService mpMessageService; | ||
| 47 | 45 | ||
| 48 | @Resource | 46 | @Resource |
| 49 | private FileApi fileApi; | 47 | private FileApi fileApi; |
| @@ -84,7 +82,7 @@ public class DefaultMessageHandler implements WxMpMessageHandler { | @@ -84,7 +82,7 @@ public class DefaultMessageHandler implements WxMpMessageHandler { | ||
| 84 | content = HtmlUtil.escape(content); | 82 | content = HtmlUtil.escape(content); |
| 85 | wxFansMsg.setResContent(content); | 83 | wxFansMsg.setResContent(content); |
| 86 | 84 | ||
| 87 | - wxFansMsgService.createWxFansMsg(wxFansMsg); | 85 | + mpMessageService.createWxFansMsg(wxFansMsg); |
| 88 | return new TextBuilder().build(content, wxMessage, weixinService); | 86 | return new TextBuilder().build(content, wxMessage, weixinService); |
| 89 | 87 | ||
| 90 | } | 88 | } |
| @@ -112,7 +110,7 @@ public class DefaultMessageHandler implements WxMpMessageHandler { | @@ -112,7 +110,7 @@ public class DefaultMessageHandler implements WxMpMessageHandler { | ||
| 112 | log.info("download pic size : {}", size); | 110 | log.info("download pic size : {}", size); |
| 113 | wxFansMsg.setPicPath(filepath); | 111 | wxFansMsg.setPicPath(filepath); |
| 114 | wxFansMsg.setIsRes("0"); | 112 | wxFansMsg.setIsRes("0"); |
| 115 | - wxFansMsgService.createWxFansMsg(wxFansMsg); | 113 | + mpMessageService.createWxFansMsg(wxFansMsg); |
| 116 | } | 114 | } |
| 117 | 115 | ||
| 118 | } | 116 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/LogHandler.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/message/MessageLogHandler.java
| 1 | -package cn.iocoder.yudao.module.mp.service.handler; | 1 | +package cn.iocoder.yudao.module.mp.service.handler.message; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 3 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 4 | import lombok.extern.slf4j.Slf4j; | 4 | import lombok.extern.slf4j.Slf4j; |
| @@ -18,7 +18,7 @@ import java.util.Map; | @@ -18,7 +18,7 @@ import java.util.Map; | ||
| 18 | */ | 18 | */ |
| 19 | @Component | 19 | @Component |
| 20 | @Slf4j | 20 | @Slf4j |
| 21 | -public class LogHandler implements WxMpMessageHandler { | 21 | +public class MessageLogHandler implements WxMpMessageHandler { |
| 22 | 22 | ||
| 23 | @Override | 23 | @Override |
| 24 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, | 24 | public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/KfSessionHandler.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/other/KfSessionHandler.java
| 1 | -package cn.iocoder.yudao.module.mp.service.handler; | 1 | +package cn.iocoder.yudao.module.mp.service.handler.other; |
| 2 | 2 | ||
| 3 | import me.chanjar.weixin.common.session.WxSessionManager; | 3 | import me.chanjar.weixin.common.session.WxSessionManager; |
| 4 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; | 4 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/fansmsgres/NullHandler.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/other/NullHandler.java
| 1 | -package cn.iocoder.yudao.module.mp.service.fansmsgres; | 1 | +package cn.iocoder.yudao.module.mp.service.handler.other; |
| 2 | 2 | ||
| 3 | import me.chanjar.weixin.common.session.WxSessionManager; | 3 | import me.chanjar.weixin.common.session.WxSessionManager; |
| 4 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; | 4 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/ScanHandler.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/other/ScanHandler.java
| 1 | -package cn.iocoder.yudao.module.mp.service.handler; | 1 | +package cn.iocoder.yudao.module.mp.service.handler.other; |
| 2 | 2 | ||
| 3 | import me.chanjar.weixin.common.error.WxErrorException; | 3 | import me.chanjar.weixin.common.error.WxErrorException; |
| 4 | import me.chanjar.weixin.common.session.WxSessionManager; | 4 | import me.chanjar.weixin.common.session.WxSessionManager; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/StoreCheckNotifyHandler.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/other/StoreCheckNotifyHandler.java
| 1 | -package cn.iocoder.yudao.module.mp.service.handler; | 1 | +package cn.iocoder.yudao.module.mp.service.handler.other; |
| 2 | 2 | ||
| 3 | import me.chanjar.weixin.common.session.WxSessionManager; | 3 | import me.chanjar.weixin.common.session.WxSessionManager; |
| 4 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; | 4 | import me.chanjar.weixin.mp.api.WxMpMessageHandler; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/other/package-info.java
0 → 100644
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/LocationHandler.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/handler/user/LocationHandler.java
| 1 | -package cn.iocoder.yudao.module.mp.service.handler; | 1 | +package cn.iocoder.yudao.module.mp.service.handler.user; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; | 3 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; |
| 4 | import lombok.extern.slf4j.Slf4j; | 4 | import lombok.extern.slf4j.Slf4j; |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpMessageService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.service.message; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.module.mp.controller.admin.message.vo.MpMessagePageReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 粉丝消息表 Service 接口 | ||
| 9 | + * | ||
| 10 | + * @author 芋道源码 | ||
| 11 | + */ | ||
| 12 | +public interface MpMessageService { | ||
| 13 | + | ||
| 14 | + /** | ||
| 15 | + * 获得粉丝消息表 分页 | ||
| 16 | + * | ||
| 17 | + * @param pageReqVO 分页查询 | ||
| 18 | + * @return 粉丝消息表 分页 | ||
| 19 | + */ | ||
| 20 | + PageResult<MpMessageDO> getWxFansMsgPage(MpMessagePageReqVO pageReqVO); | ||
| 21 | + | ||
| 22 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/message/MpMessageServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.service.message; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; | ||
| 4 | +import org.springframework.stereotype.Service; | ||
| 5 | + | ||
| 6 | +import javax.annotation.Resource; | ||
| 7 | + | ||
| 8 | +import org.springframework.validation.annotation.Validated; | ||
| 9 | + | ||
| 10 | +import cn.iocoder.yudao.module.mp.controller.admin.message.vo.*; | ||
| 11 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 12 | + | ||
| 13 | +import cn.iocoder.yudao.module.mp.dal.mysql.fansmsg.MpMessageMapper; | ||
| 14 | + | ||
| 15 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 粉丝消息表 Service 实现类 | ||
| 19 | + * | ||
| 20 | + * @author 芋道源码 | ||
| 21 | + */ | ||
| 22 | +@Service | ||
| 23 | +@Validated | ||
| 24 | +public class MpMessageServiceImpl implements MpMessageService { | ||
| 25 | + | ||
| 26 | + @Resource | ||
| 27 | + private MpMessageMapper mpMessageMapper; | ||
| 28 | + | ||
| 29 | + @Override | ||
| 30 | + public PageResult<MpMessageDO> getWxFansMsgPage(MpMessagePageReqVO pageReqVO) { | ||
| 31 | + return mpMessageMapper.selectPage(pageReqVO); | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | +} |