Commit acee075260d19a8d04127b39fb648a98f620cf24
1 parent
d6de233a
mp:调整 tag 模块的整体结构
Showing
33 changed files
with
324 additions
and
1201 deletions
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/WxAccountFansTagController.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag; | ||
| 2 | - | ||
| 3 | -import org.springframework.web.bind.annotation.*; | ||
| 4 | - | ||
| 5 | -import javax.annotation.Resource; | ||
| 6 | - | ||
| 7 | -import org.springframework.validation.annotation.Validated; | ||
| 8 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
| 9 | -import io.swagger.annotations.*; | ||
| 10 | - | ||
| 11 | -import javax.validation.*; | ||
| 12 | -import javax.servlet.http.*; | ||
| 13 | -import java.util.*; | ||
| 14 | -import java.io.IOException; | ||
| 15 | - | ||
| 16 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 17 | -import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 18 | - | ||
| 19 | -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 20 | - | ||
| 21 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||
| 22 | - | ||
| 23 | -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 24 | - | ||
| 25 | -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; | ||
| 26 | - | ||
| 27 | -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; | ||
| 28 | -import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; | ||
| 29 | -import cn.iocoder.yudao.module.mp.convert.accountfanstag.WxAccountFansTagConvert; | ||
| 30 | -import cn.iocoder.yudao.module.mp.service.accountfanstag.WxAccountFansTagService; | ||
| 31 | - | ||
| 32 | -@Api(tags = "管理后台 - 粉丝标签关联") | ||
| 33 | -@RestController | ||
| 34 | -@RequestMapping("/wechatMp/wx-account-fans-tag") | ||
| 35 | -@Validated | ||
| 36 | -public class WxAccountFansTagController { | ||
| 37 | - | ||
| 38 | - @Resource | ||
| 39 | - private WxAccountFansTagService wxAccountFansTagService; | ||
| 40 | - | ||
| 41 | - @PostMapping("/create") | ||
| 42 | - @ApiOperation("创建粉丝标签关联") | ||
| 43 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:create')") | ||
| 44 | - public CommonResult<Integer> createWxAccountFansTag(@Valid @RequestBody WxAccountFansTagCreateReqVO createReqVO) { | ||
| 45 | - return success(wxAccountFansTagService.createWxAccountFansTag(createReqVO)); | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - @PutMapping("/update") | ||
| 49 | - @ApiOperation("更新粉丝标签关联") | ||
| 50 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:update')") | ||
| 51 | - public CommonResult<Boolean> updateWxAccountFansTag(@Valid @RequestBody WxAccountFansTagUpdateReqVO updateReqVO) { | ||
| 52 | - wxAccountFansTagService.updateWxAccountFansTag(updateReqVO); | ||
| 53 | - return success(true); | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - @DeleteMapping("/delete") | ||
| 57 | - @ApiOperation("删除粉丝标签关联") | ||
| 58 | - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class) | ||
| 59 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:delete')") | ||
| 60 | - public CommonResult<Boolean> deleteWxAccountFansTag(@RequestParam("id") Integer id) { | ||
| 61 | - wxAccountFansTagService.deleteWxAccountFansTag(id); | ||
| 62 | - return success(true); | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - @GetMapping("/get") | ||
| 66 | - @ApiOperation("获得粉丝标签关联") | ||
| 67 | - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class) | ||
| 68 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')") | ||
| 69 | - public CommonResult<WxAccountFansTagRespVO> getWxAccountFansTag(@RequestParam("id") Integer id) { | ||
| 70 | - WxAccountFansTagDO wxAccountFansTag = wxAccountFansTagService.getWxAccountFansTag(id); | ||
| 71 | - return success(WxAccountFansTagConvert.INSTANCE.convert(wxAccountFansTag)); | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - @GetMapping("/list") | ||
| 75 | - @ApiOperation("获得粉丝标签关联列表") | ||
| 76 | - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) | ||
| 77 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')") | ||
| 78 | - public CommonResult<List<WxAccountFansTagRespVO>> getWxAccountFansTagList(@RequestParam("ids") Collection<Integer> ids) { | ||
| 79 | - List<WxAccountFansTagDO> list = wxAccountFansTagService.getWxAccountFansTagList(ids); | ||
| 80 | - return success(WxAccountFansTagConvert.INSTANCE.convertList(list)); | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - @GetMapping("/page") | ||
| 84 | - @ApiOperation("获得粉丝标签关联分页") | ||
| 85 | - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')") | ||
| 86 | - public CommonResult<PageResult<WxAccountFansTagRespVO>> getWxAccountFansTagPage(@Valid WxAccountFansTagPageReqVO pageVO) { | ||
| 87 | - PageResult<WxAccountFansTagDO> pageResult = wxAccountFansTagService.getWxAccountFansTagPage(pageVO); | ||
| 88 | - return success(WxAccountFansTagConvert.INSTANCE.convertPage(pageResult)); | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagBaseVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 粉丝标签关联 Base VO,提供给添加、修改、详细的子 VO 使用 | ||
| 8 | - * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||
| 9 | - */ | ||
| 10 | -@Data | ||
| 11 | -public class WxAccountFansTagBaseVO { | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "用户标识") | ||
| 14 | - private String openid; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "标签ID") | ||
| 17 | - private String tagId; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "微信账号ID") | ||
| 20 | - private String wxAccountId; | ||
| 21 | - | ||
| 22 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * 粉丝标签关联 Excel VO | ||
| 11 | - * | ||
| 12 | - * @author 芋道源码 | ||
| 13 | - */ | ||
| 14 | -@Data | ||
| 15 | -public class WxAccountFansTagExcelVO { | ||
| 16 | - | ||
| 17 | - @ExcelProperty("主键") | ||
| 18 | - private Integer id; | ||
| 19 | - | ||
| 20 | - @ExcelProperty("用户标识") | ||
| 21 | - private String openid; | ||
| 22 | - | ||
| 23 | - @ExcelProperty("标签ID") | ||
| 24 | - private String tagId; | ||
| 25 | - | ||
| 26 | - @ExcelProperty("微信账号ID") | ||
| 27 | - private String wxAccountId; | ||
| 28 | - | ||
| 29 | - @ExcelProperty("创建时间") | ||
| 30 | - private Date createTime; | ||
| 31 | - | ||
| 32 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagExportReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | - | ||
| 10 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 11 | - | ||
| 12 | -@ApiModel(value = "管理后台 - 粉丝标签关联 Excel 导出 Request VO", description = "参数和 WxAccountFansTagPageReqVO 是一致的") | ||
| 13 | -@Data | ||
| 14 | -public class WxAccountFansTagExportReqVO { | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "用户标识") | ||
| 17 | - private String openid; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "标签ID") | ||
| 20 | - private String tagId; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "微信账号ID") | ||
| 23 | - private String wxAccountId; | ||
| 24 | - | ||
| 25 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 26 | - @ApiModelProperty(value = "开始创建时间") | ||
| 27 | - private Date beginCreateTime; | ||
| 28 | - | ||
| 29 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 30 | - @ApiModelProperty(value = "结束创建时间") | ||
| 31 | - private Date endCreateTime; | ||
| 32 | - | ||
| 33 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagPageReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 9 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 10 | - | ||
| 11 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 12 | - | ||
| 13 | -@ApiModel("管理后台 - 粉丝标签关联分页 Request VO") | ||
| 14 | -@Data | ||
| 15 | -@EqualsAndHashCode(callSuper = true) | ||
| 16 | -@ToString(callSuper = true) | ||
| 17 | -public class WxAccountFansTagPageReqVO extends PageParam { | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "用户标识") | ||
| 20 | - private String openid; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "标签ID") | ||
| 23 | - private String tagId; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "微信账号ID") | ||
| 26 | - private String wxAccountId; | ||
| 27 | - | ||
| 28 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 29 | - @ApiModelProperty(value = "开始创建时间") | ||
| 30 | - private Date beginCreateTime; | ||
| 31 | - | ||
| 32 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 33 | - @ApiModelProperty(value = "结束创建时间") | ||
| 34 | - private Date endCreateTime; | ||
| 35 | - | ||
| 36 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagRespVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | - | ||
| 9 | -@ApiModel("管理后台 - 粉丝标签关联 Response VO") | ||
| 10 | -@Data | ||
| 11 | -@EqualsAndHashCode(callSuper = true) | ||
| 12 | -@ToString(callSuper = true) | ||
| 13 | -public class WxAccountFansTagRespVO extends WxAccountFansTagBaseVO { | ||
| 14 | - | ||
| 15 | - @ApiModelProperty(value = "主键", required = true) | ||
| 16 | - private Integer id; | ||
| 17 | - | ||
| 18 | - @ApiModelProperty(value = "创建时间", required = true) | ||
| 19 | - private Date createTime; | ||
| 20 | - | ||
| 21 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagUpdateReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | - | ||
| 6 | -import javax.validation.constraints.*; | ||
| 7 | - | ||
| 8 | -@ApiModel("管理后台 - 粉丝标签关联更新 Request VO") | ||
| 9 | -@Data | ||
| 10 | -@EqualsAndHashCode(callSuper = true) | ||
| 11 | -@ToString(callSuper = true) | ||
| 12 | -public class WxAccountFansTagUpdateReqVO extends WxAccountFansTagBaseVO { | ||
| 13 | - | ||
| 14 | - @ApiModelProperty(value = "主键", required = true) | ||
| 15 | - @NotNull(message = "主键不能为空") | ||
| 16 | - private Integer id; | ||
| 17 | - | ||
| 18 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/FansTagController.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fanstag; | ||
| 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.ApiOperation; | ||
| 12 | -import me.chanjar.weixin.common.error.WxErrorException; | ||
| 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 | -import org.springframework.web.bind.annotation.*; | ||
| 17 | - | ||
| 18 | -import javax.annotation.Resource; | ||
| 19 | -import javax.servlet.http.HttpServletResponse; | ||
| 20 | -import javax.validation.Valid; | ||
| 21 | -import javax.validation.constraints.NotEmpty; | ||
| 22 | -import java.io.IOException; | ||
| 23 | -import java.util.List; | ||
| 24 | - | ||
| 25 | -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 26 | -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * @author fengdan | ||
| 30 | - */ | ||
| 31 | -@Api(tags = "管理后台 - 粉丝标签") | ||
| 32 | -@RestController | ||
| 33 | -@RequestMapping("/wechatMp/fans-tag") | ||
| 34 | -@Validated | ||
| 35 | -public class FansTagController { | ||
| 36 | - | ||
| 37 | - @Resource | ||
| 38 | - private FansTagService fansTagService; | ||
| 39 | - | ||
| 40 | - @PostMapping("/create") | ||
| 41 | - @ApiOperation("创建粉丝标签") | ||
| 42 | - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:create')") | ||
| 43 | - public CommonResult<WxUserTag> createWxFansTag(@Valid @RequestBody FansTagCreateReqVO createReqVO) throws WxErrorException { | ||
| 44 | - return success(fansTagService.createWxFansTag(createReqVO)); | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - @PutMapping("/update") | ||
| 48 | - @ApiOperation("更新粉丝标签") | ||
| 49 | - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:update')") | ||
| 50 | - public CommonResult<Boolean> updateWxFansTag(@Valid @RequestBody FansTagUpdateReqVO updateReqVO) throws WxErrorException { | ||
| 51 | - return success(fansTagService.updateWxFansTag(updateReqVO)); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - @DeleteMapping("/delete") | ||
| 55 | - @ApiOperation("删除粉丝标签") | ||
| 56 | - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:delete')") | ||
| 57 | - public CommonResult<Boolean> deleteWxFansTag(@RequestParam("id") Long id, | ||
| 58 | - @RequestParam("appId") String appId) throws WxErrorException { | ||
| 59 | - return success(fansTagService.deleteWxFansTag(id, appId)); | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | - @GetMapping("/list") | ||
| 63 | - @ApiOperation("获取公众号已创建的标签") | ||
| 64 | - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:query')") | ||
| 65 | - public CommonResult<List<FansTagRespVO>> getWxFansTagList(@NotEmpty(message = "公众号appId不能为空") | ||
| 66 | - @RequestParam("appId") String appId) throws WxErrorException { | ||
| 67 | - List<WxUserTag> list = fansTagService.getWxFansTagList(appId); | ||
| 68 | - return success(WxFansTagConvert.INSTANCE.convertList(list)); | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | - @GetMapping("/page") | ||
| 72 | - @ApiOperation("获取公众号已创建的标签") | ||
| 73 | - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:query')") | ||
| 74 | - public CommonResult<PageResult<FansTagRespVO>> page() throws WxErrorException { | ||
| 75 | - PageResult<WxUserTag> page = new PageResult<>(); | ||
| 76 | - return success(WxFansTagConvert.INSTANCE.convertPage(page)); | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - @GetMapping("/tagListUser") | ||
| 80 | - @ApiOperation("获取标签下粉丝列表") | ||
| 81 | - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:query')") | ||
| 82 | - public CommonResult<String> tagListUser(@Valid FansTagPageReqVO pageVO) { | ||
| 83 | - return success(""); | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - @GetMapping("/export-excel") | ||
| 87 | - @ApiOperation("导出粉丝标签 Excel") | ||
| 88 | - @PreAuthorize("@ss.hasPermission('wechatMp:fans-tag:export')") | ||
| 89 | - @OperateLog(type = EXPORT) | ||
| 90 | - public void exportWxFansTagExcel(@Valid FansTagExportReqVO exportReqVO, | ||
| 91 | - HttpServletResponse response) throws IOException { | ||
| 92 | - List<WxUserTag> list = fansTagService.getWxFansTagList(exportReqVO); | ||
| 93 | - // 导出 Excel | ||
| 94 | - List<FansTagExcelVO> datas = WxFansTagConvert.INSTANCE.convertList02(list); | ||
| 95 | - ExcelUtils.write(response, "粉丝标签.xls", "数据", FansTagExcelVO.class, datas); | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * 粉丝标签 Excel VO | ||
| 11 | - * | ||
| 12 | - * @author 芋道源码 | ||
| 13 | - */ | ||
| 14 | -@Data | ||
| 15 | -public class FansTagExcelVO { | ||
| 16 | - | ||
| 17 | - @ExcelProperty("主键") | ||
| 18 | - private Integer id; | ||
| 19 | - | ||
| 20 | - @ExcelProperty("标签名称") | ||
| 21 | - private String name; | ||
| 22 | - | ||
| 23 | - @ExcelProperty("粉丝数量") | ||
| 24 | - private Integer count; | ||
| 25 | - | ||
| 26 | - @ExcelProperty("创建时间") | ||
| 27 | - private Date createTime; | ||
| 28 | - | ||
| 29 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagExportReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | - | ||
| 10 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 11 | - | ||
| 12 | -@ApiModel(value = "管理后台 - 粉丝标签 Excel 导出 Request VO", description = "参数和 WxFansTagPageReqVO 是一致的") | ||
| 13 | -@Data | ||
| 14 | -public class FansTagExportReqVO { | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "标签名称") | ||
| 17 | - private String name; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "粉丝数量") | ||
| 20 | - private Integer count; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "微信账号ID") | ||
| 23 | - private String wxAccountId; | ||
| 24 | - | ||
| 25 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 26 | - @ApiModelProperty(value = "开始创建时间") | ||
| 27 | - private Date beginCreateTime; | ||
| 28 | - | ||
| 29 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 30 | - @ApiModelProperty(value = "结束创建时间") | ||
| 31 | - private Date endCreateTime; | ||
| 32 | - | ||
| 33 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagRespVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | - | ||
| 5 | -import java.util.*; | ||
| 6 | - | ||
| 7 | -import io.swagger.annotations.*; | ||
| 8 | - | ||
| 9 | -@ApiModel("管理后台 - 粉丝标签 Response VO") | ||
| 10 | -@Data | ||
| 11 | -@EqualsAndHashCode(callSuper = true) | ||
| 12 | -@ToString(callSuper = true) | ||
| 13 | -public class FansTagRespVO extends FansTagBaseVO { | ||
| 14 | - | ||
| 15 | - @ApiModelProperty(value = "标签id,由微信分配.") | ||
| 16 | - private Long id; | ||
| 17 | - | ||
| 18 | - @ApiModelProperty(value = "创建时间", required = true) | ||
| 19 | - private Date createTime; | ||
| 20 | - | ||
| 21 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagUpdateReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import io.swagger.annotations.*; | ||
| 5 | - | ||
| 6 | -import javax.validation.constraints.*; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * @author fengdan | ||
| 10 | - */ | ||
| 11 | -@ApiModel("管理后台 - 粉丝标签更新 Request VO") | ||
| 12 | -@Data | ||
| 13 | -@EqualsAndHashCode(callSuper = true) | ||
| 14 | -@ToString(callSuper = true) | ||
| 15 | -public class FansTagUpdateReqVO extends FansTagBaseVO { | ||
| 16 | - | ||
| 17 | - @ApiModelProperty(value = "标签id,由微信分配", required = true) | ||
| 18 | - @NotNull(message = "主键不能为空") | ||
| 19 | - private Long id; | ||
| 20 | - | ||
| 21 | - @NotBlank(message = "公众号appId不能为空") | ||
| 22 | - @ApiModelProperty("微信公众号appId") | ||
| 23 | - private String appId; | ||
| 24 | - | ||
| 25 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.controller.admin.tag; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 5 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagRespVO; | ||
| 8 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO; | ||
| 9 | +import cn.iocoder.yudao.module.mp.convert.tag.MpTagConvert; | ||
| 10 | +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; | ||
| 11 | +import cn.iocoder.yudao.module.mp.service.tag.MpTagService; | ||
| 12 | +import io.swagger.annotations.Api; | ||
| 13 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 14 | +import io.swagger.annotations.ApiOperation; | ||
| 15 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 16 | +import org.springframework.validation.annotation.Validated; | ||
| 17 | +import org.springframework.web.bind.annotation.*; | ||
| 18 | + | ||
| 19 | +import javax.annotation.Resource; | ||
| 20 | +import javax.validation.Valid; | ||
| 21 | + | ||
| 22 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 23 | + | ||
| 24 | +@Api(tags = "管理后台 - 公众号标签") | ||
| 25 | +@RestController | ||
| 26 | +@RequestMapping("/mp/tag") | ||
| 27 | +@Validated | ||
| 28 | +public class MpTagController { | ||
| 29 | + | ||
| 30 | + @Resource | ||
| 31 | + private MpTagService mpTagService; | ||
| 32 | + | ||
| 33 | + @PostMapping("/create") | ||
| 34 | + @ApiOperation("创建公众号标签") | ||
| 35 | + @PreAuthorize("@ss.hasPermission('mp:tag:create')") | ||
| 36 | + public CommonResult<Long> createTag(@Valid @RequestBody MpTagCreateReqVO createReqVO) { | ||
| 37 | + return success(mpTagService.createTag(createReqVO)); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @PutMapping("/update") | ||
| 41 | + @ApiOperation("更新公众号标签") | ||
| 42 | + @PreAuthorize("@ss.hasPermission('mp:tag:update')") | ||
| 43 | + public CommonResult<Boolean> updateTag(@Valid @RequestBody MpTagUpdateReqVO updateReqVO) { | ||
| 44 | + mpTagService.updateTag(updateReqVO); | ||
| 45 | + return success(true); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + @DeleteMapping("/delete") | ||
| 49 | + @ApiOperation("删除公众号标签") | ||
| 50 | + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | ||
| 51 | + @PreAuthorize("@ss.hasPermission('mp:tag:delete')") | ||
| 52 | + public CommonResult<Boolean> deleteTag(@RequestParam("id") Long id) { | ||
| 53 | + mpTagService.deleteTag(id); | ||
| 54 | + return success(true); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @GetMapping("/page") | ||
| 58 | + @ApiOperation("获取公众号标签分页") | ||
| 59 | + @PreAuthorize("@ss.hasPermission('mp:tag:query')") | ||
| 60 | + public CommonResult<PageResult<MpTagRespVO>> getTagPage(MpTagPageReqVO pageReqVO) { | ||
| 61 | + PageResult<MpTagDO> pageResult = mpTagService.getTagPage(pageReqVO); | ||
| 62 | + return success(MpTagConvert.INSTANCE.convertPage(pageResult)); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagBaseVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; | 1 | +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModelProperty; | 3 | import io.swagger.annotations.ApiModelProperty; |
| 4 | import lombok.Data; | 4 | import lombok.Data; |
| 5 | 5 | ||
| 6 | -import javax.validation.constraints.NotBlank; | 6 | +import javax.validation.constraints.NotEmpty; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | - * 粉丝标签 Base VO,提供给添加、修改、详细的子 VO 使用 | 9 | + * 公众号标签 Base VO,提供给添加、修改、详细的子 VO 使用 |
| 10 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | 10 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 11 | * | 11 | * |
| 12 | * @author fengdan | 12 | * @author fengdan |
| 13 | */ | 13 | */ |
| 14 | @Data | 14 | @Data |
| 15 | -public class FansTagBaseVO { | 15 | +public class MpTagBaseVO { |
| 16 | 16 | ||
| 17 | - @NotBlank(message = "标签名不能为空") | ||
| 18 | - @ApiModelProperty(value = "标签名,UTF8编码") | 17 | + @ApiModelProperty(value = "标签名", required = true, example = "土豆") |
| 18 | + @NotEmpty(message = "标签名不能为空") | ||
| 19 | private String name; | 19 | private String name; |
| 20 | + | ||
| 20 | } | 21 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagCreateReqVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; | 1 | +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| @@ -6,17 +6,16 @@ import lombok.Data; | @@ -6,17 +6,16 @@ import lombok.Data; | ||
| 6 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 7 | import lombok.ToString; |
| 8 | 8 | ||
| 9 | -import javax.validation.constraints.NotBlank; | 9 | +import javax.validation.constraints.NotNull; |
| 10 | 10 | ||
| 11 | -/** | ||
| 12 | - * @author fengdan | ||
| 13 | - */ | ||
| 14 | -@ApiModel("管理后台 - 粉丝标签创建 Request VO") | 11 | +@ApiModel("管理后台 - 公众号标签创建 Request VO") |
| 15 | @Data | 12 | @Data |
| 16 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| 17 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 18 | -public class FansTagCreateReqVO extends FansTagBaseVO { | ||
| 19 | - @NotBlank(message = "公众号appId不能为空") | ||
| 20 | - @ApiModelProperty("微信公众号appId") | ||
| 21 | - private String appId; | 15 | +public class MpTagCreateReqVO extends MpTagBaseVO { |
| 16 | + | ||
| 17 | + @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") | ||
| 18 | + @NotNull(message = "公众号账号的编号不能为空") | ||
| 19 | + private Long accountId; | ||
| 20 | + | ||
| 22 | } | 21 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/fanstag/vo/FansTagPageReqVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo; | 1 | +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| @@ -9,17 +9,17 @@ import lombok.ToString; | @@ -9,17 +9,17 @@ import lombok.ToString; | ||
| 9 | 9 | ||
| 10 | import javax.validation.constraints.NotEmpty; | 10 | import javax.validation.constraints.NotEmpty; |
| 11 | 11 | ||
| 12 | -/** | ||
| 13 | - * @author fengdan | ||
| 14 | - */ | ||
| 15 | -@ApiModel("管理后台 - 粉丝标签分页 Request VO") | 12 | +@ApiModel("管理后台 - 公众号标签分页 Request VO") |
| 16 | @Data | 13 | @Data |
| 17 | @EqualsAndHashCode(callSuper = true) | 14 | @EqualsAndHashCode(callSuper = true) |
| 18 | @ToString(callSuper = true) | 15 | @ToString(callSuper = true) |
| 19 | -public class FansTagPageReqVO extends PageParam { | 16 | +public class MpTagPageReqVO extends PageParam { |
| 20 | 17 | ||
| 21 | - @NotEmpty(message = "公众号appId不能为空") | ||
| 22 | - @ApiModelProperty("微信公众号appId") | ||
| 23 | - private String appId; | 18 | + @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") |
| 19 | + @NotEmpty(message = "公众号账号的编号不能为空") | ||
| 20 | + private Long accountId; | ||
| 21 | + | ||
| 22 | + @ApiModelProperty(value = "标签名", example = "哈哈", notes = "模糊匹配") | ||
| 23 | + private String name; | ||
| 24 | 24 | ||
| 25 | } | 25 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.ToString; | ||
| 8 | + | ||
| 9 | +import javax.validation.constraints.NotNull; | ||
| 10 | +import java.util.Date; | ||
| 11 | + | ||
| 12 | +@ApiModel("管理后台 - 公众号标签 Response VO") | ||
| 13 | +@Data | ||
| 14 | +@EqualsAndHashCode(callSuper = true) | ||
| 15 | +@ToString(callSuper = true) | ||
| 16 | +public class MpTagRespVO extends MpTagBaseVO { | ||
| 17 | + | ||
| 18 | + @ApiModelProperty(value = "编号", required = true) | ||
| 19 | + @NotNull(message = "编号不能为空") | ||
| 20 | + private Long id; | ||
| 21 | + | ||
| 22 | + @ApiModelProperty(value = "创建时间", required = true) | ||
| 23 | + private Date createTime; | ||
| 24 | + | ||
| 25 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/vo/WxAccountFansTagCreateReqVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo; | 1 | +package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| 5 | 5 | ||
| 6 | -@ApiModel("管理后台 - 粉丝标签关联创建 Request VO") | 6 | +import javax.validation.constraints.*; |
| 7 | + | ||
| 8 | +@ApiModel("管理后台 - 公众号标签更新 Request VO") | ||
| 7 | @Data | 9 | @Data |
| 8 | @EqualsAndHashCode(callSuper = true) | 10 | @EqualsAndHashCode(callSuper = true) |
| 9 | @ToString(callSuper = true) | 11 | @ToString(callSuper = true) |
| 10 | -public class WxAccountFansTagCreateReqVO extends WxAccountFansTagBaseVO { | 12 | +public class MpTagUpdateReqVO extends MpTagBaseVO { |
| 13 | + | ||
| 14 | + @ApiModelProperty(value = "编号", required = true) | ||
| 15 | + @NotNull(message = "编号不能为空") | ||
| 16 | + private Long id; | ||
| 11 | 17 | ||
| 12 | } | 18 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/accountfanstag/WxAccountFansTagConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.convert.accountfanstag; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | - | ||
| 7 | -import org.mapstruct.Mapper; | ||
| 8 | -import org.mapstruct.factory.Mappers; | ||
| 9 | -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; | ||
| 10 | -import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 粉丝标签关联 Convert | ||
| 14 | - * | ||
| 15 | - * @author 芋道源码 | ||
| 16 | - */ | ||
| 17 | -@Mapper | ||
| 18 | -public interface WxAccountFansTagConvert { | ||
| 19 | - | ||
| 20 | - WxAccountFansTagConvert INSTANCE = Mappers.getMapper(WxAccountFansTagConvert.class); | ||
| 21 | - | ||
| 22 | - WxAccountFansTagDO convert(WxAccountFansTagCreateReqVO bean); | ||
| 23 | - | ||
| 24 | - WxAccountFansTagDO convert(WxAccountFansTagUpdateReqVO bean); | ||
| 25 | - | ||
| 26 | - WxAccountFansTagRespVO convert(WxAccountFansTagDO bean); | ||
| 27 | - | ||
| 28 | - List<WxAccountFansTagRespVO> convertList(List<WxAccountFansTagDO> list); | ||
| 29 | - | ||
| 30 | - PageResult<WxAccountFansTagRespVO> convertPage(PageResult<WxAccountFansTagDO> page); | ||
| 31 | - | ||
| 32 | - List<WxAccountFansTagExcelVO> convertList02(List<WxAccountFansTagDO> list); | ||
| 33 | - | ||
| 34 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/fanstag/WxFansTagConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.convert.fanstag; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | - | ||
| 7 | -import me.chanjar.weixin.mp.bean.tag.WxUserTag; | ||
| 8 | -import org.mapstruct.Mapper; | ||
| 9 | -import org.mapstruct.factory.Mappers; | ||
| 10 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 粉丝标签 Convert | ||
| 14 | - * | ||
| 15 | - * @author fengdan | ||
| 16 | - */ | ||
| 17 | -@Mapper | ||
| 18 | -public interface WxFansTagConvert { | ||
| 19 | - | ||
| 20 | - WxFansTagConvert INSTANCE = Mappers.getMapper(WxFansTagConvert.class); | ||
| 21 | - | ||
| 22 | - WxUserTag convert(FansTagCreateReqVO bean); | ||
| 23 | - | ||
| 24 | - WxUserTag convert(FansTagUpdateReqVO bean); | ||
| 25 | - | ||
| 26 | - FansTagRespVO convert(WxUserTag bean); | ||
| 27 | - | ||
| 28 | - List<FansTagRespVO> convertList(List<WxUserTag> list); | ||
| 29 | - | ||
| 30 | - PageResult<FansTagRespVO> convertPage(PageResult<WxUserTag> page); | ||
| 31 | - | ||
| 32 | - List<FansTagExcelVO> convertList02(List<WxUserTag> list); | ||
| 33 | - | ||
| 34 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.convert.tag; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagCreateReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagRespVO; | ||
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; | ||
| 8 | +import me.chanjar.weixin.mp.bean.tag.WxUserTag; | ||
| 9 | +import org.mapstruct.Mapper; | ||
| 10 | +import org.mapstruct.factory.Mappers; | ||
| 11 | + | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +@Mapper | ||
| 15 | +public interface MpTagConvert { | ||
| 16 | + | ||
| 17 | + MpTagConvert INSTANCE = Mappers.getMapper(MpTagConvert.class); | ||
| 18 | + | ||
| 19 | + WxUserTag convert(MpTagCreateReqVO bean); | ||
| 20 | + | ||
| 21 | + WxUserTag convert(MpTagUpdateReqVO bean); | ||
| 22 | + | ||
| 23 | + MpTagRespVO convert(WxUserTag bean); | ||
| 24 | + | ||
| 25 | + List<MpTagRespVO> convertList(List<WxUserTag> list); | ||
| 26 | + | ||
| 27 | + PageResult<MpTagRespVO> convertPage(PageResult<MpTagDO> page); | ||
| 28 | + | ||
| 29 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/accountfanstag/WxAccountFansTagDO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag; | ||
| 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_account_fans_tag") | ||
| 16 | -@KeySequence("wx_account_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 WxAccountFansTagDO extends BaseDO { | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 主键 | ||
| 27 | - */ | ||
| 28 | - @TableId | ||
| 29 | - private Integer id; | ||
| 30 | - /** | ||
| 31 | - * 用户标识 | ||
| 32 | - */ | ||
| 33 | - private String openid; | ||
| 34 | - /** | ||
| 35 | - * 标签ID | ||
| 36 | - */ | ||
| 37 | - private String tagId; | ||
| 38 | - /** | ||
| 39 | - * 微信账号ID | ||
| 40 | - */ | ||
| 41 | - private String wxAccountId; | ||
| 42 | - | ||
| 43 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/tag/MpTagDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.dal.dataobject.tag; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | ||
| 4 | +import lombok.*; | ||
| 5 | + | ||
| 6 | +import com.baomidou.mybatisplus.annotation.*; | ||
| 7 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 公众号标签 DO | ||
| 11 | + * | ||
| 12 | + * @author 芋道源码 | ||
| 13 | + */ | ||
| 14 | +@TableName("mp_tag") | ||
| 15 | +@KeySequence("mp_tag_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||
| 16 | +@Data | ||
| 17 | +@EqualsAndHashCode(callSuper = true) | ||
| 18 | +@ToString(callSuper = true) | ||
| 19 | +public class MpTagDO extends BaseDO { | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * 主键 | ||
| 23 | + */ | ||
| 24 | + @TableId(type = IdType.INPUT) | ||
| 25 | + private Long id; | ||
| 26 | + /** | ||
| 27 | + * 公众号标签 id | ||
| 28 | + */ | ||
| 29 | + private Long tagId; | ||
| 30 | + /** | ||
| 31 | + * 标签名 | ||
| 32 | + */ | ||
| 33 | + private String name; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 微信公众号 ID | ||
| 37 | + * | ||
| 38 | + * 关联 {@link MpAccountDO#getId()} | ||
| 39 | + */ | ||
| 40 | + private Long accountId; | ||
| 41 | + /** | ||
| 42 | + * 微信公众号 appid | ||
| 43 | + * | ||
| 44 | + * 冗余 {@link MpAccountDO#getAppId()} | ||
| 45 | + */ | ||
| 46 | + private String appId; | ||
| 47 | + | ||
| 48 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/accountfanstag/WxAccountFansTagMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.dal.mysql.accountfanstag; | ||
| 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.accountfanstag.WxAccountFansTagDO; | ||
| 9 | -import org.apache.ibatis.annotations.Mapper; | ||
| 10 | -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 粉丝标签关联 Mapper | ||
| 14 | - * | ||
| 15 | - * @author 芋道源码 | ||
| 16 | - */ | ||
| 17 | -@Mapper | ||
| 18 | -public interface WxAccountFansTagMapper extends BaseMapperX<WxAccountFansTagDO> { | ||
| 19 | - | ||
| 20 | - default PageResult<WxAccountFansTagDO> selectPage(WxAccountFansTagPageReqVO reqVO) { | ||
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<WxAccountFansTagDO>() | ||
| 22 | - .eqIfPresent(WxAccountFansTagDO::getOpenid, reqVO.getOpenid()) | ||
| 23 | - .eqIfPresent(WxAccountFansTagDO::getTagId, reqVO.getTagId()) | ||
| 24 | - .eqIfPresent(WxAccountFansTagDO::getWxAccountId, reqVO.getWxAccountId()) | ||
| 25 | - .betweenIfPresent(WxAccountFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 26 | - .orderByDesc(WxAccountFansTagDO::getId)); | ||
| 27 | - } | ||
| 28 | - | ||
| 29 | - default List<WxAccountFansTagDO> selectList(WxAccountFansTagExportReqVO reqVO) { | ||
| 30 | - return selectList(new LambdaQueryWrapperX<WxAccountFansTagDO>() | ||
| 31 | - .eqIfPresent(WxAccountFansTagDO::getOpenid, reqVO.getOpenid()) | ||
| 32 | - .eqIfPresent(WxAccountFansTagDO::getTagId, reqVO.getTagId()) | ||
| 33 | - .eqIfPresent(WxAccountFansTagDO::getWxAccountId, reqVO.getWxAccountId()) | ||
| 34 | - .betweenIfPresent(WxAccountFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 35 | - .orderByDesc(WxAccountFansTagDO::getId)); | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/tag/MpTagMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.dal.mysql.tag; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; | ||
| 8 | +import org.apache.ibatis.annotations.Mapper; | ||
| 9 | + | ||
| 10 | +@Mapper | ||
| 11 | +public interface MpTagMapper extends BaseMapperX<MpTagDO> { | ||
| 12 | + | ||
| 13 | + default PageResult<MpTagDO> selectPage(MpTagPageReqVO reqVO) { | ||
| 14 | + return selectPage(reqVO, new LambdaQueryWrapperX<MpTagDO>() | ||
| 15 | + .eqIfPresent(MpTagDO::getAccountId, reqVO.getAccountId()) | ||
| 16 | + .likeIfPresent(MpTagDO::getName, reqVO.getName()) | ||
| 17 | + .orderByDesc(MpTagDO::getId)); | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagService.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.service.accountfanstag; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | -import javax.validation.*; | ||
| 5 | - | ||
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; | ||
| 7 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | ||
| 8 | -import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; | ||
| 9 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 10 | -import me.chanjar.weixin.mp.bean.result.WxMpUser; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 粉丝标签关联 Service 接口 | ||
| 14 | - * | ||
| 15 | - * @author 芋道源码 | ||
| 16 | - */ | ||
| 17 | -public interface WxAccountFansTagService { | ||
| 18 | - | ||
| 19 | - /** | ||
| 20 | - * 创建粉丝标签关联 | ||
| 21 | - * | ||
| 22 | - * @param createReqVO 创建信息 | ||
| 23 | - * @return 编号 | ||
| 24 | - */ | ||
| 25 | - Integer createWxAccountFansTag(@Valid WxAccountFansTagCreateReqVO createReqVO); | ||
| 26 | - | ||
| 27 | - /** | ||
| 28 | - * 更新粉丝标签关联 | ||
| 29 | - * | ||
| 30 | - * @param updateReqVO 更新信息 | ||
| 31 | - */ | ||
| 32 | - void updateWxAccountFansTag(@Valid WxAccountFansTagUpdateReqVO updateReqVO); | ||
| 33 | - | ||
| 34 | - /** | ||
| 35 | - * 删除粉丝标签关联 | ||
| 36 | - * | ||
| 37 | - * @param id 编号 | ||
| 38 | - */ | ||
| 39 | - void deleteWxAccountFansTag(Integer id); | ||
| 40 | - | ||
| 41 | - /** | ||
| 42 | - * 获得粉丝标签关联 | ||
| 43 | - * | ||
| 44 | - * @param id 编号 | ||
| 45 | - * @return 粉丝标签关联 | ||
| 46 | - */ | ||
| 47 | - WxAccountFansTagDO getWxAccountFansTag(Integer id); | ||
| 48 | - | ||
| 49 | - /** | ||
| 50 | - * 获得粉丝标签关联列表 | ||
| 51 | - * | ||
| 52 | - * @param ids 编号 | ||
| 53 | - * @return 粉丝标签关联列表 | ||
| 54 | - */ | ||
| 55 | - List<WxAccountFansTagDO> getWxAccountFansTagList(Collection<Integer> ids); | ||
| 56 | - | ||
| 57 | - /** | ||
| 58 | - * 获得粉丝标签关联分页 | ||
| 59 | - * | ||
| 60 | - * @param pageReqVO 分页查询 | ||
| 61 | - * @return 粉丝标签关联分页 | ||
| 62 | - */ | ||
| 63 | - PageResult<WxAccountFansTagDO> getWxAccountFansTagPage(WxAccountFansTagPageReqVO pageReqVO); | ||
| 64 | - | ||
| 65 | - /** | ||
| 66 | - * 获得粉丝标签关联列表, 用于 Excel 导出 | ||
| 67 | - * | ||
| 68 | - * @param exportReqVO 查询条件 | ||
| 69 | - * @return 粉丝标签关联列表 | ||
| 70 | - */ | ||
| 71 | - List<WxAccountFansTagDO> getWxAccountFansTagList(WxAccountFansTagExportReqVO exportReqVO); | ||
| 72 | - | ||
| 73 | - void processFansTags(MpAccountDO wxAccount, WxMpUser wxmpUser); | ||
| 74 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.service.accountfanstag; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | ||
| 4 | -import me.chanjar.weixin.mp.bean.result.WxMpUser; | ||
| 5 | -import org.springframework.stereotype.Service; | ||
| 6 | - | ||
| 7 | -import javax.annotation.Resource; | ||
| 8 | - | ||
| 9 | -import org.springframework.validation.annotation.Validated; | ||
| 10 | - | ||
| 11 | -import java.util.*; | ||
| 12 | - | ||
| 13 | -import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; | ||
| 14 | -import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; | ||
| 15 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 16 | - | ||
| 17 | -import cn.iocoder.yudao.module.mp.convert.accountfanstag.WxAccountFansTagConvert; | ||
| 18 | -import cn.iocoder.yudao.module.mp.dal.mysql.accountfanstag.WxAccountFansTagMapper; | ||
| 19 | - | ||
| 20 | -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 21 | -import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; | ||
| 22 | - | ||
| 23 | -/** | ||
| 24 | - * 粉丝标签关联 Service 实现类 | ||
| 25 | - * | ||
| 26 | - * @author 芋道源码 | ||
| 27 | - */ | ||
| 28 | -@Service | ||
| 29 | -@Validated | ||
| 30 | -public class WxAccountFansTagServiceImpl implements WxAccountFansTagService { | ||
| 31 | - | ||
| 32 | - @Resource | ||
| 33 | - private WxAccountFansTagMapper wxAccountFansTagMapper; | ||
| 34 | - | ||
| 35 | - @Override | ||
| 36 | - public Integer createWxAccountFansTag(WxAccountFansTagCreateReqVO createReqVO) { | ||
| 37 | - // 插入 | ||
| 38 | - WxAccountFansTagDO wxAccountFansTag = WxAccountFansTagConvert.INSTANCE.convert(createReqVO); | ||
| 39 | - wxAccountFansTagMapper.insert(wxAccountFansTag); | ||
| 40 | - // 返回 | ||
| 41 | - return wxAccountFansTag.getId(); | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - @Override | ||
| 45 | - public void updateWxAccountFansTag(WxAccountFansTagUpdateReqVO updateReqVO) { | ||
| 46 | - // 校验存在 | ||
| 47 | - this.validateWxAccountFansTagExists(updateReqVO.getId()); | ||
| 48 | - // 更新 | ||
| 49 | - WxAccountFansTagDO updateObj = WxAccountFansTagConvert.INSTANCE.convert(updateReqVO); | ||
| 50 | - wxAccountFansTagMapper.updateById(updateObj); | ||
| 51 | - } | ||
| 52 | - | ||
| 53 | - @Override | ||
| 54 | - public void deleteWxAccountFansTag(Integer id) { | ||
| 55 | - // 校验存在 | ||
| 56 | - this.validateWxAccountFansTagExists(id); | ||
| 57 | - // 删除 | ||
| 58 | - wxAccountFansTagMapper.deleteById(id); | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - private void validateWxAccountFansTagExists(Integer id) { | ||
| 62 | - if (wxAccountFansTagMapper.selectById(id) == null) { | ||
| 63 | - throw exception(COMMON_NOT_EXISTS); | ||
| 64 | - } | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - @Override | ||
| 68 | - public WxAccountFansTagDO getWxAccountFansTag(Integer id) { | ||
| 69 | - return wxAccountFansTagMapper.selectById(id); | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - @Override | ||
| 73 | - public List<WxAccountFansTagDO> getWxAccountFansTagList(Collection<Integer> ids) { | ||
| 74 | - return wxAccountFansTagMapper.selectBatchIds(ids); | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | - @Override | ||
| 78 | - public PageResult<WxAccountFansTagDO> getWxAccountFansTagPage(WxAccountFansTagPageReqVO pageReqVO) { | ||
| 79 | - return wxAccountFansTagMapper.selectPage(pageReqVO); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - @Override | ||
| 83 | - public List<WxAccountFansTagDO> getWxAccountFansTagList(WxAccountFansTagExportReqVO exportReqVO) { | ||
| 84 | - return wxAccountFansTagMapper.selectList(exportReqVO); | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - @Override | ||
| 88 | - public void processFansTags(MpAccountDO wxAccountDO, WxMpUser wxmpUser) { | ||
| 89 | - WxAccountFansTagExportReqVO wxAccountFansTagTpl = new WxAccountFansTagExportReqVO(); | ||
| 90 | - wxAccountFansTagTpl.setOpenid(wxmpUser.getOpenId()); | ||
| 91 | - List<WxAccountFansTagDO> wxAccountFansTagList = this.getWxAccountFansTagList(wxAccountFansTagTpl); | ||
| 92 | - wxAccountFansTagList.forEach(temp -> this.deleteWxAccountFansTag(temp.getId())); | ||
| 93 | - | ||
| 94 | - Long[] tagIds = wxmpUser.getTagIds(); | ||
| 95 | - for (Long tagId : tagIds) { | ||
| 96 | - WxAccountFansTagCreateReqVO wxAccountFansTag = new WxAccountFansTagCreateReqVO(); | ||
| 97 | - wxAccountFansTag.setOpenid(wxmpUser.getOpenId()); | ||
| 98 | - wxAccountFansTag.setTagId(String.valueOf(tagId)); | ||
| 99 | - wxAccountFansTag.setWxAccountId(String.valueOf(wxAccountDO.getId())); | ||
| 100 | - this.createWxAccountFansTag(wxAccountFansTag); | ||
| 101 | - } | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - | ||
| 105 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/FansTagService.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 me.chanjar.weixin.common.error.WxErrorException; | ||
| 9 | -import me.chanjar.weixin.mp.bean.tag.WxUserTag; | ||
| 10 | - | ||
| 11 | -import javax.validation.Valid; | ||
| 12 | -import java.util.List; | ||
| 13 | - | ||
| 14 | -/** | ||
| 15 | - * 粉丝标签 Service 接口 | ||
| 16 | - * | ||
| 17 | - * @author fengdan | ||
| 18 | - */ | ||
| 19 | -public interface FansTagService { | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 创建粉丝标签 | ||
| 23 | - * | ||
| 24 | - * @param createReqVO 创建标签信息 | ||
| 25 | - * @return {@link WxUserTag} 用户标签对象 | ||
| 26 | - * @throws WxErrorException 微信异常 | ||
| 27 | - */ | ||
| 28 | - WxUserTag createWxFansTag(FansTagCreateReqVO createReqVO) throws WxErrorException; | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 更新粉丝标签 | ||
| 32 | - * | ||
| 33 | - * @param updateReqVO 更新信息 | ||
| 34 | - * @return {@link Boolean} | ||
| 35 | - * @throws WxErrorException 微信异常 | ||
| 36 | - */ | ||
| 37 | - Boolean updateWxFansTag(@Valid FansTagUpdateReqVO updateReqVO) throws WxErrorException; | ||
| 38 | - | ||
| 39 | - /** | ||
| 40 | - * 删除粉丝标签 | ||
| 41 | - * | ||
| 42 | - * @param id 编号 | ||
| 43 | - * @param appId 公众号appId | ||
| 44 | - * @return {@link Boolean} | ||
| 45 | - * @throws WxErrorException 微信异常 | ||
| 46 | - */ | ||
| 47 | - Boolean deleteWxFansTag(Long id, String appId) throws WxErrorException; | ||
| 48 | - | ||
| 49 | - /** | ||
| 50 | - * 获取公众号已创建的标签 | ||
| 51 | - * | ||
| 52 | - * @param appId 公众号appId | ||
| 53 | - * @return 粉丝标签列表 | ||
| 54 | - * @throws WxErrorException 微信异常 | ||
| 55 | - */ | ||
| 56 | - List<WxUserTag> getWxFansTagList(String appId) throws WxErrorException; | ||
| 57 | - | ||
| 58 | - /** | ||
| 59 | - * 获得粉丝标签分页 | ||
| 60 | - * | ||
| 61 | - * @param pageReqVO 分页查询 | ||
| 62 | - * @return 粉丝标签分页 | ||
| 63 | - */ | ||
| 64 | - PageResult<WxUserTag> getWxFansTagPage(FansTagPageReqVO pageReqVO); | ||
| 65 | - | ||
| 66 | - /** | ||
| 67 | - * 获得粉丝标签列表, 用于 Excel 导出 | ||
| 68 | - * | ||
| 69 | - * @param exportReqVO 查询条件 | ||
| 70 | - * @return 粉丝标签列表 | ||
| 71 | - */ | ||
| 72 | - List<WxUserTag> getWxFansTagList(FansTagExportReqVO exportReqVO); | ||
| 73 | - | ||
| 74 | -} |
yudao-module-mp/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.hutool.core.util.ReUtil; | ||
| 4 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 5 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagCreateReqVO; | ||
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagExportReqVO; | ||
| 7 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagPageReqVO; | ||
| 8 | -import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.FansTagUpdateReqVO; | ||
| 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.List; | ||
| 18 | - | ||
| 19 | -/** | ||
| 20 | - * 粉丝标签 Service 实现类 | ||
| 21 | - * | ||
| 22 | - * @author fengdan | ||
| 23 | - */ | ||
| 24 | -@Slf4j | ||
| 25 | -@Service | ||
| 26 | -@Validated | ||
| 27 | -public class FansTagServiceImpl implements FansTagService { | ||
| 28 | - @Resource | ||
| 29 | - private WxMpService wxMpService; | ||
| 30 | - | ||
| 31 | - @Override | ||
| 32 | - public WxUserTag createWxFansTag(FansTagCreateReqVO createReqVO) throws WxErrorException { | ||
| 33 | - // TODO 切换公众号操作 调整为 aop 或者 过滤器\拦截器 处理 | ||
| 34 | - wxMpService.switchover(createReqVO.getAppId()); | ||
| 35 | - return wxMpService.getUserTagService().tagCreate(createReqVO.getName()); | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | - @Override | ||
| 39 | - public Boolean updateWxFansTag(FansTagUpdateReqVO updateReqVO) throws WxErrorException { | ||
| 40 | - wxMpService.switchover(updateReqVO.getAppId()); | ||
| 41 | - return wxMpService.getUserTagService().tagUpdate(updateReqVO.getId(), updateReqVO.getName()); | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - @Override | ||
| 45 | - public Boolean deleteWxFansTag(Long id, String appId) throws WxErrorException { | ||
| 46 | - wxMpService.switchover(appId); | ||
| 47 | - return wxMpService.getUserTagService().tagDelete(id); | ||
| 48 | - } | ||
| 49 | - | ||
| 50 | - | ||
| 51 | - @Override | ||
| 52 | - public List<WxUserTag> getWxFansTagList(String appId) throws WxErrorException { | ||
| 53 | - wxMpService.switchover(appId); | ||
| 54 | - return wxMpService.getUserTagService().tagGet(); | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - @Override | ||
| 58 | - public PageResult<WxUserTag> getWxFansTagPage(FansTagPageReqVO pageReqVO) { | ||
| 59 | - return null; | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | - @Override | ||
| 63 | - public List<WxUserTag> getWxFansTagList(FansTagExportReqVO exportReqVO) { | ||
| 64 | - return null; | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java
0 → 100644
| 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.tag.vo.MpTagCreateReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; | ||
| 8 | + | ||
| 9 | +import javax.validation.Valid; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 公众号标签 Service 接口 | ||
| 13 | + * | ||
| 14 | + * @author fengdan | ||
| 15 | + */ | ||
| 16 | +public interface MpTagService { | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 创建公众号标签 | ||
| 20 | + * | ||
| 21 | + * @param createReqVO 创建标签信息 | ||
| 22 | + * @return 标签编号 | ||
| 23 | + */ | ||
| 24 | + Long createTag(@Valid MpTagCreateReqVO createReqVO); | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 更新公众号标签 | ||
| 28 | + * | ||
| 29 | + * @param updateReqVO 更新标签信息 | ||
| 30 | + */ | ||
| 31 | + void updateTag(@Valid MpTagUpdateReqVO updateReqVO); | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 删除公众号标签 | ||
| 35 | + * | ||
| 36 | + * @param id 编号 | ||
| 37 | + */ | ||
| 38 | + void deleteTag(Long id); | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 获得公众号标签分页 | ||
| 42 | + * | ||
| 43 | + * @param pageReqVO 分页查询 | ||
| 44 | + * @return 公众号标签分页 | ||
| 45 | + */ | ||
| 46 | + PageResult<MpTagDO> getTagPage(MpTagPageReqVO pageReqVO); | ||
| 47 | + | ||
| 48 | +} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java
0 → 100644
| 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.tag.vo.MpTagCreateReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagPageReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.MpTagUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; | ||
| 8 | +import cn.iocoder.yudao.module.mp.dal.mysql.tag.MpTagMapper; | ||
| 9 | +import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; | ||
| 10 | +import lombok.extern.slf4j.Slf4j; | ||
| 11 | +import org.springframework.context.annotation.Lazy; | ||
| 12 | +import org.springframework.stereotype.Service; | ||
| 13 | +import org.springframework.validation.annotation.Validated; | ||
| 14 | + | ||
| 15 | +import javax.annotation.Resource; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 公众号标签 Service 实现类 | ||
| 19 | + * | ||
| 20 | + * @author fengdan | ||
| 21 | + */ | ||
| 22 | +@Slf4j | ||
| 23 | +@Service | ||
| 24 | +@Validated | ||
| 25 | +public class MpTagServiceImpl implements MpTagService { | ||
| 26 | + | ||
| 27 | + @Resource | ||
| 28 | + private MpTagMapper mpTagMapper; | ||
| 29 | + | ||
| 30 | + @Resource | ||
| 31 | + @Lazy // 延迟加载,为了解决延迟加载 | ||
| 32 | + private MpServiceFactory mpServiceFactory; | ||
| 33 | + | ||
| 34 | + @Override | ||
| 35 | + public Long createTag(MpTagCreateReqVO createReqVO) { | ||
| 36 | +// return wxMpService.getUserTagService().tagCreate(createReqVO.getName()); | ||
| 37 | + return null; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @Override | ||
| 41 | + public void updateTag(MpTagUpdateReqVO updateReqVO) { | ||
| 42 | +// return wxMpService.getUserTagService().tagUpdate(updateReqVO.getId(), updateReqVO.getName()); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @Override | ||
| 46 | + public void deleteTag(Long id) { | ||
| 47 | +// return wxMpService.getUserTagService().tagDelete(id); | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + @Override | ||
| 51 | + public PageResult<MpTagDO> getTagPage(MpTagPageReqVO pageReqVO) { | ||
| 52 | + return null; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | +} |
yudao-ui-admin/src/views/wechatMp/wxFansTag/index.vue renamed to yudao-ui-admin/src/views/mp/tag/index.vue
yudao-ui-admin/src/views/wechatMp/wxAccountFansTag/index.vue deleted
| 1 | -<template> | ||
| 2 | - <div class="app-container"> | ||
| 3 | - | ||
| 4 | - <!-- 搜索工作栏 --> | ||
| 5 | - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | ||
| 6 | - <el-form-item label="用户标识" prop="openid"> | ||
| 7 | - <el-input v-model="queryParams.openid" placeholder="请输入用户标识" clearable @keyup.enter.native="handleQuery"/> | ||
| 8 | - </el-form-item> | ||
| 9 | - <el-form-item label="标签ID" prop="tagId"> | ||
| 10 | - <el-input v-model="queryParams.tagId" placeholder="请输入标签ID" clearable @keyup.enter.native="handleQuery"/> | ||
| 11 | - </el-form-item> | ||
| 12 | - <el-form-item label="微信账号ID" prop="wxAccountId"> | ||
| 13 | - <el-input v-model="queryParams.wxAccountId" placeholder="请输入微信账号ID" clearable | ||
| 14 | - @keyup.enter.native="handleQuery"/> | ||
| 15 | - </el-form-item> | ||
| 16 | - <el-form-item label="创建时间"> | ||
| 17 | - <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" | ||
| 18 | - type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"/> | ||
| 19 | - </el-form-item> | ||
| 20 | - <el-form-item> | ||
| 21 | - <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | ||
| 22 | - <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | ||
| 23 | - </el-form-item> | ||
| 24 | - </el-form> | ||
| 25 | - | ||
| 26 | - <!-- 操作工具栏 --> | ||
| 27 | - <el-row :gutter="10" class="mb8"> | ||
| 28 | - <el-col :span="1.5"> | ||
| 29 | - <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | ||
| 30 | - v-hasPermi="['wechatMp:wx-account-fans-tag:create']">新增 | ||
| 31 | - </el-button> | ||
| 32 | - </el-col> | ||
| 33 | - <el-col :span="1.5"> | ||
| 34 | - <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | ||
| 35 | - :loading="exportLoading" | ||
| 36 | - v-hasPermi="['wechatMp:wx-account-fans-tag:export']">导出 | ||
| 37 | - </el-button> | ||
| 38 | - </el-col> | ||
| 39 | - <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | ||
| 40 | - </el-row> | ||
| 41 | - | ||
| 42 | - <!-- 列表 --> | ||
| 43 | - <el-table v-loading="loading" :data="list"> | ||
| 44 | - <el-table-column label="主键" align="center" prop="id"/> | ||
| 45 | - <el-table-column label="用户标识" align="center" prop="openid"/> | ||
| 46 | - <el-table-column label="标签ID" align="center" prop="tagId"/> | ||
| 47 | - <el-table-column label="微信账号ID" align="center" prop="wxAccountId"/> | ||
| 48 | - <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | ||
| 49 | - <template slot-scope="scope"> | ||
| 50 | - <span>{{ parseTime(scope.row.createTime) }}</span> | ||
| 51 | - </template> | ||
| 52 | - </el-table-column> | ||
| 53 | - <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||
| 54 | - <template slot-scope="scope"> | ||
| 55 | - <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | ||
| 56 | - v-hasPermi="['wechatMp:wx-account-fans-tag:update']">修改 | ||
| 57 | - </el-button> | ||
| 58 | - <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | ||
| 59 | - v-hasPermi="['wechatMp:wx-account-fans-tag:delete']">删除 | ||
| 60 | - </el-button> | ||
| 61 | - </template> | ||
| 62 | - </el-table-column> | ||
| 63 | - </el-table> | ||
| 64 | - <!-- 分页组件 --> | ||
| 65 | - <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | ||
| 66 | - @pagination="getList"/> | ||
| 67 | - | ||
| 68 | - <!-- 对话框(添加 / 修改) --> | ||
| 69 | - <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | ||
| 70 | - <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | ||
| 71 | - <el-form-item label="用户标识" prop="openid"> | ||
| 72 | - <el-input v-model="form.openid" placeholder="请输入用户标识"/> | ||
| 73 | - </el-form-item> | ||
| 74 | - <el-form-item label="标签ID" prop="tagId"> | ||
| 75 | - <el-input v-model="form.tagId" placeholder="请输入标签ID"/> | ||
| 76 | - </el-form-item> | ||
| 77 | - <el-form-item label="微信账号ID" prop="wxAccountId"> | ||
| 78 | - <el-input v-model="form.wxAccountId" placeholder="请输入微信账号ID"/> | ||
| 79 | - </el-form-item> | ||
| 80 | - </el-form> | ||
| 81 | - <div slot="footer" class="dialog-footer"> | ||
| 82 | - <el-button type="primary" @click="submitForm">确 定</el-button> | ||
| 83 | - <el-button @click="cancel">取 消</el-button> | ||
| 84 | - </div> | ||
| 85 | - </el-dialog> | ||
| 86 | - </div> | ||
| 87 | -</template> | ||
| 88 | - | ||
| 89 | -<script> | ||
| 90 | - import { | ||
| 91 | - createWxAccountFansTag, | ||
| 92 | - updateWxAccountFansTag, | ||
| 93 | - deleteWxAccountFansTag, | ||
| 94 | - getWxAccountFansTag, | ||
| 95 | - getWxAccountFansTagPage, | ||
| 96 | - exportWxAccountFansTagExcel | ||
| 97 | - } from "@/api/wechatMp/wxAccountFansTag"; | ||
| 98 | - | ||
| 99 | - export default { | ||
| 100 | - name: "WxAccountFansTag", | ||
| 101 | - components: {}, | ||
| 102 | - data() { | ||
| 103 | - return { | ||
| 104 | - // 遮罩层 | ||
| 105 | - loading: true, | ||
| 106 | - // 导出遮罩层 | ||
| 107 | - exportLoading: false, | ||
| 108 | - // 显示搜索条件 | ||
| 109 | - showSearch: true, | ||
| 110 | - // 总条数 | ||
| 111 | - total: 0, | ||
| 112 | - // 粉丝标签关联列表 | ||
| 113 | - list: [], | ||
| 114 | - // 弹出层标题 | ||
| 115 | - title: "", | ||
| 116 | - // 是否显示弹出层 | ||
| 117 | - open: false, | ||
| 118 | - dateRangeCreateTime: [], | ||
| 119 | - // 查询参数 | ||
| 120 | - queryParams: { | ||
| 121 | - pageNo: 1, | ||
| 122 | - pageSize: 10, | ||
| 123 | - openid: null, | ||
| 124 | - tagId: null, | ||
| 125 | - wxAccountId: null, | ||
| 126 | - }, | ||
| 127 | - // 表单参数 | ||
| 128 | - form: {}, | ||
| 129 | - // 表单校验 | ||
| 130 | - rules: {} | ||
| 131 | - }; | ||
| 132 | - }, | ||
| 133 | - created() { | ||
| 134 | - this.getList(); | ||
| 135 | - }, | ||
| 136 | - methods: { | ||
| 137 | - /** 查询列表 */ | ||
| 138 | - getList() { | ||
| 139 | - this.loading = true; | ||
| 140 | - // 处理查询参数 | ||
| 141 | - let params = {...this.queryParams}; | ||
| 142 | - this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); | ||
| 143 | - // 执行查询 | ||
| 144 | - getWxAccountFansTagPage(params).then(response => { | ||
| 145 | - this.list = response.data.list; | ||
| 146 | - this.total = response.data.total; | ||
| 147 | - this.loading = false; | ||
| 148 | - }); | ||
| 149 | - }, | ||
| 150 | - /** 取消按钮 */ | ||
| 151 | - cancel() { | ||
| 152 | - this.open = false; | ||
| 153 | - this.reset(); | ||
| 154 | - }, | ||
| 155 | - /** 表单重置 */ | ||
| 156 | - reset() { | ||
| 157 | - this.form = { | ||
| 158 | - id: undefined, | ||
| 159 | - openid: undefined, | ||
| 160 | - tagId: undefined, | ||
| 161 | - wxAccountId: undefined, | ||
| 162 | - }; | ||
| 163 | - this.resetForm("form"); | ||
| 164 | - }, | ||
| 165 | - /** 搜索按钮操作 */ | ||
| 166 | - handleQuery() { | ||
| 167 | - this.queryParams.pageNo = 1; | ||
| 168 | - this.getList(); | ||
| 169 | - }, | ||
| 170 | - /** 重置按钮操作 */ | ||
| 171 | - resetQuery() { | ||
| 172 | - this.dateRangeCreateTime = []; | ||
| 173 | - this.resetForm("queryForm"); | ||
| 174 | - this.handleQuery(); | ||
| 175 | - }, | ||
| 176 | - /** 新增按钮操作 */ | ||
| 177 | - handleAdd() { | ||
| 178 | - this.reset(); | ||
| 179 | - this.open = true; | ||
| 180 | - this.title = "添加粉丝标签关联"; | ||
| 181 | - }, | ||
| 182 | - /** 修改按钮操作 */ | ||
| 183 | - handleUpdate(row) { | ||
| 184 | - this.reset(); | ||
| 185 | - const id = row.id; | ||
| 186 | - getWxAccountFansTag(id).then(response => { | ||
| 187 | - this.form = response.data; | ||
| 188 | - this.open = true; | ||
| 189 | - this.title = "修改粉丝标签关联"; | ||
| 190 | - }); | ||
| 191 | - }, | ||
| 192 | - /** 提交按钮 */ | ||
| 193 | - submitForm() { | ||
| 194 | - this.$refs["form"].validate(valid => { | ||
| 195 | - if (!valid) { | ||
| 196 | - return; | ||
| 197 | - } | ||
| 198 | - // 修改的提交 | ||
| 199 | - if (this.form.id != null) { | ||
| 200 | - updateWxAccountFansTag(this.form).then(response => { | ||
| 201 | - this.$modal.msgSuccess("修改成功"); | ||
| 202 | - this.open = false; | ||
| 203 | - this.getList(); | ||
| 204 | - }); | ||
| 205 | - return; | ||
| 206 | - } | ||
| 207 | - // 添加的提交 | ||
| 208 | - createWxAccountFansTag(this.form).then(response => { | ||
| 209 | - this.$modal.msgSuccess("新增成功"); | ||
| 210 | - this.open = false; | ||
| 211 | - this.getList(); | ||
| 212 | - }); | ||
| 213 | - }); | ||
| 214 | - }, | ||
| 215 | - /** 删除按钮操作 */ | ||
| 216 | - handleDelete(row) { | ||
| 217 | - const id = row.id; | ||
| 218 | - this.$modal.confirm('是否确认删除粉丝标签关联编号为"' + id + '"的数据项?').then(function () { | ||
| 219 | - return deleteWxAccountFansTag(id); | ||
| 220 | - }).then(() => { | ||
| 221 | - this.getList(); | ||
| 222 | - this.$modal.msgSuccess("删除成功"); | ||
| 223 | - }).catch(() => { | ||
| 224 | - }); | ||
| 225 | - }, | ||
| 226 | - /** 导出按钮操作 */ | ||
| 227 | - handleExport() { | ||
| 228 | - // 处理查询参数 | ||
| 229 | - let params = {...this.queryParams}; | ||
| 230 | - params.pageNo = undefined; | ||
| 231 | - params.pageSize = undefined; | ||
| 232 | - this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); | ||
| 233 | - // 执行导出 | ||
| 234 | - this.$modal.confirm('是否确认导出所有粉丝标签关联数据项?').then(() => { | ||
| 235 | - this.exportLoading = true; | ||
| 236 | - return exportWxAccountFansTagExcel(params); | ||
| 237 | - }).then(response => { | ||
| 238 | - this.$download.excel(response, '粉丝标签关联.xls'); | ||
| 239 | - this.exportLoading = false; | ||
| 240 | - }).catch(() => { | ||
| 241 | - }); | ||
| 242 | - } | ||
| 243 | - } | ||
| 244 | - }; | ||
| 245 | -</script> |