From acee075260d19a8d04127b39fb648a98f620cf24 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 8 Jan 2023 10:08:30 +0800 Subject: [PATCH] =?UTF-8?q?mp=EF=BC=9A=E8=B0=83=E6=95=B4=20tag=20=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E7=9A=84=E6=95=B4=E4=BD=93=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WxAccountFansTagController.java | 91 ------- .../vo/WxAccountFansTagBaseVO.java | 22 -- .../vo/WxAccountFansTagCreateReqVO.java | 12 - .../vo/WxAccountFansTagExcelVO.java | 32 --- .../vo/WxAccountFansTagExportReqVO.java | 33 --- .../vo/WxAccountFansTagPageReqVO.java | 36 --- .../vo/WxAccountFansTagRespVO.java | 21 -- .../vo/WxAccountFansTagUpdateReqVO.java | 18 -- .../admin/fanstag/FansTagController.java | 98 ------- .../admin/fanstag/vo/FansTagBaseVO.java | 20 -- .../admin/fanstag/vo/FansTagCreateReqVO.java | 22 -- .../admin/fanstag/vo/FansTagExcelVO.java | 29 --- .../admin/fanstag/vo/FansTagExportReqVO.java | 33 --- .../admin/fanstag/vo/FansTagPageReqVO.java | 25 -- .../admin/fanstag/vo/FansTagRespVO.java | 21 -- .../admin/fanstag/vo/FansTagUpdateReqVO.java | 25 -- .../controller/admin/tag/MpTagController.java | 65 +++++ .../controller/admin/tag/vo/MpTagBaseVO.java | 21 ++ .../admin/tag/vo/MpTagCreateReqVO.java | 21 ++ .../admin/tag/vo/MpTagPageReqVO.java | 25 ++ .../controller/admin/tag/vo/MpTagRespVO.java | 25 ++ .../admin/tag/vo/MpTagUpdateReqVO.java | 18 ++ .../WxAccountFansTagConvert.java | 34 --- .../mp/convert/fanstag/WxFansTagConvert.java | 34 --- .../module/mp/convert/tag/MpTagConvert.java | 29 +++ .../accountfanstag/WxAccountFansTagDO.java | 43 --- .../module/mp/dal/dataobject/tag/MpTagDO.java | 48 ++++ .../WxAccountFansTagMapper.java | 38 --- .../module/mp/dal/mysql/tag/MpTagMapper.java | 20 ++ .../WxAccountFansTagService.java | 74 ------ .../WxAccountFansTagServiceImpl.java | 105 -------- .../module/mp/service/tag/FansTagService.java | 74 ------ .../mp/service/tag/FansTagServiceImpl.java | 67 ----- .../module/mp/service/tag/MpTagService.java | 48 ++++ .../mp/service/tag/MpTagServiceImpl.java | 55 ++++ .../{wechatMp/wxFansTag => mp/tag}/index.vue | 0 .../views/wechatMp/wxAccountFansTag/index.vue | 245 ------------------ 37 files changed, 375 insertions(+), 1252 deletions(-) delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/WxAccountFansTagController.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagBaseVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagCreateReqVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExcelVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExportReqVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagPageReqVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagRespVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagUpdateReqVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/FansTagController.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagBaseVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagCreateReqVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExcelVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExportReqVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagPageReqVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagRespVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagUpdateReqVO.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/accountfanstag/WxAccountFansTagConvert.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/fanstag/WxFansTagConvert.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/accountfanstag/WxAccountFansTagDO.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/tag/MpTagDO.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/accountfanstag/WxAccountFansTagMapper.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/tag/MpTagMapper.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagService.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagService.java delete mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagServiceImpl.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java create mode 100644 yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java rename yudao-ui-admin/src/views/{wechatMp/wxFansTag => mp/tag}/index.vue (100%) delete mode 100644 yudao-ui-admin/src/views/wechatMp/wxAccountFansTag/index.vue diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/WxAccountFansTagController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/WxAccountFansTagController.java deleted file mode 100644 index c006dbc0d..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/WxAccountFansTagController.java +++ /dev/null @@ -1,91 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag; - -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import io.swagger.annotations.*; - -import javax.validation.*; -import javax.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.pojo.CommonResult; - -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; - -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; - -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; - -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; - -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; -import cn.iocoder.yudao.module.mp.convert.accountfanstag.WxAccountFansTagConvert; -import cn.iocoder.yudao.module.mp.service.accountfanstag.WxAccountFansTagService; - -@Api(tags = "管理后台 - 粉丝标签关联") -@RestController -@RequestMapping("/wechatMp/wx-account-fans-tag") -@Validated -public class WxAccountFansTagController { - - @Resource - private WxAccountFansTagService wxAccountFansTagService; - - @PostMapping("/create") - @ApiOperation("创建粉丝标签关联") - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:create')") - public CommonResult createWxAccountFansTag(@Valid @RequestBody WxAccountFansTagCreateReqVO createReqVO) { - return success(wxAccountFansTagService.createWxAccountFansTag(createReqVO)); - } - - @PutMapping("/update") - @ApiOperation("更新粉丝标签关联") - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:update')") - public CommonResult updateWxAccountFansTag(@Valid @RequestBody WxAccountFansTagUpdateReqVO updateReqVO) { - wxAccountFansTagService.updateWxAccountFansTag(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @ApiOperation("删除粉丝标签关联") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class) - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:delete')") - public CommonResult deleteWxAccountFansTag(@RequestParam("id") Integer id) { - wxAccountFansTagService.deleteWxAccountFansTag(id); - return success(true); - } - - @GetMapping("/get") - @ApiOperation("获得粉丝标签关联") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class) - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')") - public CommonResult getWxAccountFansTag(@RequestParam("id") Integer id) { - WxAccountFansTagDO wxAccountFansTag = wxAccountFansTagService.getWxAccountFansTag(id); - return success(WxAccountFansTagConvert.INSTANCE.convert(wxAccountFansTag)); - } - - @GetMapping("/list") - @ApiOperation("获得粉丝标签关联列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')") - public CommonResult> getWxAccountFansTagList(@RequestParam("ids") Collection ids) { - List list = wxAccountFansTagService.getWxAccountFansTagList(ids); - return success(WxAccountFansTagConvert.INSTANCE.convertList(list)); - } - - @GetMapping("/page") - @ApiOperation("获得粉丝标签关联分页") - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')") - public CommonResult> getWxAccountFansTagPage(@Valid WxAccountFansTagPageReqVO pageVO) { - PageResult pageResult = wxAccountFansTagService.getWxAccountFansTagPage(pageVO); - return success(WxAccountFansTagConvert.INSTANCE.convertPage(pageResult)); - } - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagBaseVO.java deleted file mode 100644 index 2e952e424..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagBaseVO.java +++ /dev/null @@ -1,22 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; - -import lombok.*; -import io.swagger.annotations.*; - -/** - * 粉丝标签关联 Base VO,提供给添加、修改、详细的子 VO 使用 - * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 - */ -@Data -public class WxAccountFansTagBaseVO { - - @ApiModelProperty(value = "用户标识") - private String openid; - - @ApiModelProperty(value = "标签ID") - private String tagId; - - @ApiModelProperty(value = "微信账号ID") - private String wxAccountId; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagCreateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagCreateReqVO.java deleted file mode 100644 index e386d4035..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagCreateReqVO.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; - -import lombok.*; -import io.swagger.annotations.*; - -@ApiModel("管理后台 - 粉丝标签关联创建 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class WxAccountFansTagCreateReqVO extends WxAccountFansTagBaseVO { - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExcelVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExcelVO.java deleted file mode 100644 index ffaa4742e..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExcelVO.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; - -import lombok.*; - -import java.util.*; - -import com.alibaba.excel.annotation.ExcelProperty; - -/** - * 粉丝标签关联 Excel VO - * - * @author 芋道源码 - */ -@Data -public class WxAccountFansTagExcelVO { - - @ExcelProperty("主键") - private Integer id; - - @ExcelProperty("用户标识") - private String openid; - - @ExcelProperty("标签ID") - private String tagId; - - @ExcelProperty("微信账号ID") - private String wxAccountId; - - @ExcelProperty("创建时间") - private Date createTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExportReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExportReqVO.java deleted file mode 100644 index 2185e061e..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExportReqVO.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; - -import lombok.*; - -import java.util.*; - -import io.swagger.annotations.*; -import org.springframework.format.annotation.DateTimeFormat; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@ApiModel(value = "管理后台 - 粉丝标签关联 Excel 导出 Request VO", description = "参数和 WxAccountFansTagPageReqVO 是一致的") -@Data -public class WxAccountFansTagExportReqVO { - - @ApiModelProperty(value = "用户标识") - private String openid; - - @ApiModelProperty(value = "标签ID") - private String tagId; - - @ApiModelProperty(value = "微信账号ID") - private String wxAccountId; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始创建时间") - private Date beginCreateTime; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "结束创建时间") - private Date endCreateTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagPageReqVO.java deleted file mode 100644 index 142cab338..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagPageReqVO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; - -import lombok.*; - -import java.util.*; - -import io.swagger.annotations.*; -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import org.springframework.format.annotation.DateTimeFormat; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@ApiModel("管理后台 - 粉丝标签关联分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class WxAccountFansTagPageReqVO extends PageParam { - - @ApiModelProperty(value = "用户标识") - private String openid; - - @ApiModelProperty(value = "标签ID") - private String tagId; - - @ApiModelProperty(value = "微信账号ID") - private String wxAccountId; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始创建时间") - private Date beginCreateTime; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "结束创建时间") - private Date endCreateTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagRespVO.java deleted file mode 100644 index 804ac8e70..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagRespVO.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; - -import lombok.*; - -import java.util.*; - -import io.swagger.annotations.*; - -@ApiModel("管理后台 - 粉丝标签关联 Response VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class WxAccountFansTagRespVO extends WxAccountFansTagBaseVO { - - @ApiModelProperty(value = "主键", required = true) - private Integer id; - - @ApiModelProperty(value = "创建时间", required = true) - private Date createTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagUpdateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagUpdateReqVO.java deleted file mode 100644 index 7ef3f4c61..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagUpdateReqVO.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; - -import lombok.*; -import io.swagger.annotations.*; - -import javax.validation.constraints.*; - -@ApiModel("管理后台 - 粉丝标签关联更新 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class WxAccountFansTagUpdateReqVO extends WxAccountFansTagBaseVO { - - @ApiModelProperty(value = "主键", required = true) - @NotNull(message = "主键不能为空") - private Integer id; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/FansTagController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/FansTagController.java deleted file mode 100644 index 556c011c0..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/FansTagController.java +++ /dev/null @@ -1,98 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.fanstag; - -import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*; -import cn.iocoder.yudao.module.mp.convert.fanstag.WxFansTagConvert; -import cn.iocoder.yudao.module.mp.service.tag.FansTagService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import me.chanjar.weixin.common.error.WxErrorException; -import me.chanjar.weixin.mp.bean.tag.WxUserTag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import java.io.IOException; -import java.util.List; - -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; - -/** - * @author fengdan - */ -@Api(tags = "管理后台 - 粉丝标签") -@RestController -@RequestMapping("/wechatMp/fans-tag") -@Validated -public class FansTagController { - - @Resource - private FansTagService fansTagService; - - @PostMapping("/create") - @ApiOperation("创建粉丝标签") - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:create')") - public CommonResult createWxFansTag(@Valid @RequestBody FansTagCreateReqVO createReqVO) throws WxErrorException { - return success(fansTagService.createWxFansTag(createReqVO)); - } - - @PutMapping("/update") - @ApiOperation("更新粉丝标签") - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:update')") - public CommonResult updateWxFansTag(@Valid @RequestBody FansTagUpdateReqVO updateReqVO) throws WxErrorException { - return success(fansTagService.updateWxFansTag(updateReqVO)); - } - - @DeleteMapping("/delete") - @ApiOperation("删除粉丝标签") - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:delete')") - public CommonResult deleteWxFansTag(@RequestParam("id") Long id, - @RequestParam("appId") String appId) throws WxErrorException { - return success(fansTagService.deleteWxFansTag(id, appId)); - } - - @GetMapping("/list") - @ApiOperation("获取公众号已创建的标签") - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:query')") - public CommonResult> getWxFansTagList(@NotEmpty(message = "公众号appId不能为空") - @RequestParam("appId") String appId) throws WxErrorException { - List list = fansTagService.getWxFansTagList(appId); - return success(WxFansTagConvert.INSTANCE.convertList(list)); - } - - @GetMapping("/page") - @ApiOperation("获取公众号已创建的标签") - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:query')") - public CommonResult> page() throws WxErrorException { - PageResult page = new PageResult<>(); - return success(WxFansTagConvert.INSTANCE.convertPage(page)); - } - - @GetMapping("/tagListUser") - @ApiOperation("获取标签下粉丝列表") - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:query')") - public CommonResult tagListUser(@Valid FansTagPageReqVO pageVO) { - return success(""); - } - - @GetMapping("/export-excel") - @ApiOperation("导出粉丝标签 Excel") - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:export')") - @OperateLog(type = EXPORT) - public void exportWxFansTagExcel(@Valid FansTagExportReqVO exportReqVO, - HttpServletResponse response) throws IOException { - List list = fansTagService.getWxFansTagList(exportReqVO); - // 导出 Excel - List datas = WxFansTagConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "粉丝标签.xls", "数据", FansTagExcelVO.class, datas); - } - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagBaseVO.java deleted file mode 100644 index b1c4212c1..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagBaseVO.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; - -/** - * 粉丝标签 Base VO,提供给添加、修改、详细的子 VO 使用 - * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 - * - * @author fengdan - */ -@Data -public class FansTagBaseVO { - - @NotBlank(message = "标签名不能为空") - @ApiModelProperty(value = "标签名,UTF8编码") - private String name; -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagCreateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagCreateReqVO.java deleted file mode 100644 index 837c55410..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagCreateReqVO.java +++ /dev/null @@ -1,22 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; - -import javax.validation.constraints.NotBlank; - -/** - * @author fengdan - */ -@ApiModel("管理后台 - 粉丝标签创建 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class FansTagCreateReqVO extends FansTagBaseVO { - @NotBlank(message = "公众号appId不能为空") - @ApiModelProperty("微信公众号appId") - private String appId; -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExcelVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExcelVO.java deleted file mode 100644 index b55c9ddf5..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExcelVO.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; - -import lombok.*; - -import java.util.*; - -import com.alibaba.excel.annotation.ExcelProperty; - -/** - * 粉丝标签 Excel VO - * - * @author 芋道源码 - */ -@Data -public class FansTagExcelVO { - - @ExcelProperty("主键") - private Integer id; - - @ExcelProperty("标签名称") - private String name; - - @ExcelProperty("粉丝数量") - private Integer count; - - @ExcelProperty("创建时间") - private Date createTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExportReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExportReqVO.java deleted file mode 100644 index fbe23b2b4..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExportReqVO.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; - -import lombok.*; - -import java.util.*; - -import io.swagger.annotations.*; -import org.springframework.format.annotation.DateTimeFormat; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@ApiModel(value = "管理后台 - 粉丝标签 Excel 导出 Request VO", description = "参数和 WxFansTagPageReqVO 是一致的") -@Data -public class FansTagExportReqVO { - - @ApiModelProperty(value = "标签名称") - private String name; - - @ApiModelProperty(value = "粉丝数量") - private Integer count; - - @ApiModelProperty(value = "微信账号ID") - private String wxAccountId; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始创建时间") - private Date beginCreateTime; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "结束创建时间") - private Date endCreateTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagPageReqVO.java deleted file mode 100644 index 1592e2c72..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagPageReqVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; - -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; - -import javax.validation.constraints.NotEmpty; - -/** - * @author fengdan - */ -@ApiModel("管理后台 - 粉丝标签分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class FansTagPageReqVO extends PageParam { - - @NotEmpty(message = "公众号appId不能为空") - @ApiModelProperty("微信公众号appId") - private String appId; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagRespVO.java deleted file mode 100644 index 7fd996715..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagRespVO.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; - -import lombok.*; - -import java.util.*; - -import io.swagger.annotations.*; - -@ApiModel("管理后台 - 粉丝标签 Response VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class FansTagRespVO extends FansTagBaseVO { - - @ApiModelProperty(value = "标签id,由微信分配.") - private Long id; - - @ApiModelProperty(value = "创建时间", required = true) - private Date createTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagUpdateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagUpdateReqVO.java deleted file mode 100644 index d114c96fa..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagUpdateReqVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; - -import lombok.*; -import io.swagger.annotations.*; - -import javax.validation.constraints.*; - -/** - * @author fengdan - */ -@ApiModel("管理后台 - 粉丝标签更新 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class FansTagUpdateReqVO extends FansTagBaseVO { - - @ApiModelProperty(value = "标签id,由微信分配", required = true) - @NotNull(message = "主键不能为空") - private Long id; - - @NotBlank(message = "公众号appId不能为空") - @ApiModelProperty("微信公众号appId") - private String appId; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java new file mode 100644 index 000000000..03e96fb60 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.mp.controller.admin.tag; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagRespVO; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO; +import cn.iocoder.yudao.module.mp.convert.tag.MpTagConvert; +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; +import cn.iocoder.yudao.module.mp.service.tag.MpTagService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Api(tags = "管理后台 - 公众号标签") +@RestController +@RequestMapping("/mp/tag") +@Validated +public class MpTagController { + + @Resource + private MpTagService mpTagService; + + @PostMapping("/create") + @ApiOperation("创建公众号标签") + @PreAuthorize("@ss.hasPermission('mp:tag:create')") + public CommonResult createTag(@Valid @RequestBody MpTagCreateReqVO createReqVO) { + return success(mpTagService.createTag(createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新公众号标签") + @PreAuthorize("@ss.hasPermission('mp:tag:update')") + public CommonResult updateTag(@Valid @RequestBody MpTagUpdateReqVO updateReqVO) { + mpTagService.updateTag(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除公众号标签") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('mp:tag:delete')") + public CommonResult deleteTag(@RequestParam("id") Long id) { + mpTagService.deleteTag(id); + return success(true); + } + + @GetMapping("/page") + @ApiOperation("获取公众号标签分页") + @PreAuthorize("@ss.hasPermission('mp:tag:query')") + public CommonResult> getTagPage(MpTagPageReqVO pageReqVO) { + PageResult pageResult = mpTagService.getTagPage(pageReqVO); + return success(MpTagConvert.INSTANCE.convertPage(pageResult)); + } + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java new file mode 100644 index 000000000..832faf535 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; + +/** + * 公众号标签 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + * + * @author fengdan + */ +@Data +public class MpTagBaseVO { + + @ApiModelProperty(value = "标签名", required = true, example = "土豆") + @NotEmpty(message = "标签名不能为空") + private String name; + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java new file mode 100644 index 000000000..24eb0167b --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import javax.validation.constraints.NotNull; + +@ApiModel("管理后台 - 公众号标签创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MpTagCreateReqVO extends MpTagBaseVO { + + @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @NotNull(message = "公众号账号的编号不能为空") + private Long accountId; + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java new file mode 100644 index 000000000..b48481fc2 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java @@ -0,0 +1,25 @@ +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import javax.validation.constraints.NotEmpty; + +@ApiModel("管理后台 - 公众号标签分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MpTagPageReqVO extends PageParam { + + @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @NotEmpty(message = "公众号账号的编号不能为空") + private Long accountId; + + @ApiModelProperty(value = "标签名", example = "哈哈", notes = "模糊匹配") + private String name; + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java new file mode 100644 index 000000000..47b3c4720 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java @@ -0,0 +1,25 @@ +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +@ApiModel("管理后台 - 公众号标签 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MpTagRespVO extends MpTagBaseVO { + + @ApiModelProperty(value = "编号", required = true) + @NotNull(message = "编号不能为空") + private Long id; + + @ApiModelProperty(value = "创建时间", required = true) + private Date createTime; + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java new file mode 100644 index 000000000..873871fd4 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; + +import lombok.*; +import io.swagger.annotations.*; + +import javax.validation.constraints.*; + +@ApiModel("管理后台 - 公众号标签更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MpTagUpdateReqVO extends MpTagBaseVO { + + @ApiModelProperty(value = "编号", required = true) + @NotNull(message = "编号不能为空") + private Long id; + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/accountfanstag/WxAccountFansTagConvert.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/accountfanstag/WxAccountFansTagConvert.java deleted file mode 100644 index ea7723c8b..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/accountfanstag/WxAccountFansTagConvert.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.yudao.module.mp.convert.accountfanstag; - -import java.util.*; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; - -/** - * 粉丝标签关联 Convert - * - * @author 芋道源码 - */ -@Mapper -public interface WxAccountFansTagConvert { - - WxAccountFansTagConvert INSTANCE = Mappers.getMapper(WxAccountFansTagConvert.class); - - WxAccountFansTagDO convert(WxAccountFansTagCreateReqVO bean); - - WxAccountFansTagDO convert(WxAccountFansTagUpdateReqVO bean); - - WxAccountFansTagRespVO convert(WxAccountFansTagDO bean); - - List convertList(List list); - - PageResult convertPage(PageResult page); - - List convertList02(List list); - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/fanstag/WxFansTagConvert.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/fanstag/WxFansTagConvert.java deleted file mode 100644 index 968d62b8a..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/fanstag/WxFansTagConvert.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.yudao.module.mp.convert.fanstag; - -import java.util.*; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import me.chanjar.weixin.mp.bean.tag.WxUserTag; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*; - -/** - * 粉丝标签 Convert - * - * @author fengdan - */ -@Mapper -public interface WxFansTagConvert { - - WxFansTagConvert INSTANCE = Mappers.getMapper(WxFansTagConvert.class); - - WxUserTag convert(FansTagCreateReqVO bean); - - WxUserTag convert(FansTagUpdateReqVO bean); - - FansTagRespVO convert(WxUserTag bean); - - List convertList(List list); - - PageResult convertPage(PageResult page); - - List convertList02(List list); - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java new file mode 100644 index 000000000..f8121003d --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java @@ -0,0 +1,29 @@ +package cn.iocoder.yudao.module.mp.convert.tag; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagRespVO; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO; +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; +import me.chanjar.weixin.mp.bean.tag.WxUserTag; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +@Mapper +public interface MpTagConvert { + + MpTagConvert INSTANCE = Mappers.getMapper(MpTagConvert.class); + + WxUserTag convert(MpTagCreateReqVO bean); + + WxUserTag convert(MpTagUpdateReqVO bean); + + MpTagRespVO convert(WxUserTag bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/accountfanstag/WxAccountFansTagDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/accountfanstag/WxAccountFansTagDO.java deleted file mode 100644 index 71e253a40..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/accountfanstag/WxAccountFansTagDO.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag; - -import lombok.*; - -import java.util.*; - -import com.baomidou.mybatisplus.annotation.*; -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; - -/** - * 粉丝标签关联 DO - * - * @author 芋道源码 - */ -@TableName("wx_account_fans_tag") -@KeySequence("wx_account_fans_tag_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class WxAccountFansTagDO extends BaseDO { - - /** - * 主键 - */ - @TableId - private Integer id; - /** - * 用户标识 - */ - private String openid; - /** - * 标签ID - */ - private String tagId; - /** - * 微信账号ID - */ - private String wxAccountId; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/tag/MpTagDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/tag/MpTagDO.java new file mode 100644 index 000000000..bd975c4a4 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/tag/MpTagDO.java @@ -0,0 +1,48 @@ +package cn.iocoder.yudao.module.mp.dal.dataobject.tag; + +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; +import lombok.*; + +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 公众号标签 DO + * + * @author 芋道源码 + */ +@TableName("mp_tag") +@KeySequence("mp_tag_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MpTagDO extends BaseDO { + + /** + * 主键 + */ + @TableId(type = IdType.INPUT) + private Long id; + /** + * 公众号标签 id + */ + private Long tagId; + /** + * 标签名 + */ + private String name; + + /** + * 微信公众号 ID + * + * 关联 {@link MpAccountDO#getId()} + */ + private Long accountId; + /** + * 微信公众号 appid + * + * 冗余 {@link MpAccountDO#getAppId()} + */ + private String appId; + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/accountfanstag/WxAccountFansTagMapper.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/accountfanstag/WxAccountFansTagMapper.java deleted file mode 100644 index 8df37b1a1..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/accountfanstag/WxAccountFansTagMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.yudao.module.mp.dal.mysql.accountfanstag; - -import java.util.*; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; -import org.apache.ibatis.annotations.Mapper; -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; - -/** - * 粉丝标签关联 Mapper - * - * @author 芋道源码 - */ -@Mapper -public interface WxAccountFansTagMapper extends BaseMapperX { - - default PageResult selectPage(WxAccountFansTagPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(WxAccountFansTagDO::getOpenid, reqVO.getOpenid()) - .eqIfPresent(WxAccountFansTagDO::getTagId, reqVO.getTagId()) - .eqIfPresent(WxAccountFansTagDO::getWxAccountId, reqVO.getWxAccountId()) - .betweenIfPresent(WxAccountFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(WxAccountFansTagDO::getId)); - } - - default List selectList(WxAccountFansTagExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(WxAccountFansTagDO::getOpenid, reqVO.getOpenid()) - .eqIfPresent(WxAccountFansTagDO::getTagId, reqVO.getTagId()) - .eqIfPresent(WxAccountFansTagDO::getWxAccountId, reqVO.getWxAccountId()) - .betweenIfPresent(WxAccountFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(WxAccountFansTagDO::getId)); - } - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/tag/MpTagMapper.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/tag/MpTagMapper.java new file mode 100644 index 000000000..1162fbe9f --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/tag/MpTagMapper.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.mp.dal.mysql.tag; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO; +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MpTagMapper extends BaseMapperX { + + default PageResult selectPage(MpTagPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MpTagDO::getAccountId, reqVO.getAccountId()) + .likeIfPresent(MpTagDO::getName, reqVO.getName()) + .orderByDesc(MpTagDO::getId)); + } + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagService.java deleted file mode 100644 index a7f2141e3..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagService.java +++ /dev/null @@ -1,74 +0,0 @@ -package cn.iocoder.yudao.module.mp.service.accountfanstag; - -import java.util.*; -import javax.validation.*; - -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; -import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import me.chanjar.weixin.mp.bean.result.WxMpUser; - -/** - * 粉丝标签关联 Service 接口 - * - * @author 芋道源码 - */ -public interface WxAccountFansTagService { - - /** - * 创建粉丝标签关联 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Integer createWxAccountFansTag(@Valid WxAccountFansTagCreateReqVO createReqVO); - - /** - * 更新粉丝标签关联 - * - * @param updateReqVO 更新信息 - */ - void updateWxAccountFansTag(@Valid WxAccountFansTagUpdateReqVO updateReqVO); - - /** - * 删除粉丝标签关联 - * - * @param id 编号 - */ - void deleteWxAccountFansTag(Integer id); - - /** - * 获得粉丝标签关联 - * - * @param id 编号 - * @return 粉丝标签关联 - */ - WxAccountFansTagDO getWxAccountFansTag(Integer id); - - /** - * 获得粉丝标签关联列表 - * - * @param ids 编号 - * @return 粉丝标签关联列表 - */ - List getWxAccountFansTagList(Collection ids); - - /** - * 获得粉丝标签关联分页 - * - * @param pageReqVO 分页查询 - * @return 粉丝标签关联分页 - */ - PageResult getWxAccountFansTagPage(WxAccountFansTagPageReqVO pageReqVO); - - /** - * 获得粉丝标签关联列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 粉丝标签关联列表 - */ - List getWxAccountFansTagList(WxAccountFansTagExportReqVO exportReqVO); - - void processFansTags(MpAccountDO wxAccount, WxMpUser wxmpUser); -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java deleted file mode 100644 index 50d0dc485..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -package cn.iocoder.yudao.module.mp.service.accountfanstag; - -import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; -import me.chanjar.weixin.mp.bean.result.WxMpUser; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -import org.springframework.validation.annotation.Validated; - -import java.util.*; - -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import cn.iocoder.yudao.module.mp.convert.accountfanstag.WxAccountFansTagConvert; -import cn.iocoder.yudao.module.mp.dal.mysql.accountfanstag.WxAccountFansTagMapper; - -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; - -/** - * 粉丝标签关联 Service 实现类 - * - * @author 芋道源码 - */ -@Service -@Validated -public class WxAccountFansTagServiceImpl implements WxAccountFansTagService { - - @Resource - private WxAccountFansTagMapper wxAccountFansTagMapper; - - @Override - public Integer createWxAccountFansTag(WxAccountFansTagCreateReqVO createReqVO) { - // 插入 - WxAccountFansTagDO wxAccountFansTag = WxAccountFansTagConvert.INSTANCE.convert(createReqVO); - wxAccountFansTagMapper.insert(wxAccountFansTag); - // 返回 - return wxAccountFansTag.getId(); - } - - @Override - public void updateWxAccountFansTag(WxAccountFansTagUpdateReqVO updateReqVO) { - // 校验存在 - this.validateWxAccountFansTagExists(updateReqVO.getId()); - // 更新 - WxAccountFansTagDO updateObj = WxAccountFansTagConvert.INSTANCE.convert(updateReqVO); - wxAccountFansTagMapper.updateById(updateObj); - } - - @Override - public void deleteWxAccountFansTag(Integer id) { - // 校验存在 - this.validateWxAccountFansTagExists(id); - // 删除 - wxAccountFansTagMapper.deleteById(id); - } - - private void validateWxAccountFansTagExists(Integer id) { - if (wxAccountFansTagMapper.selectById(id) == null) { - throw exception(COMMON_NOT_EXISTS); - } - } - - @Override - public WxAccountFansTagDO getWxAccountFansTag(Integer id) { - return wxAccountFansTagMapper.selectById(id); - } - - @Override - public List getWxAccountFansTagList(Collection ids) { - return wxAccountFansTagMapper.selectBatchIds(ids); - } - - @Override - public PageResult getWxAccountFansTagPage(WxAccountFansTagPageReqVO pageReqVO) { - return wxAccountFansTagMapper.selectPage(pageReqVO); - } - - @Override - public List getWxAccountFansTagList(WxAccountFansTagExportReqVO exportReqVO) { - return wxAccountFansTagMapper.selectList(exportReqVO); - } - - @Override - public void processFansTags(MpAccountDO wxAccountDO, WxMpUser wxmpUser) { - WxAccountFansTagExportReqVO wxAccountFansTagTpl = new WxAccountFansTagExportReqVO(); - wxAccountFansTagTpl.setOpenid(wxmpUser.getOpenId()); - List wxAccountFansTagList = this.getWxAccountFansTagList(wxAccountFansTagTpl); - wxAccountFansTagList.forEach(temp -> this.deleteWxAccountFansTag(temp.getId())); - - Long[] tagIds = wxmpUser.getTagIds(); - for (Long tagId : tagIds) { - WxAccountFansTagCreateReqVO wxAccountFansTag = new WxAccountFansTagCreateReqVO(); - wxAccountFansTag.setOpenid(wxmpUser.getOpenId()); - wxAccountFansTag.setTagId(String.valueOf(tagId)); - wxAccountFansTag.setWxAccountId(String.valueOf(wxAccountDO.getId())); - this.createWxAccountFansTag(wxAccountFansTag); - } - } - - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagService.java deleted file mode 100644 index 469a3f10b..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagService.java +++ /dev/null @@ -1,74 +0,0 @@ -package cn.iocoder.yudao.module.mp.service.tag; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagCreateReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagExportReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagPageReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagUpdateReqVO; -import me.chanjar.weixin.common.error.WxErrorException; -import me.chanjar.weixin.mp.bean.tag.WxUserTag; - -import javax.validation.Valid; -import java.util.List; - -/** - * 粉丝标签 Service 接口 - * - * @author fengdan - */ -public interface FansTagService { - - /** - * 创建粉丝标签 - * - * @param createReqVO 创建标签信息 - * @return {@link WxUserTag} 用户标签对象 - * @throws WxErrorException 微信异常 - */ - WxUserTag createWxFansTag(FansTagCreateReqVO createReqVO) throws WxErrorException; - - /** - * 更新粉丝标签 - * - * @param updateReqVO 更新信息 - * @return {@link Boolean} - * @throws WxErrorException 微信异常 - */ - Boolean updateWxFansTag(@Valid FansTagUpdateReqVO updateReqVO) throws WxErrorException; - - /** - * 删除粉丝标签 - * - * @param id 编号 - * @param appId 公众号appId - * @return {@link Boolean} - * @throws WxErrorException 微信异常 - */ - Boolean deleteWxFansTag(Long id, String appId) throws WxErrorException; - - /** - * 获取公众号已创建的标签 - * - * @param appId 公众号appId - * @return 粉丝标签列表 - * @throws WxErrorException 微信异常 - */ - List getWxFansTagList(String appId) throws WxErrorException; - - /** - * 获得粉丝标签分页 - * - * @param pageReqVO 分页查询 - * @return 粉丝标签分页 - */ - PageResult getWxFansTagPage(FansTagPageReqVO pageReqVO); - - /** - * 获得粉丝标签列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 粉丝标签列表 - */ - List getWxFansTagList(FansTagExportReqVO exportReqVO); - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagServiceImpl.java deleted file mode 100644 index c93432c39..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package cn.iocoder.yudao.module.mp.service.tag; - -import cn.hutool.core.util.ReUtil; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagCreateReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagExportReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagPageReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagUpdateReqVO; -import lombok.extern.slf4j.Slf4j; -import me.chanjar.weixin.common.error.WxErrorException; -import me.chanjar.weixin.mp.api.WxMpService; -import me.chanjar.weixin.mp.bean.tag.WxUserTag; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 粉丝标签 Service 实现类 - * - * @author fengdan - */ -@Slf4j -@Service -@Validated -public class FansTagServiceImpl implements FansTagService { - @Resource - private WxMpService wxMpService; - - @Override - public WxUserTag createWxFansTag(FansTagCreateReqVO createReqVO) throws WxErrorException { - // TODO 切换公众号操作 调整为 aop 或者 过滤器\拦截器 处理 - wxMpService.switchover(createReqVO.getAppId()); - return wxMpService.getUserTagService().tagCreate(createReqVO.getName()); - } - - @Override - public Boolean updateWxFansTag(FansTagUpdateReqVO updateReqVO) throws WxErrorException { - wxMpService.switchover(updateReqVO.getAppId()); - return wxMpService.getUserTagService().tagUpdate(updateReqVO.getId(), updateReqVO.getName()); - } - - @Override - public Boolean deleteWxFansTag(Long id, String appId) throws WxErrorException { - wxMpService.switchover(appId); - return wxMpService.getUserTagService().tagDelete(id); - } - - - @Override - public List getWxFansTagList(String appId) throws WxErrorException { - wxMpService.switchover(appId); - return wxMpService.getUserTagService().tagGet(); - } - - @Override - public PageResult getWxFansTagPage(FansTagPageReqVO pageReqVO) { - return null; - } - - @Override - public List getWxFansTagList(FansTagExportReqVO exportReqVO) { - return null; - } - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java new file mode 100644 index 000000000..0d441379d --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java @@ -0,0 +1,48 @@ +package cn.iocoder.yudao.module.mp.service.tag; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO; +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; + +import javax.validation.Valid; + +/** + * 公众号标签 Service 接口 + * + * @author fengdan + */ +public interface MpTagService { + + /** + * 创建公众号标签 + * + * @param createReqVO 创建标签信息 + * @return 标签编号 + */ + Long createTag(@Valid MpTagCreateReqVO createReqVO); + + /** + * 更新公众号标签 + * + * @param updateReqVO 更新标签信息 + */ + void updateTag(@Valid MpTagUpdateReqVO updateReqVO); + + /** + * 删除公众号标签 + * + * @param id 编号 + */ + void deleteTag(Long id); + + /** + * 获得公众号标签分页 + * + * @param pageReqVO 分页查询 + * @return 公众号标签分页 + */ + PageResult getTagPage(MpTagPageReqVO pageReqVO); + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java new file mode 100644 index 000000000..b30a52d61 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.mp.service.tag; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO; +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; +import cn.iocoder.yudao.module.mp.dal.mysql.tag.MpTagMapper; +import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +/** + * 公众号标签 Service 实现类 + * + * @author fengdan + */ +@Slf4j +@Service +@Validated +public class MpTagServiceImpl implements MpTagService { + + @Resource + private MpTagMapper mpTagMapper; + + @Resource + @Lazy // 延迟加载,为了解决延迟加载 + private MpServiceFactory mpServiceFactory; + + @Override + public Long createTag(MpTagCreateReqVO createReqVO) { +// return wxMpService.getUserTagService().tagCreate(createReqVO.getName()); + return null; + } + + @Override + public void updateTag(MpTagUpdateReqVO updateReqVO) { +// return wxMpService.getUserTagService().tagUpdate(updateReqVO.getId(), updateReqVO.getName()); + } + + @Override + public void deleteTag(Long id) { +// return wxMpService.getUserTagService().tagDelete(id); + } + + @Override + public PageResult getTagPage(MpTagPageReqVO pageReqVO) { + return null; + } + +} diff --git a/yudao-ui-admin/src/views/wechatMp/wxFansTag/index.vue b/yudao-ui-admin/src/views/mp/tag/index.vue similarity index 100% rename from yudao-ui-admin/src/views/wechatMp/wxFansTag/index.vue rename to yudao-ui-admin/src/views/mp/tag/index.vue diff --git a/yudao-ui-admin/src/views/wechatMp/wxAccountFansTag/index.vue b/yudao-ui-admin/src/views/wechatMp/wxAccountFansTag/index.vue deleted file mode 100644 index 57dfcbd03..000000000 --- a/yudao-ui-admin/src/views/wechatMp/wxAccountFansTag/index.vue +++ /dev/null @@ -1,245 +0,0 @@ - - -