Commit 2e18506e1a5d8ec9a23319f7ddef47051b6856d4
1 parent
667c8459
Revert "refactor(yudao-module-mp-biz): 微信公众号粉丝管理重构"
This reverts commit a3bc6b4f74ed38b961c6295511fa659da12779a0.
Showing
14 changed files
with
248 additions
and
160 deletions
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/FansTagController.java renamed to yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/WxFansTagController.java
| 1 | 1 | package cn.iocoder.yudao.module.mp.controller.admin.fanstag; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 4 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | |
| 6 | -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | |
| 7 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*; | |
| 8 | -import cn.iocoder.yudao.module.mp.convert.fanstag.WxFansTagConvert; | |
| 9 | -import cn.iocoder.yudao.module.mp.service.tag.FansTagService; | |
| 10 | -import io.swagger.annotations.Api; | |
| 11 | -import io.swagger.annotations.ApiImplicitParam; | |
| 12 | -import io.swagger.annotations.ApiOperation; | |
| 13 | -import me.chanjar.weixin.mp.bean.tag.WxUserTag; | |
| 14 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 15 | -import org.springframework.validation.annotation.Validated; | |
| 16 | 3 | import org.springframework.web.bind.annotation.*; |
| 17 | 4 | |
| 18 | 5 | import javax.annotation.Resource; |
| 19 | -import javax.servlet.http.HttpServletResponse; | |
| 20 | -import javax.validation.Valid; | |
| 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.*; | |
| 21 | 14 | import java.io.IOException; |
| 22 | -import java.util.Collection; | |
| 23 | -import java.util.List; | |
| 15 | + | |
| 16 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 17 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 24 | 18 | |
| 25 | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 26 | -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | |
| 27 | 20 | |
| 28 | -/** | |
| 29 | - * @author fengdan | |
| 30 | - */ | |
| 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.fanstag.vo.*; | |
| 28 | +import cn.iocoder.yudao.module.mp.dal.dataobject.fanstag.WxFansTagDO; | |
| 29 | +import cn.iocoder.yudao.module.mp.convert.fanstag.WxFansTagConvert; | |
| 30 | +import cn.iocoder.yudao.module.mp.service.fanstag.WxFansTagService; | |
| 31 | + | |
| 31 | 32 | @Api(tags = "管理后台 - 粉丝标签") |
| 32 | 33 | @RestController |
| 33 | -@RequestMapping("/wechat-mp/fans-tag") | |
| 34 | +@RequestMapping("/wechatMp/wx-fans-tag") | |
| 34 | 35 | @Validated |
| 35 | -public class FansTagController { | |
| 36 | +public class WxFansTagController { | |
| 36 | 37 | |
| 37 | 38 | @Resource |
| 38 | - private FansTagService fansTagService; | |
| 39 | + private WxFansTagService wxFansTagService; | |
| 39 | 40 | |
| 40 | 41 | @PostMapping("/create") |
| 41 | 42 | @ApiOperation("创建粉丝标签") |
| 42 | 43 | @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:create')") |
| 43 | - public CommonResult<WxUserTag> createWxFansTag(@Valid @RequestBody FansTagCreateReqVO createReqVO) { | |
| 44 | - return success(fansTagService.createWxFansTag(createReqVO)); | |
| 44 | + public CommonResult<Integer> createWxFansTag(@Valid @RequestBody WxFansTagCreateReqVO createReqVO) { | |
| 45 | + return success(wxFansTagService.createWxFansTag(createReqVO)); | |
| 45 | 46 | } |
| 46 | 47 | |
| 47 | 48 | @PutMapping("/update") |
| 48 | 49 | @ApiOperation("更新粉丝标签") |
| 49 | 50 | @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:update')") |
| 50 | - public CommonResult<Boolean> updateWxFansTag(@Valid @RequestBody FansTagUpdateReqVO updateReqVO) { | |
| 51 | - fansTagService.updateWxFansTag(updateReqVO); | |
| 51 | + public CommonResult<Boolean> updateWxFansTag(@Valid @RequestBody WxFansTagUpdateReqVO updateReqVO) { | |
| 52 | + wxFansTagService.updateWxFansTag(updateReqVO); | |
| 52 | 53 | return success(true); |
| 53 | 54 | } |
| 54 | 55 | |
| ... | ... | @@ -57,7 +58,7 @@ public class FansTagController { |
| 57 | 58 | @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class) |
| 58 | 59 | @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:delete')") |
| 59 | 60 | public CommonResult<Boolean> deleteWxFansTag(@RequestParam("id") Integer id) { |
| 60 | - fansTagService.deleteWxFansTag(id); | |
| 61 | + wxFansTagService.deleteWxFansTag(id); | |
| 61 | 62 | return success(true); |
| 62 | 63 | } |
| 63 | 64 | |
| ... | ... | @@ -65,8 +66,8 @@ public class FansTagController { |
| 65 | 66 | @ApiOperation("获得粉丝标签") |
| 66 | 67 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class) |
| 67 | 68 | @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:query')") |
| 68 | - public CommonResult<FansTagRespVO> getWxFansTag(@RequestParam("id") Integer id) { | |
| 69 | - WxUserTag wxFansTag = fansTagService.getWxFansTag(id); | |
| 69 | + public CommonResult<WxFansTagRespVO> getWxFansTag(@RequestParam("id") Integer id) { | |
| 70 | + WxFansTagDO wxFansTag = wxFansTagService.getWxFansTag(id); | |
| 70 | 71 | return success(WxFansTagConvert.INSTANCE.convert(wxFansTag)); |
| 71 | 72 | } |
| 72 | 73 | |
| ... | ... | @@ -74,16 +75,16 @@ public class FansTagController { |
| 74 | 75 | @ApiOperation("获得粉丝标签列表") |
| 75 | 76 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) |
| 76 | 77 | @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:query')") |
| 77 | - public CommonResult<List<FansTagRespVO>> getWxFansTagList(@RequestParam("ids") Collection<Integer> ids) { | |
| 78 | - List<WxUserTag> list = fansTagService.getWxFansTagList(ids); | |
| 78 | + public CommonResult<List<WxFansTagRespVO>> getWxFansTagList(@RequestParam("ids") Collection<Integer> ids) { | |
| 79 | + List<WxFansTagDO> list = wxFansTagService.getWxFansTagList(ids); | |
| 79 | 80 | return success(WxFansTagConvert.INSTANCE.convertList(list)); |
| 80 | 81 | } |
| 81 | 82 | |
| 82 | 83 | @GetMapping("/page") |
| 83 | 84 | @ApiOperation("获得粉丝标签分页") |
| 84 | 85 | @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:query')") |
| 85 | - public CommonResult<PageResult<FansTagRespVO>> getWxFansTagPage(@Valid FansTagPageReqVO pageVO) { | |
| 86 | - PageResult<WxUserTag> pageResult = fansTagService.getWxFansTagPage(pageVO); | |
| 86 | + public CommonResult<PageResult<WxFansTagRespVO>> getWxFansTagPage(@Valid WxFansTagPageReqVO pageVO) { | |
| 87 | + PageResult<WxFansTagDO> pageResult = wxFansTagService.getWxFansTagPage(pageVO); | |
| 87 | 88 | return success(WxFansTagConvert.INSTANCE.convertPage(pageResult)); |
| 88 | 89 | } |
| 89 | 90 | |
| ... | ... | @@ -91,12 +92,12 @@ public class FansTagController { |
| 91 | 92 | @ApiOperation("导出粉丝标签 Excel") |
| 92 | 93 | @PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:export')") |
| 93 | 94 | @OperateLog(type = EXPORT) |
| 94 | - public void exportWxFansTagExcel(@Valid FansTagExportReqVO exportReqVO, | |
| 95 | + public void exportWxFansTagExcel(@Valid WxFansTagExportReqVO exportReqVO, | |
| 95 | 96 | HttpServletResponse response) throws IOException { |
| 96 | - List<WxUserTag> list = fansTagService.getWxFansTagList(exportReqVO); | |
| 97 | + List<WxFansTagDO> list = wxFansTagService.getWxFansTagList(exportReqVO); | |
| 97 | 98 | // 导出 Excel |
| 98 | - List<FansTagExcelVO> datas = WxFansTagConvert.INSTANCE.convertList02(list); | |
| 99 | - ExcelUtils.write(response, "粉丝标签.xls", "数据", FansTagExcelVO.class, datas); | |
| 99 | + List<WxFansTagExcelVO> datas = WxFansTagConvert.INSTANCE.convertList02(list); | |
| 100 | + ExcelUtils.write(response, "粉丝标签.xls", "数据", WxFansTagExcelVO.class, datas); | |
| 100 | 101 | } |
| 101 | 102 | |
| 102 | 103 | } | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagBaseVO.java renamed to yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/WxFansTagBaseVO.java
| 1 | 1 | package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; |
| 2 | 2 | |
| 3 | -import io.swagger.annotations.ApiModelProperty; | |
| 4 | -import lombok.Data; | |
| 3 | +import lombok.*; | |
| 4 | +import io.swagger.annotations.*; | |
| 5 | 5 | |
| 6 | 6 | /** |
| 7 | 7 | * 粉丝标签 Base VO,提供给添加、修改、详细的子 VO 使用 |
| 8 | 8 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 9 | - * | |
| 10 | - * @author fengdan | |
| 11 | 9 | */ |
| 12 | 10 | @Data |
| 13 | -public class FansTagBaseVO { | |
| 11 | +public class WxFansTagBaseVO { | |
| 14 | 12 | |
| 15 | - @ApiModelProperty(value = "标签名,UTF8编码.") | |
| 13 | + @ApiModelProperty(value = "标签名称") | |
| 16 | 14 | private String name; |
| 17 | 15 | |
| 18 | - @ApiModelProperty(value = "此标签下粉丝数") | |
| 16 | + @ApiModelProperty(value = "粉丝数量") | |
| 19 | 17 | private Integer count; |
| 18 | + | |
| 19 | + @ApiModelProperty(value = "微信账号ID") | |
| 20 | + private String wxAccountId; | |
| 21 | + | |
| 20 | 22 | } | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagCreateReqVO.java renamed to yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/WxFansTagCreateReqVO.java
| ... | ... | @@ -3,13 +3,10 @@ package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import io.swagger.annotations.*; |
| 5 | 5 | |
| 6 | -/** | |
| 7 | - * @author fengdan | |
| 8 | - */ | |
| 9 | 6 | @ApiModel("管理后台 - 粉丝标签创建 Request VO") |
| 10 | 7 | @Data |
| 11 | 8 | @EqualsAndHashCode(callSuper = true) |
| 12 | 9 | @ToString(callSuper = true) |
| 13 | -public class FansTagCreateReqVO extends FansTagBaseVO { | |
| 10 | +public class WxFansTagCreateReqVO extends WxFansTagBaseVO { | |
| 14 | 11 | |
| 15 | 12 | } | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExcelVO.java renamed to yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/WxFansTagExcelVO.java
| ... | ... | @@ -12,7 +12,7 @@ import com.alibaba.excel.annotation.ExcelProperty; |
| 12 | 12 | * @author 芋道源码 |
| 13 | 13 | */ |
| 14 | 14 | @Data |
| 15 | -public class FansTagExcelVO { | |
| 15 | +public class WxFansTagExcelVO { | |
| 16 | 16 | |
| 17 | 17 | @ExcelProperty("主键") |
| 18 | 18 | private Integer id; |
| ... | ... | @@ -23,6 +23,9 @@ public class FansTagExcelVO { |
| 23 | 23 | @ExcelProperty("粉丝数量") |
| 24 | 24 | private Integer count; |
| 25 | 25 | |
| 26 | + @ExcelProperty("微信账号ID") | |
| 27 | + private String wxAccountId; | |
| 28 | + | |
| 26 | 29 | @ExcelProperty("创建时间") |
| 27 | 30 | private Date createTime; |
| 28 | 31 | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExportReqVO.java renamed to yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/WxFansTagExportReqVO.java
| ... | ... | @@ -11,7 +11,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 11 | 11 | |
| 12 | 12 | @ApiModel(value = "管理后台 - 粉丝标签 Excel 导出 Request VO", description = "参数和 WxFansTagPageReqVO 是一致的") |
| 13 | 13 | @Data |
| 14 | -public class FansTagExportReqVO { | |
| 14 | +public class WxFansTagExportReqVO { | |
| 15 | 15 | |
| 16 | 16 | @ApiModelProperty(value = "标签名称") |
| 17 | 17 | private String name; | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagPageReqVO.java renamed to yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/WxFansTagPageReqVO.java
| ... | ... | @@ -14,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 14 | 14 | @Data |
| 15 | 15 | @EqualsAndHashCode(callSuper = true) |
| 16 | 16 | @ToString(callSuper = true) |
| 17 | -public class FansTagPageReqVO extends PageParam { | |
| 17 | +public class WxFansTagPageReqVO extends PageParam { | |
| 18 | 18 | |
| 19 | 19 | @ApiModelProperty(value = "标签名称") |
| 20 | 20 | private String name; | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagRespVO.java renamed to yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/WxFansTagRespVO.java
| ... | ... | @@ -10,10 +10,10 @@ import io.swagger.annotations.*; |
| 10 | 10 | @Data |
| 11 | 11 | @EqualsAndHashCode(callSuper = true) |
| 12 | 12 | @ToString(callSuper = true) |
| 13 | -public class FansTagRespVO extends FansTagBaseVO { | |
| 13 | +public class WxFansTagRespVO extends WxFansTagBaseVO { | |
| 14 | 14 | |
| 15 | - @ApiModelProperty(value = "标签id,由微信分配.") | |
| 16 | - private Long id; | |
| 15 | + @ApiModelProperty(value = "主键", required = true) | |
| 16 | + private Integer id; | |
| 17 | 17 | |
| 18 | 18 | @ApiModelProperty(value = "创建时间", required = true) |
| 19 | 19 | private Date createTime; | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagUpdateReqVO.java renamed to yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/WxFansTagUpdateReqVO.java
| ... | ... | @@ -9,7 +9,7 @@ import javax.validation.constraints.*; |
| 9 | 9 | @Data |
| 10 | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | 11 | @ToString(callSuper = true) |
| 12 | -public class FansTagUpdateReqVO extends FansTagBaseVO { | |
| 12 | +public class WxFansTagUpdateReqVO extends WxFansTagBaseVO { | |
| 13 | 13 | |
| 14 | 14 | @ApiModelProperty(value = "主键", required = true) |
| 15 | 15 | @NotNull(message = "主键不能为空") | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/fanstag/WxFansTagConvert.java
| ... | ... | @@ -4,31 +4,31 @@ import java.util.*; |
| 4 | 4 | |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | |
| 7 | -import me.chanjar.weixin.mp.bean.tag.WxUserTag; | |
| 8 | 7 | import org.mapstruct.Mapper; |
| 9 | 8 | import org.mapstruct.factory.Mappers; |
| 10 | 9 | import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*; |
| 10 | +import cn.iocoder.yudao.module.mp.dal.dataobject.fanstag.WxFansTagDO; | |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * 粉丝标签 Convert |
| 14 | 14 | * |
| 15 | - * @author fengdan | |
| 15 | + * @author 芋道源码 | |
| 16 | 16 | */ |
| 17 | 17 | @Mapper |
| 18 | 18 | public interface WxFansTagConvert { |
| 19 | 19 | |
| 20 | 20 | WxFansTagConvert INSTANCE = Mappers.getMapper(WxFansTagConvert.class); |
| 21 | 21 | |
| 22 | - WxUserTag convert(FansTagCreateReqVO bean); | |
| 22 | + WxFansTagDO convert(WxFansTagCreateReqVO bean); | |
| 23 | 23 | |
| 24 | - WxUserTag convert(FansTagUpdateReqVO bean); | |
| 24 | + WxFansTagDO convert(WxFansTagUpdateReqVO bean); | |
| 25 | 25 | |
| 26 | - FansTagRespVO convert(WxUserTag bean); | |
| 26 | + WxFansTagRespVO convert(WxFansTagDO bean); | |
| 27 | 27 | |
| 28 | - List<FansTagRespVO> convertList(List<WxUserTag> list); | |
| 28 | + List<WxFansTagRespVO> convertList(List<WxFansTagDO> list); | |
| 29 | 29 | |
| 30 | - PageResult<FansTagRespVO> convertPage(PageResult<WxUserTag> page); | |
| 30 | + PageResult<WxFansTagRespVO> convertPage(PageResult<WxFansTagDO> page); | |
| 31 | 31 | |
| 32 | - List<FansTagExcelVO> convertList02(List<WxUserTag> list); | |
| 32 | + List<WxFansTagExcelVO> convertList02(List<WxFansTagDO> list); | |
| 33 | 33 | |
| 34 | 34 | } | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/fanstag/WxFansTagDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.dal.dataobject.fanstag; | |
| 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_tag") | |
| 16 | +@KeySequence("wx_fans_tag_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 WxFansTagDO extends BaseDO { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 主键 | |
| 27 | + */ | |
| 28 | + @TableId | |
| 29 | + private Integer id; | |
| 30 | + /** | |
| 31 | + * 标签名称 | |
| 32 | + */ | |
| 33 | + private String name; | |
| 34 | + /** | |
| 35 | + * 粉丝数量 | |
| 36 | + */ | |
| 37 | + private Integer count; | |
| 38 | + /** | |
| 39 | + * 微信账号ID | |
| 40 | + */ | |
| 41 | + private String wxAccountId; | |
| 42 | + | |
| 43 | +} | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/fanstag/WxFansTagMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.dal.mysql.fanstag; | |
| 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.fanstag.WxFansTagDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 粉丝标签 Mapper | |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface WxFansTagMapper extends BaseMapperX<WxFansTagDO> { | |
| 19 | + | |
| 20 | + default PageResult<WxFansTagDO> selectPage(WxFansTagPageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<WxFansTagDO>() | |
| 22 | + .likeIfPresent(WxFansTagDO::getName, reqVO.getName()) | |
| 23 | + .eqIfPresent(WxFansTagDO::getCount, reqVO.getCount()) | |
| 24 | + .eqIfPresent(WxFansTagDO::getWxAccountId, reqVO.getWxAccountId()) | |
| 25 | + .betweenIfPresent(WxFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 26 | + .orderByDesc(WxFansTagDO::getId)); | |
| 27 | + } | |
| 28 | + | |
| 29 | + default List<WxFansTagDO> selectList(WxFansTagExportReqVO reqVO) { | |
| 30 | + return selectList(new LambdaQueryWrapperX<WxFansTagDO>() | |
| 31 | + .likeIfPresent(WxFansTagDO::getName, reqVO.getName()) | |
| 32 | + .eqIfPresent(WxFansTagDO::getCount, reqVO.getCount()) | |
| 33 | + .eqIfPresent(WxFansTagDO::getWxAccountId, reqVO.getWxAccountId()) | |
| 34 | + .betweenIfPresent(WxFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 35 | + .orderByDesc(WxFansTagDO::getId)); | |
| 36 | + } | |
| 37 | + | |
| 38 | +} | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagService.java renamed to yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/fanstag/WxFansTagService.java
| 1 | -package cn.iocoder.yudao.module.mp.service.tag; | |
| 1 | +package cn.iocoder.yudao.module.mp.service.fanstag; | |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagCreateReqVO; | |
| 5 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagExportReqVO; | |
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagPageReqVO; | |
| 7 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagUpdateReqVO; | |
| 8 | -import me.chanjar.weixin.mp.bean.tag.WxUserTag; | |
| 3 | +import java.util.*; | |
| 4 | +import javax.validation.*; | |
| 9 | 5 | |
| 10 | -import javax.validation.Valid; | |
| 11 | -import java.util.Collection; | |
| 12 | -import java.util.List; | |
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*; | |
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.fanstag.WxFansTagDO; | |
| 8 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 13 | 9 | |
| 14 | 10 | /** |
| 15 | 11 | * 粉丝标签 Service 接口 |
| 16 | 12 | * |
| 17 | - * @author fengdan | |
| 13 | + * @author 芋道源码 | |
| 18 | 14 | */ |
| 19 | -public interface FansTagService { | |
| 15 | +public interface WxFansTagService { | |
| 20 | 16 | |
| 21 | 17 | /** |
| 22 | 18 | * 创建粉丝标签 |
| ... | ... | @@ -24,14 +20,14 @@ public interface FansTagService { |
| 24 | 20 | * @param createReqVO 创建信息 |
| 25 | 21 | * @return 编号 |
| 26 | 22 | */ |
| 27 | - WxUserTag createWxFansTag(@Valid FansTagCreateReqVO createReqVO); | |
| 23 | + Integer createWxFansTag(@Valid WxFansTagCreateReqVO createReqVO); | |
| 28 | 24 | |
| 29 | 25 | /** |
| 30 | 26 | * 更新粉丝标签 |
| 31 | 27 | * |
| 32 | 28 | * @param updateReqVO 更新信息 |
| 33 | 29 | */ |
| 34 | - void updateWxFansTag(@Valid FansTagUpdateReqVO updateReqVO); | |
| 30 | + void updateWxFansTag(@Valid WxFansTagUpdateReqVO updateReqVO); | |
| 35 | 31 | |
| 36 | 32 | /** |
| 37 | 33 | * 删除粉丝标签 |
| ... | ... | @@ -46,7 +42,7 @@ public interface FansTagService { |
| 46 | 42 | * @param id 编号 |
| 47 | 43 | * @return 粉丝标签 |
| 48 | 44 | */ |
| 49 | - WxUserTag getWxFansTag(Integer id); | |
| 45 | + WxFansTagDO getWxFansTag(Integer id); | |
| 50 | 46 | |
| 51 | 47 | /** |
| 52 | 48 | * 获得粉丝标签列表 |
| ... | ... | @@ -54,7 +50,7 @@ public interface FansTagService { |
| 54 | 50 | * @param ids 编号 |
| 55 | 51 | * @return 粉丝标签列表 |
| 56 | 52 | */ |
| 57 | - List<WxUserTag> getWxFansTagList(Collection<Integer> ids); | |
| 53 | + List<WxFansTagDO> getWxFansTagList(Collection<Integer> ids); | |
| 58 | 54 | |
| 59 | 55 | /** |
| 60 | 56 | * 获得粉丝标签分页 |
| ... | ... | @@ -62,7 +58,7 @@ public interface FansTagService { |
| 62 | 58 | * @param pageReqVO 分页查询 |
| 63 | 59 | * @return 粉丝标签分页 |
| 64 | 60 | */ |
| 65 | - PageResult<WxUserTag> getWxFansTagPage(FansTagPageReqVO pageReqVO); | |
| 61 | + PageResult<WxFansTagDO> getWxFansTagPage(WxFansTagPageReqVO pageReqVO); | |
| 66 | 62 | |
| 67 | 63 | /** |
| 68 | 64 | * 获得粉丝标签列表, 用于 Excel 导出 |
| ... | ... | @@ -70,6 +66,6 @@ public interface FansTagService { |
| 70 | 66 | * @param exportReqVO 查询条件 |
| 71 | 67 | * @return 粉丝标签列表 |
| 72 | 68 | */ |
| 73 | - List<WxUserTag> getWxFansTagList(FansTagExportReqVO exportReqVO); | |
| 69 | + List<WxFansTagDO> getWxFansTagList(WxFansTagExportReqVO exportReqVO); | |
| 74 | 70 | |
| 75 | 71 | } | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/fanstag/WxFansTagServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.service.fanstag; | |
| 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.fanstag.vo.*; | |
| 12 | +import cn.iocoder.yudao.module.mp.dal.dataobject.fanstag.WxFansTagDO; | |
| 13 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 14 | + | |
| 15 | +import cn.iocoder.yudao.module.mp.convert.fanstag.WxFansTagConvert; | |
| 16 | +import cn.iocoder.yudao.module.mp.dal.mysql.fanstag.WxFansTagMapper; | |
| 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 WxFansTagServiceImpl implements WxFansTagService { | |
| 29 | + | |
| 30 | + @Resource | |
| 31 | + private WxFansTagMapper wxFansTagMapper; | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + public Integer createWxFansTag(WxFansTagCreateReqVO createReqVO) { | |
| 35 | + // 插入 | |
| 36 | + WxFansTagDO wxFansTag = WxFansTagConvert.INSTANCE.convert(createReqVO); | |
| 37 | + wxFansTagMapper.insert(wxFansTag); | |
| 38 | + // 返回 | |
| 39 | + return wxFansTag.getId(); | |
| 40 | + } | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public void updateWxFansTag(WxFansTagUpdateReqVO updateReqVO) { | |
| 44 | + // 校验存在 | |
| 45 | + this.validateWxFansTagExists(updateReqVO.getId()); | |
| 46 | + // 更新 | |
| 47 | + WxFansTagDO updateObj = WxFansTagConvert.INSTANCE.convert(updateReqVO); | |
| 48 | + wxFansTagMapper.updateById(updateObj); | |
| 49 | + } | |
| 50 | + | |
| 51 | + @Override | |
| 52 | + public void deleteWxFansTag(Integer id) { | |
| 53 | + // 校验存在 | |
| 54 | + this.validateWxFansTagExists(id); | |
| 55 | + // 删除 | |
| 56 | + wxFansTagMapper.deleteById(id); | |
| 57 | + } | |
| 58 | + | |
| 59 | + private void validateWxFansTagExists(Integer id) { | |
| 60 | + if (wxFansTagMapper.selectById(id) == null) { | |
| 61 | + throw exception(COMMON_NOT_EXISTS); | |
| 62 | + } | |
| 63 | + } | |
| 64 | + | |
| 65 | + @Override | |
| 66 | + public WxFansTagDO getWxFansTag(Integer id) { | |
| 67 | + return wxFansTagMapper.selectById(id); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @Override | |
| 71 | + public List<WxFansTagDO> getWxFansTagList(Collection<Integer> ids) { | |
| 72 | + return wxFansTagMapper.selectBatchIds(ids); | |
| 73 | + } | |
| 74 | + | |
| 75 | + @Override | |
| 76 | + public PageResult<WxFansTagDO> getWxFansTagPage(WxFansTagPageReqVO pageReqVO) { | |
| 77 | + return wxFansTagMapper.selectPage(pageReqVO); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public List<WxFansTagDO> getWxFansTagList(WxFansTagExportReqVO exportReqVO) { | |
| 82 | + return wxFansTagMapper.selectList(exportReqVO); | |
| 83 | + } | |
| 84 | + | |
| 85 | +} | ... | ... |
yudao-module-wechat/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagServiceImpl.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.service.tag; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagCreateReqVO; | |
| 5 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagExportReqVO; | |
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagPageReqVO; | |
| 7 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagUpdateReqVO; | |
| 8 | -import cn.iocoder.yudao.module.mp.convert.fanstag.WxFansTagConvert; | |
| 9 | -import lombok.extern.slf4j.Slf4j; | |
| 10 | -import me.chanjar.weixin.common.error.WxErrorException; | |
| 11 | -import me.chanjar.weixin.mp.api.WxMpService; | |
| 12 | -import me.chanjar.weixin.mp.bean.tag.WxUserTag; | |
| 13 | -import org.springframework.stereotype.Service; | |
| 14 | -import org.springframework.validation.annotation.Validated; | |
| 15 | - | |
| 16 | -import javax.annotation.Resource; | |
| 17 | -import java.util.Collection; | |
| 18 | -import java.util.List; | |
| 19 | - | |
| 20 | -/** | |
| 21 | - * 粉丝标签 Service 实现类 | |
| 22 | - * | |
| 23 | - * @author fengdan | |
| 24 | - */ | |
| 25 | -@Slf4j | |
| 26 | -@Service | |
| 27 | -@Validated | |
| 28 | -public class FansTagServiceImpl implements FansTagService { | |
| 29 | - | |
| 30 | - @Resource | |
| 31 | - private WxMpService wxMpService; | |
| 32 | - | |
| 33 | - @Override | |
| 34 | - public WxUserTag createWxFansTag(FansTagCreateReqVO createReqVO) { | |
| 35 | - try { | |
| 36 | - return wxMpService.getUserTagService().tagCreate("wxFansTag"); | |
| 37 | - } catch (WxErrorException e) { | |
| 38 | - throw new RuntimeException(e); | |
| 39 | - } | |
| 40 | - } | |
| 41 | - | |
| 42 | - @Override | |
| 43 | - public void updateWxFansTag(FansTagUpdateReqVO updateReqVO) { | |
| 44 | - // 校验存在 | |
| 45 | - // 更新 | |
| 46 | - WxUserTag updateObj = WxFansTagConvert.INSTANCE.convert(updateReqVO); | |
| 47 | - | |
| 48 | - } | |
| 49 | - | |
| 50 | - @Override | |
| 51 | - public void deleteWxFansTag(Integer id) { | |
| 52 | - // 校验存在 | |
| 53 | - // 删除 | |
| 54 | - } | |
| 55 | - | |
| 56 | - | |
| 57 | - @Override | |
| 58 | - public WxUserTag getWxFansTag(Integer id) { | |
| 59 | - return null; | |
| 60 | - } | |
| 61 | - | |
| 62 | - @Override | |
| 63 | - public List<WxUserTag> getWxFansTagList(Collection<Integer> ids) { | |
| 64 | - return null; | |
| 65 | - } | |
| 66 | - | |
| 67 | - @Override | |
| 68 | - public PageResult<WxUserTag> getWxFansTagPage(FansTagPageReqVO pageReqVO) { | |
| 69 | - return null; | |
| 70 | - } | |
| 71 | - | |
| 72 | - @Override | |
| 73 | - public List<WxUserTag> getWxFansTagList(FansTagExportReqVO exportReqVO) { | |
| 74 | - return null; | |
| 75 | - } | |
| 76 | - | |
| 77 | -} |