Revert "refactor(yudao-module-mp-biz): 微信公众号粉丝管理重构"
This reverts commit a3bc6b4f74ed38b961c6295511fa659da12779a0.
This commit is contained in:
parent
667c8459c0
commit
2e18506e1a
@ -1,54 +1,55 @@
|
||||
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.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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 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 java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
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 static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
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.fanstag.vo.*;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.fanstag.WxFansTagDO;
|
||||
import cn.iocoder.yudao.module.mp.convert.fanstag.WxFansTagConvert;
|
||||
import cn.iocoder.yudao.module.mp.service.fanstag.WxFansTagService;
|
||||
|
||||
@Api(tags = "管理后台 - 粉丝标签")
|
||||
@RestController
|
||||
@RequestMapping("/wechat-mp/fans-tag")
|
||||
@RequestMapping("/wechatMp/wx-fans-tag")
|
||||
@Validated
|
||||
public class FansTagController {
|
||||
public class WxFansTagController {
|
||||
|
||||
@Resource
|
||||
private FansTagService fansTagService;
|
||||
private WxFansTagService wxFansTagService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建粉丝标签")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:create')")
|
||||
public CommonResult<WxUserTag> createWxFansTag(@Valid @RequestBody FansTagCreateReqVO createReqVO) {
|
||||
return success(fansTagService.createWxFansTag(createReqVO));
|
||||
public CommonResult<Integer> createWxFansTag(@Valid @RequestBody WxFansTagCreateReqVO createReqVO) {
|
||||
return success(wxFansTagService.createWxFansTag(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新粉丝标签")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:update')")
|
||||
public CommonResult<Boolean> updateWxFansTag(@Valid @RequestBody FansTagUpdateReqVO updateReqVO) {
|
||||
fansTagService.updateWxFansTag(updateReqVO);
|
||||
public CommonResult<Boolean> updateWxFansTag(@Valid @RequestBody WxFansTagUpdateReqVO updateReqVO) {
|
||||
wxFansTagService.updateWxFansTag(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ -57,7 +58,7 @@ public class FansTagController {
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:delete')")
|
||||
public CommonResult<Boolean> deleteWxFansTag(@RequestParam("id") Integer id) {
|
||||
fansTagService.deleteWxFansTag(id);
|
||||
wxFansTagService.deleteWxFansTag(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ -65,8 +66,8 @@ public class FansTagController {
|
||||
@ApiOperation("获得粉丝标签")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:query')")
|
||||
public CommonResult<FansTagRespVO> getWxFansTag(@RequestParam("id") Integer id) {
|
||||
WxUserTag wxFansTag = fansTagService.getWxFansTag(id);
|
||||
public CommonResult<WxFansTagRespVO> getWxFansTag(@RequestParam("id") Integer id) {
|
||||
WxFansTagDO wxFansTag = wxFansTagService.getWxFansTag(id);
|
||||
return success(WxFansTagConvert.INSTANCE.convert(wxFansTag));
|
||||
}
|
||||
|
||||
@ -74,16 +75,16 @@ public class FansTagController {
|
||||
@ApiOperation("获得粉丝标签列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:query')")
|
||||
public CommonResult<List<FansTagRespVO>> getWxFansTagList(@RequestParam("ids") Collection<Integer> ids) {
|
||||
List<WxUserTag> list = fansTagService.getWxFansTagList(ids);
|
||||
public CommonResult<List<WxFansTagRespVO>> getWxFansTagList(@RequestParam("ids") Collection<Integer> ids) {
|
||||
List<WxFansTagDO> list = wxFansTagService.getWxFansTagList(ids);
|
||||
return success(WxFansTagConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得粉丝标签分页")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:query')")
|
||||
public CommonResult<PageResult<FansTagRespVO>> getWxFansTagPage(@Valid FansTagPageReqVO pageVO) {
|
||||
PageResult<WxUserTag> pageResult = fansTagService.getWxFansTagPage(pageVO);
|
||||
public CommonResult<PageResult<WxFansTagRespVO>> getWxFansTagPage(@Valid WxFansTagPageReqVO pageVO) {
|
||||
PageResult<WxFansTagDO> pageResult = wxFansTagService.getWxFansTagPage(pageVO);
|
||||
return success(WxFansTagConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@ -91,12 +92,12 @@ public class FansTagController {
|
||||
@ApiOperation("导出粉丝标签 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportWxFansTagExcel(@Valid FansTagExportReqVO exportReqVO,
|
||||
public void exportWxFansTagExcel(@Valid WxFansTagExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<WxUserTag> list = fansTagService.getWxFansTagList(exportReqVO);
|
||||
List<WxFansTagDO> list = wxFansTagService.getWxFansTagList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<FansTagExcelVO> datas = WxFansTagConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "粉丝标签.xls", "数据", FansTagExcelVO.class, datas);
|
||||
List<WxFansTagExcelVO> datas = WxFansTagConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "粉丝标签.xls", "数据", WxFansTagExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -1,20 +1,22 @@
|
||||
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
@Data
|
||||
public class FansTagBaseVO {
|
||||
public class WxFansTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "标签名,UTF8编码.")
|
||||
@ApiModelProperty(value = "标签名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "此标签下粉丝数")
|
||||
@ApiModelProperty(value = "粉丝数量")
|
||||
private Integer count;
|
||||
|
||||
@ApiModelProperty(value = "微信账号ID")
|
||||
private String wxAccountId;
|
||||
|
||||
}
|
@ -3,13 +3,10 @@ package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||
import lombok.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
/**
|
||||
* @author fengdan
|
||||
*/
|
||||
@ApiModel("管理后台 - 粉丝标签创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FansTagCreateReqVO extends FansTagBaseVO {
|
||||
public class WxFansTagCreateReqVO extends WxFansTagBaseVO {
|
||||
|
||||
}
|
@ -12,7 +12,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class FansTagExcelVO {
|
||||
public class WxFansTagExcelVO {
|
||||
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
@ -23,6 +23,9 @@ public class FansTagExcelVO {
|
||||
@ExcelProperty("粉丝数量")
|
||||
private Integer count;
|
||||
|
||||
@ExcelProperty("微信账号ID")
|
||||
private String wxAccountId;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
@ -11,7 +11,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
|
||||
@ApiModel(value = "管理后台 - 粉丝标签 Excel 导出 Request VO", description = "参数和 WxFansTagPageReqVO 是一致的")
|
||||
@Data
|
||||
public class FansTagExportReqVO {
|
||||
public class WxFansTagExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "标签名称")
|
||||
private String name;
|
@ -14,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FansTagPageReqVO extends PageParam {
|
||||
public class WxFansTagPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "标签名称")
|
||||
private String name;
|
@ -10,10 +10,10 @@ import io.swagger.annotations.*;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FansTagRespVO extends FansTagBaseVO {
|
||||
public class WxFansTagRespVO extends WxFansTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "标签id,由微信分配.")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "主键", required = true)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
@ -9,7 +9,7 @@ import javax.validation.constraints.*;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FansTagUpdateReqVO extends FansTagBaseVO {
|
||||
public class WxFansTagUpdateReqVO extends WxFansTagBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "主键", required = true)
|
||||
@NotNull(message = "主键不能为空")
|
@ -4,31 +4,31 @@ 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.*;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.fanstag.WxFansTagDO;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Convert
|
||||
*
|
||||
* @author fengdan
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface WxFansTagConvert {
|
||||
|
||||
WxFansTagConvert INSTANCE = Mappers.getMapper(WxFansTagConvert.class);
|
||||
|
||||
WxUserTag convert(FansTagCreateReqVO bean);
|
||||
WxFansTagDO convert(WxFansTagCreateReqVO bean);
|
||||
|
||||
WxUserTag convert(FansTagUpdateReqVO bean);
|
||||
WxFansTagDO convert(WxFansTagUpdateReqVO bean);
|
||||
|
||||
FansTagRespVO convert(WxUserTag bean);
|
||||
WxFansTagRespVO convert(WxFansTagDO bean);
|
||||
|
||||
List<FansTagRespVO> convertList(List<WxUserTag> list);
|
||||
List<WxFansTagRespVO> convertList(List<WxFansTagDO> list);
|
||||
|
||||
PageResult<FansTagRespVO> convertPage(PageResult<WxUserTag> page);
|
||||
PageResult<WxFansTagRespVO> convertPage(PageResult<WxFansTagDO> page);
|
||||
|
||||
List<FansTagExcelVO> convertList02(List<WxUserTag> list);
|
||||
List<WxFansTagExcelVO> convertList02(List<WxFansTagDO> list);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.mp.dal.dataobject.fanstag;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 粉丝标签 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("wx_fans_tag")
|
||||
@KeySequence("wx_fans_tag_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WxFansTagDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 粉丝数量
|
||||
*/
|
||||
private Integer count;
|
||||
/**
|
||||
* 微信账号ID
|
||||
*/
|
||||
private String wxAccountId;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.mp.dal.mysql.fanstag;
|
||||
|
||||
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.fanstag.WxFansTagDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface WxFansTagMapper extends BaseMapperX<WxFansTagDO> {
|
||||
|
||||
default PageResult<WxFansTagDO> selectPage(WxFansTagPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WxFansTagDO>()
|
||||
.likeIfPresent(WxFansTagDO::getName, reqVO.getName())
|
||||
.eqIfPresent(WxFansTagDO::getCount, reqVO.getCount())
|
||||
.eqIfPresent(WxFansTagDO::getWxAccountId, reqVO.getWxAccountId())
|
||||
.betweenIfPresent(WxFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||
.orderByDesc(WxFansTagDO::getId));
|
||||
}
|
||||
|
||||
default List<WxFansTagDO> selectList(WxFansTagExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<WxFansTagDO>()
|
||||
.likeIfPresent(WxFansTagDO::getName, reqVO.getName())
|
||||
.eqIfPresent(WxFansTagDO::getCount, reqVO.getCount())
|
||||
.eqIfPresent(WxFansTagDO::getWxAccountId, reqVO.getWxAccountId())
|
||||
.betweenIfPresent(WxFansTagDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||
.orderByDesc(WxFansTagDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.mp.service.fanstag;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo.*;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.fanstag.WxFansTagDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface WxFansTagService {
|
||||
|
||||
/**
|
||||
* 创建粉丝标签
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createWxFansTag(@Valid WxFansTagCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新粉丝标签
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateWxFansTag(@Valid WxFansTagUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除粉丝标签
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteWxFansTag(Integer id);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 粉丝标签
|
||||
*/
|
||||
WxFansTagDO getWxFansTag(Integer id);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 粉丝标签列表
|
||||
*/
|
||||
List<WxFansTagDO> getWxFansTagList(Collection<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 粉丝标签分页
|
||||
*/
|
||||
PageResult<WxFansTagDO> getWxFansTagPage(WxFansTagPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 粉丝标签列表
|
||||
*/
|
||||
List<WxFansTagDO> getWxFansTagList(WxFansTagExportReqVO exportReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.mp.service.fanstag;
|
||||
|
||||
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.fanstag.vo.*;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.fanstag.WxFansTagDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.mp.convert.fanstag.WxFansTagConvert;
|
||||
import cn.iocoder.yudao.module.mp.dal.mysql.fanstag.WxFansTagMapper;
|
||||
|
||||
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 WxFansTagServiceImpl implements WxFansTagService {
|
||||
|
||||
@Resource
|
||||
private WxFansTagMapper wxFansTagMapper;
|
||||
|
||||
@Override
|
||||
public Integer createWxFansTag(WxFansTagCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
WxFansTagDO wxFansTag = WxFansTagConvert.INSTANCE.convert(createReqVO);
|
||||
wxFansTagMapper.insert(wxFansTag);
|
||||
// 返回
|
||||
return wxFansTag.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWxFansTag(WxFansTagUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
this.validateWxFansTagExists(updateReqVO.getId());
|
||||
// 更新
|
||||
WxFansTagDO updateObj = WxFansTagConvert.INSTANCE.convert(updateReqVO);
|
||||
wxFansTagMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteWxFansTag(Integer id) {
|
||||
// 校验存在
|
||||
this.validateWxFansTagExists(id);
|
||||
// 删除
|
||||
wxFansTagMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateWxFansTagExists(Integer id) {
|
||||
if (wxFansTagMapper.selectById(id) == null) {
|
||||
throw exception(COMMON_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxFansTagDO getWxFansTag(Integer id) {
|
||||
return wxFansTagMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WxFansTagDO> getWxFansTagList(Collection<Integer> ids) {
|
||||
return wxFansTagMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WxFansTagDO> getWxFansTagPage(WxFansTagPageReqVO pageReqVO) {
|
||||
return wxFansTagMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WxFansTagDO> getWxFansTagList(WxFansTagExportReqVO exportReqVO) {
|
||||
return wxFansTagMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -1,75 +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.mp.bean.tag.WxUserTag;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 粉丝标签 Service 接口
|
||||
*
|
||||
* @author fengdan
|
||||
*/
|
||||
public interface FansTagService {
|
||||
|
||||
/**
|
||||
* 创建粉丝标签
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
WxUserTag createWxFansTag(@Valid FansTagCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新粉丝标签
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateWxFansTag(@Valid FansTagUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除粉丝标签
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteWxFansTag(Integer id);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 粉丝标签
|
||||
*/
|
||||
WxUserTag getWxFansTag(Integer id);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 粉丝标签列表
|
||||
*/
|
||||
List<WxUserTag> getWxFansTagList(Collection<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 粉丝标签分页
|
||||
*/
|
||||
PageResult<WxUserTag> getWxFansTagPage(FansTagPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得粉丝标签列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 粉丝标签列表
|
||||
*/
|
||||
List<WxUserTag> getWxFansTagList(FansTagExportReqVO exportReqVO);
|
||||
|
||||
}
|
@ -1,77 +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 cn.iocoder.yudao.module.mp.convert.fanstag.WxFansTagConvert;
|
||||
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.Collection;
|
||||
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) {
|
||||
try {
|
||||
return wxMpService.getUserTagService().tagCreate("wxFansTag");
|
||||
} catch (WxErrorException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWxFansTag(FansTagUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
// 更新
|
||||
WxUserTag updateObj = WxFansTagConvert.INSTANCE.convert(updateReqVO);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteWxFansTag(Integer id) {
|
||||
// 校验存在
|
||||
// 删除
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WxUserTag getWxFansTag(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WxUserTag> getWxFansTagList(Collection<Integer> ids) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WxUserTag> getWxFansTagPage(FansTagPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WxUserTag> getWxFansTagList(FansTagExportReqVO exportReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user