parent
2e18506e1a
commit
8bcff4ed6f
@ -1,43 +0,0 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
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