mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-19 11:40:05 +08:00
公众号开发
This commit is contained in:
parent
2aba8a72c9
commit
70adfe8fe5
File diff suppressed because it is too large
Load Diff
@ -12,5 +12,6 @@ public interface ErrorCodeConstants {
|
|||||||
// ========== 用户相关 1004001000============
|
// ========== 用户相关 1004001000============
|
||||||
ErrorCode WX_ACCOUNT_NOT_EXISTS = new ErrorCode(1004001000, "用户不存在");
|
ErrorCode WX_ACCOUNT_NOT_EXISTS = new ErrorCode(1004001000, "用户不存在");
|
||||||
ErrorCode WX_ACCOUNT_FANS_NOT_EXISTS = new ErrorCode(1004001000, "用户不存在");
|
ErrorCode WX_ACCOUNT_FANS_NOT_EXISTS = new ErrorCode(1004001000, "用户不存在");
|
||||||
|
ErrorCode COMMON_NOT_EXISTS = new ErrorCode(1004001000, "用户不存在");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,22 +2,28 @@ package cn.iocoder.yudao.module.mp.config;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import cn.iocoder.yudao.module.mp.admin.account.vo.WxAccountExportReqVO;
|
import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountExportReqVO;
|
||||||
import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO;
|
import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO;
|
||||||
import cn.iocoder.yudao.module.mp.handler.*;
|
import cn.iocoder.yudao.module.mp.handler.*;
|
||||||
import cn.iocoder.yudao.module.mp.service.account.WxAccountService;
|
import cn.iocoder.yudao.module.mp.service.account.WxAccountService;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.chanjar.weixin.common.api.WxConsts;
|
import me.chanjar.weixin.common.api.WxConsts;
|
||||||
|
import me.chanjar.weixin.common.redis.JedisWxRedisOps;
|
||||||
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
|
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
|
||||||
import me.chanjar.weixin.mp.api.WxMpService;
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
|
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
|
||||||
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
|
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
|
||||||
|
import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl;
|
||||||
import me.chanjar.weixin.mp.constant.WxMpEventConstants;
|
import me.chanjar.weixin.mp.constant.WxMpEventConstants;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import redis.clients.jedis.JedisPool;
|
||||||
|
import redis.clients.jedis.JedisPoolConfig;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -25,6 +31,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
// TODO @芋艿:思考有没更好的处理方式
|
// TODO @芋艿:思考有没更好的处理方式
|
||||||
@Component
|
@Component
|
||||||
|
@EnableConfigurationProperties(WxMpProperties.class)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WxMpConfig implements InitializingBean {
|
public class WxMpConfig implements InitializingBean {
|
||||||
|
|
||||||
@ -33,6 +40,10 @@ public class WxMpConfig implements InitializingBean {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WxAccountService wxAccountService;
|
private WxAccountService wxAccountService;
|
||||||
|
@Autowired
|
||||||
|
private WxMpProperties wxMpProperties;
|
||||||
|
|
||||||
|
private static final long SCHEDULER_PERIOD = 5 * 60 * 1000L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化公众号配置
|
* 初始化公众号配置
|
||||||
@ -43,22 +54,39 @@ public class WxMpConfig implements InitializingBean {
|
|||||||
if (CollectionUtils.isEmpty(wxAccountList)) {
|
if (CollectionUtils.isEmpty(wxAccountList)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WxMpConfig.init(wxAccountList);
|
WxMpConfig.init(wxAccountList, wxMpProperties);
|
||||||
log.info("加载公众号配置成功");
|
log.info("加载公众号配置成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init(List<WxAccountDO> wxAccountDOS) {
|
|
||||||
|
@Scheduled(fixedDelay = SCHEDULER_PERIOD, initialDelay = SCHEDULER_PERIOD)
|
||||||
|
public void schedulePeriodicRefresh() {
|
||||||
|
initWxConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void init(List<WxAccountDO> wxAccountDOS, WxMpProperties properties) {
|
||||||
mpServices = wxAccountDOS.stream().map(wxAccountDO -> {
|
mpServices = wxAccountDOS.stream().map(wxAccountDO -> {
|
||||||
// TODO 亚洲:使用 WxMpInMemoryConfigStorage 的话,多节点会不会存在 accessToken 冲突
|
// TODO 亚洲:使用 WxMpInMemoryConfigStorage 的话,多节点会不会存在 accessToken 冲突
|
||||||
WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl();
|
|
||||||
configStorage.setAppId(wxAccountDO.getAppid());
|
WxMpDefaultConfigImpl configStorage;
|
||||||
configStorage.setSecret(wxAccountDO.getAppsecret());
|
if (properties.isUseRedis()) {
|
||||||
|
final WxMpProperties.RedisConfig redisConfig = properties.getRedisConfig();
|
||||||
|
JedisPoolConfig poolConfig = new JedisPoolConfig();
|
||||||
|
JedisPool jedisPool = new JedisPool(poolConfig, redisConfig.getHost(), redisConfig.getPort(),
|
||||||
|
redisConfig.getTimeout(), redisConfig.getPassword());
|
||||||
|
configStorage = new WxMpRedisConfigImpl(new JedisWxRedisOps(jedisPool), wxAccountDO.getAppId());
|
||||||
|
} else {
|
||||||
|
configStorage = new WxMpDefaultConfigImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
configStorage.setAppId(wxAccountDO.getAppId());
|
||||||
|
configStorage.setSecret(wxAccountDO.getAppSecret());
|
||||||
configStorage.setToken(wxAccountDO.getToken());
|
configStorage.setToken(wxAccountDO.getToken());
|
||||||
configStorage.setAesKey(wxAccountDO.getAeskey());
|
configStorage.setAesKey(wxAccountDO.getAesKey());
|
||||||
|
|
||||||
WxMpService service = new WxMpServiceImpl();
|
WxMpService service = new WxMpServiceImpl();
|
||||||
service.setWxMpConfigStorage(configStorage);
|
service.setWxMpConfigStorage(configStorage);
|
||||||
routers.put(wxAccountDO.getAppid(), newRouter(service));
|
routers.put(wxAccountDO.getAppId(), newRouter(service));
|
||||||
return service;
|
return service;
|
||||||
}).collect(Collectors.toMap(s -> s.getWxMpConfigStorage().getAppId(), a -> a, (o, n) -> o));
|
}).collect(Collectors.toMap(s -> s.getWxMpConfigStorage().getAppId(), a -> a, (o, n) -> o));
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wechat mp properties
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ConfigurationProperties(prefix = "wx.mp")
|
||||||
|
public class WxMpProperties {
|
||||||
|
/**
|
||||||
|
* 是否使用redis存储access token
|
||||||
|
*/
|
||||||
|
private boolean useRedis;
|
||||||
|
|
||||||
|
private String defaultContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* redis 配置
|
||||||
|
*/
|
||||||
|
private RedisConfig redisConfig;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class RedisConfig {
|
||||||
|
/**
|
||||||
|
* redis服务器 主机地址
|
||||||
|
*/
|
||||||
|
private String host;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* redis服务器 端口号
|
||||||
|
*/
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* redis服务器 密码
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* redis 服务连接超时时间
|
||||||
|
*/
|
||||||
|
private Integer timeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,10 +1,10 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.account;
|
package cn.iocoder.yudao.module.mp.controller.admin.account;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
import cn.iocoder.yudao.module.mp.admin.account.vo.*;
|
import cn.iocoder.yudao.module.mp.controller.admin.account.vo.*;
|
||||||
import cn.iocoder.yudao.module.mp.convert.account.WxAccountConvert;
|
import cn.iocoder.yudao.module.mp.convert.account.WxAccountConvert;
|
||||||
import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO;
|
import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO;
|
||||||
import cn.iocoder.yudao.module.mp.service.account.WxAccountService;
|
import cn.iocoder.yudao.module.mp.service.account.WxAccountService;
|
@ -1,9 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import javax.validation.constraints.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公众号账户 Base VO,提供给添加、修改、详细的子 VO 使用
|
* 公众号账户 Base VO,提供给添加、修改、详细的子 VO 使用
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
@ -1,8 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.annotations.*;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
@ -39,7 +38,7 @@ public class WxAccountExcelVO {
|
|||||||
private String aeskey;
|
private String aeskey;
|
||||||
|
|
||||||
@ExcelProperty("二维码图片URL")
|
@ExcelProperty("二维码图片URL")
|
||||||
private String qrUrl;
|
private String qrCodeUrl;
|
||||||
|
|
||||||
@ExcelProperty("备注")
|
@ExcelProperty("备注")
|
||||||
private String remark;
|
private String remark;
|
@ -1,9 +1,8 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -17,7 +17,7 @@ public class WxAccountRespVO extends WxAccountBaseVO {
|
|||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
@ApiModelProperty(value = "二维码图片URL")
|
@ApiModelProperty(value = "二维码图片URL")
|
||||||
private String qrUrl;
|
private String qrCodeUrl;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建时间", required = true)
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
private Date createTime;
|
private Date createTime;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.account.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.account.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
@ -1,10 +1,10 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.accountfans;
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfans;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
import cn.iocoder.yudao.module.mp.admin.accountfans.vo.*;
|
import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.*;
|
||||||
import cn.iocoder.yudao.module.mp.convert.accountfans.WxAccountFansConvert;
|
import cn.iocoder.yudao.module.mp.convert.accountfans.WxAccountFansConvert;
|
||||||
import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO;
|
import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO;
|
||||||
import cn.iocoder.yudao.module.mp.service.accountfans.WxAccountFansService;
|
import cn.iocoder.yudao.module.mp.service.accountfans.WxAccountFansService;
|
@ -1,9 +1,8 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.accountfans.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.accountfans.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
@ -1,8 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.accountfans.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.annotations.*;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
@ -1,9 +1,8 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.accountfans.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.accountfans.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.accountfans.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.mp.admin.accountfans.vo;
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO;
|
||||||
|
import cn.iocoder.yudao.module.mp.convert.accountfanstag.WxAccountFansTagConvert;
|
||||||
|
import cn.iocoder.yudao.module.mp.service.accountfanstag.WxAccountFansTagService;
|
||||||
|
|
||||||
|
@Api(tags = "管理后台 - 粉丝标签关联")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wechatMp/wx-account-fans-tag")
|
||||||
|
@Validated
|
||||||
|
public class WxAccountFansTagController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxAccountFansTagService wxAccountFansTagService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建粉丝标签关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:create')")
|
||||||
|
public CommonResult<Integer> createWxAccountFansTag(@Valid @RequestBody WxAccountFansTagCreateReqVO createReqVO) {
|
||||||
|
return success(wxAccountFansTagService.createWxAccountFansTag(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新粉丝标签关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:update')")
|
||||||
|
public CommonResult<Boolean> updateWxAccountFansTag(@Valid @RequestBody WxAccountFansTagUpdateReqVO updateReqVO) {
|
||||||
|
wxAccountFansTagService.updateWxAccountFansTag(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除粉丝标签关联")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWxAccountFansTag(@RequestParam("id") Integer id) {
|
||||||
|
wxAccountFansTagService.deleteWxAccountFansTag(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得粉丝标签关联")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')")
|
||||||
|
public CommonResult<WxAccountFansTagRespVO> getWxAccountFansTag(@RequestParam("id") Integer id) {
|
||||||
|
WxAccountFansTagDO wxAccountFansTag = wxAccountFansTagService.getWxAccountFansTag(id);
|
||||||
|
return success(WxAccountFansTagConvert.INSTANCE.convert(wxAccountFansTag));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得粉丝标签关联列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')")
|
||||||
|
public CommonResult<List<WxAccountFansTagRespVO>> getWxAccountFansTagList(@RequestParam("ids") Collection<Integer> ids) {
|
||||||
|
List<WxAccountFansTagDO> list = wxAccountFansTagService.getWxAccountFansTagList(ids);
|
||||||
|
return success(WxAccountFansTagConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("获得粉丝标签关联分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:query')")
|
||||||
|
public CommonResult<PageResult<WxAccountFansTagRespVO>> getWxAccountFansTagPage(@Valid WxAccountFansTagPageReqVO pageVO) {
|
||||||
|
PageResult<WxAccountFansTagDO> pageResult = wxAccountFansTagService.getWxAccountFansTagPage(pageVO);
|
||||||
|
return success(WxAccountFansTagConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出粉丝标签关联 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxAccountFansTagExcel(@Valid WxAccountFansTagExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxAccountFansTagDO> list = wxAccountFansTagService.getWxAccountFansTagList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxAccountFansTagExcelVO> datas = WxAccountFansTagConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "粉丝标签关联.xls", "数据", WxAccountFansTagExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉丝标签关联 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxAccountFansTagBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户标识")
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标签ID")
|
||||||
|
private String tagId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝标签关联创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxAccountFansTagCreateReqVO extends WxAccountFansTagBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉丝标签关联 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxAccountFansTagExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("用户标识")
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
@ExcelProperty("标签ID")
|
||||||
|
private String tagId;
|
||||||
|
|
||||||
|
@ExcelProperty("微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 粉丝标签关联 Excel 导出 Request VO", description = "参数和 WxAccountFansTagPageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxAccountFansTagExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户标识")
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标签ID")
|
||||||
|
private String tagId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝标签关联分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxAccountFansTagPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户标识")
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标签ID")
|
||||||
|
private String tagId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝标签关联 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxAccountFansTagRespVO extends WxAccountFansTagBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝标签关联更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxAccountFansTagUpdateReqVO extends WxAccountFansTagBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsg;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsg.WxFansMsgDO;
|
||||||
|
import cn.iocoder.yudao.module.mp.convert.fansmsg.WxFansMsgConvert;
|
||||||
|
import cn.iocoder.yudao.module.mp.service.fansmsg.WxFansMsgService;
|
||||||
|
|
||||||
|
@Api(tags = "管理后台 - 粉丝消息表 ")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wechatMp/wx-fans-msg")
|
||||||
|
@Validated
|
||||||
|
public class WxFansMsgController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxFansMsgService wxFansMsgService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建粉丝消息表 ")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:create')")
|
||||||
|
public CommonResult<Integer> createWxFansMsg(@Valid @RequestBody WxFansMsgCreateReqVO createReqVO) {
|
||||||
|
return success(wxFansMsgService.createWxFansMsg(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新粉丝消息表 ")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:update')")
|
||||||
|
public CommonResult<Boolean> updateWxFansMsg(@Valid @RequestBody WxFansMsgUpdateReqVO updateReqVO) {
|
||||||
|
wxFansMsgService.updateWxFansMsg(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除粉丝消息表 ")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWxFansMsg(@RequestParam("id") Integer id) {
|
||||||
|
wxFansMsgService.deleteWxFansMsg(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得粉丝消息表 ")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:query')")
|
||||||
|
public CommonResult<WxFansMsgRespVO> getWxFansMsg(@RequestParam("id") Integer id) {
|
||||||
|
WxFansMsgDO wxFansMsg = wxFansMsgService.getWxFansMsg(id);
|
||||||
|
return success(WxFansMsgConvert.INSTANCE.convert(wxFansMsg));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得粉丝消息表 列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:query')")
|
||||||
|
public CommonResult<List<WxFansMsgRespVO>> getWxFansMsgList(@RequestParam("ids") Collection<Integer> ids) {
|
||||||
|
List<WxFansMsgDO> list = wxFansMsgService.getWxFansMsgList(ids);
|
||||||
|
return success(WxFansMsgConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("获得粉丝消息表 分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:query')")
|
||||||
|
public CommonResult<PageResult<WxFansMsgRespVO>> getWxFansMsgPage(@Valid WxFansMsgPageReqVO pageVO) {
|
||||||
|
PageResult<WxFansMsgDO> pageResult = wxFansMsgService.getWxFansMsgPage(pageVO);
|
||||||
|
return success(WxFansMsgConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出粉丝消息表 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxFansMsgExcel(@Valid WxFansMsgExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxFansMsgDO> list = wxFansMsgService.getWxFansMsgList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxFansMsgExcelVO> datas = WxFansMsgConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "粉丝消息表 .xls", "数据", WxFansMsgExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉丝消息表 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxFansMsgBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户标识")
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "昵称")
|
||||||
|
private byte[] nickname;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像地址")
|
||||||
|
private String headimgUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消息类型")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最近一条回复内容")
|
||||||
|
private String resContent;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已回复")
|
||||||
|
private String isRes;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信图片URL")
|
||||||
|
private String picUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "本地图片路径")
|
||||||
|
private String picPath;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝消息表 创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansMsgCreateReqVO extends WxFansMsgBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉丝消息表 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxFansMsgExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("用户标识")
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
@ExcelProperty("昵称")
|
||||||
|
private byte[] nickname;
|
||||||
|
|
||||||
|
@ExcelProperty("头像地址")
|
||||||
|
private String headimgUrl;
|
||||||
|
|
||||||
|
@ExcelProperty("微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ExcelProperty("消息类型")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ExcelProperty("内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ExcelProperty("最近一条回复内容")
|
||||||
|
private String resContent;
|
||||||
|
|
||||||
|
@ExcelProperty("是否已回复")
|
||||||
|
private String isRes;
|
||||||
|
|
||||||
|
@ExcelProperty("微信素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ExcelProperty("微信图片URL")
|
||||||
|
private String picUrl;
|
||||||
|
|
||||||
|
@ExcelProperty("本地图片路径")
|
||||||
|
private String picPath;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 粉丝消息表 Excel 导出 Request VO", description = "参数和 WxFansMsgPageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxFansMsgExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户标识")
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "昵称")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像地址")
|
||||||
|
private String headimgUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消息类型")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最近一条回复内容")
|
||||||
|
private String resContent;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已回复")
|
||||||
|
private String isRes;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信图片URL")
|
||||||
|
private String picUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "本地图片路径")
|
||||||
|
private String picPath;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝消息表 分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansMsgPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户标识")
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "昵称")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像地址")
|
||||||
|
private String headimgUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消息类型")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最近一条回复内容")
|
||||||
|
private String resContent;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已回复")
|
||||||
|
private String isRes;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信图片URL")
|
||||||
|
private String picUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "本地图片路径")
|
||||||
|
private String picPath;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝消息表 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansMsgRespVO extends WxFansMsgBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝消息表 更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansMsgUpdateReqVO extends WxFansMsgBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.mp.dal.dataobject.fansmsgres.WxFansMsgResDO;
|
||||||
|
import cn.iocoder.yudao.module.mp.convert.fansmsgres.WxFansMsgResConvert;
|
||||||
|
import cn.iocoder.yudao.module.mp.service.fansmsgres.WxFansMsgResService;
|
||||||
|
|
||||||
|
@Api(tags = "管理后台 - 回复粉丝消息历史表 ")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wechatMp/wx-fans-msg-res")
|
||||||
|
@Validated
|
||||||
|
public class WxFansMsgResController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxFansMsgResService wxFansMsgResService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建回复粉丝消息历史表 ")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:create')")
|
||||||
|
public CommonResult<Integer> createWxFansMsgRes(@Valid @RequestBody WxFansMsgResCreateReqVO createReqVO) {
|
||||||
|
return success(wxFansMsgResService.createWxFansMsgRes(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新回复粉丝消息历史表 ")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:update')")
|
||||||
|
public CommonResult<Boolean> updateWxFansMsgRes(@Valid @RequestBody WxFansMsgResUpdateReqVO updateReqVO) {
|
||||||
|
wxFansMsgResService.updateWxFansMsgRes(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除回复粉丝消息历史表 ")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWxFansMsgRes(@RequestParam("id") Integer id) {
|
||||||
|
wxFansMsgResService.deleteWxFansMsgRes(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得回复粉丝消息历史表 ")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:query')")
|
||||||
|
public CommonResult<WxFansMsgResRespVO> getWxFansMsgRes(@RequestParam("id") Integer id) {
|
||||||
|
WxFansMsgResDO wxFansMsgRes = wxFansMsgResService.getWxFansMsgRes(id);
|
||||||
|
return success(WxFansMsgResConvert.INSTANCE.convert(wxFansMsgRes));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得回复粉丝消息历史表 列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:query')")
|
||||||
|
public CommonResult<List<WxFansMsgResRespVO>> getWxFansMsgResList(@RequestParam("ids") Collection<Integer> ids) {
|
||||||
|
List<WxFansMsgResDO> list = wxFansMsgResService.getWxFansMsgResList(ids);
|
||||||
|
return success(WxFansMsgResConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("获得回复粉丝消息历史表 分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:query')")
|
||||||
|
public CommonResult<PageResult<WxFansMsgResRespVO>> getWxFansMsgResPage(@Valid WxFansMsgResPageReqVO pageVO) {
|
||||||
|
PageResult<WxFansMsgResDO> pageResult = wxFansMsgResService.getWxFansMsgResPage(pageVO);
|
||||||
|
return success(WxFansMsgResConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出回复粉丝消息历史表 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-msg-res:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxFansMsgResExcel(@Valid WxFansMsgResExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxFansMsgResDO> list = wxFansMsgResService.getWxFansMsgResList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxFansMsgResExcelVO> datas = WxFansMsgResConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "回复粉丝消息历史表 .xls", "数据", WxFansMsgResExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回复粉丝消息历史表 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxFansMsgResBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "粉丝消息ID")
|
||||||
|
private String fansMsgId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "回复内容")
|
||||||
|
private String resContent;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 回复粉丝消息历史表 创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansMsgResCreateReqVO extends WxFansMsgResBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回复粉丝消息历史表 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxFansMsgResExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("粉丝消息ID")
|
||||||
|
private String fansMsgId;
|
||||||
|
|
||||||
|
@ExcelProperty("回复内容")
|
||||||
|
private String resContent;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 回复粉丝消息历史表 Excel 导出 Request VO", description = "参数和 WxFansMsgResPageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxFansMsgResExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "粉丝消息ID")
|
||||||
|
private String fansMsgId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "回复内容")
|
||||||
|
private String resContent;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 回复粉丝消息历史表 分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansMsgResPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "粉丝消息ID")
|
||||||
|
private String fansMsgId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "回复内容")
|
||||||
|
private String resContent;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 回复粉丝消息历史表 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansMsgResRespVO extends WxFansMsgResBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fansmsgres.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 回复粉丝消息历史表 更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansMsgResUpdateReqVO extends WxFansMsgResBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fanstag;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.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("/wechatMp/wx-fans-tag")
|
||||||
|
@Validated
|
||||||
|
public class WxFansTagController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxFansTagService wxFansTagService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建粉丝标签")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:create')")
|
||||||
|
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 WxFansTagUpdateReqVO updateReqVO) {
|
||||||
|
wxFansTagService.updateWxFansTag(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除粉丝标签")
|
||||||
|
@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) {
|
||||||
|
wxFansTagService.deleteWxFansTag(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得粉丝标签")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:query')")
|
||||||
|
public CommonResult<WxFansTagRespVO> getWxFansTag(@RequestParam("id") Integer id) {
|
||||||
|
WxFansTagDO wxFansTag = wxFansTagService.getWxFansTag(id);
|
||||||
|
return success(WxFansTagConvert.INSTANCE.convert(wxFansTag));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得粉丝标签列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:query')")
|
||||||
|
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<WxFansTagRespVO>> getWxFansTagPage(@Valid WxFansTagPageReqVO pageVO) {
|
||||||
|
PageResult<WxFansTagDO> pageResult = wxFansTagService.getWxFansTagPage(pageVO);
|
||||||
|
return success(WxFansTagConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出粉丝标签 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-fans-tag:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxFansTagExcel(@Valid WxFansTagExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxFansTagDO> list = wxFansTagService.getWxFansTagList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxFansTagExcelVO> datas = WxFansTagConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "粉丝标签.xls", "数据", WxFansTagExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉丝标签 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxFansTagBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标签名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "粉丝数量")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝标签创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansTagCreateReqVO extends WxFansTagBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉丝标签 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxFansTagExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("标签名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ExcelProperty("粉丝数量")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
@ExcelProperty("微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 粉丝标签 Excel 导出 Request VO", description = "参数和 WxFansTagPageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxFansTagExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标签名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "粉丝数量")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝标签分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansTagPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标签名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "粉丝数量")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝标签 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansTagRespVO extends WxFansTagBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.fanstag.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 粉丝标签更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxFansTagUpdateReqVO extends WxFansTagBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.mp.dal.dataobject.mediaupload.WxMediaUploadDO;
|
||||||
|
import cn.iocoder.yudao.module.mp.convert.mediaupload.WxMediaUploadConvert;
|
||||||
|
import cn.iocoder.yudao.module.mp.service.mediaupload.WxMediaUploadService;
|
||||||
|
|
||||||
|
@Api(tags = "管理后台 - 微信素材上传表 ")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wechatMp/wx-media-upload")
|
||||||
|
@Validated
|
||||||
|
public class WxMediaUploadController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxMediaUploadService wxMediaUploadService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建微信素材上传表 ")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:create')")
|
||||||
|
public CommonResult<Integer> createWxMediaUpload(@Valid @RequestBody WxMediaUploadCreateReqVO createReqVO) {
|
||||||
|
return success(wxMediaUploadService.createWxMediaUpload(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新微信素材上传表 ")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:update')")
|
||||||
|
public CommonResult<Boolean> updateWxMediaUpload(@Valid @RequestBody WxMediaUploadUpdateReqVO updateReqVO) {
|
||||||
|
wxMediaUploadService.updateWxMediaUpload(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除微信素材上传表 ")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWxMediaUpload(@RequestParam("id") Integer id) {
|
||||||
|
wxMediaUploadService.deleteWxMediaUpload(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得微信素材上传表 ")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:query')")
|
||||||
|
public CommonResult<WxMediaUploadRespVO> getWxMediaUpload(@RequestParam("id") Integer id) {
|
||||||
|
WxMediaUploadDO wxMediaUpload = wxMediaUploadService.getWxMediaUpload(id);
|
||||||
|
return success(WxMediaUploadConvert.INSTANCE.convert(wxMediaUpload));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得微信素材上传表 列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:query')")
|
||||||
|
public CommonResult<List<WxMediaUploadRespVO>> getWxMediaUploadList(@RequestParam("ids") Collection<Integer> ids) {
|
||||||
|
List<WxMediaUploadDO> list = wxMediaUploadService.getWxMediaUploadList(ids);
|
||||||
|
return success(WxMediaUploadConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("获得微信素材上传表 分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:query')")
|
||||||
|
public CommonResult<PageResult<WxMediaUploadRespVO>> getWxMediaUploadPage(@Valid WxMediaUploadPageReqVO pageVO) {
|
||||||
|
PageResult<WxMediaUploadDO> pageResult = wxMediaUploadService.getWxMediaUploadPage(pageVO);
|
||||||
|
return success(WxMediaUploadConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出微信素材上传表 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-media-upload:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxMediaUploadExcel(@Valid WxMediaUploadExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxMediaUploadDO> list = wxMediaUploadService.getWxMediaUploadList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxMediaUploadExcelVO> datas = WxMediaUploadConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "微信素材上传表 .xls", "数据", WxMediaUploadExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信素材上传表 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxMediaUploadBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片URL")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "缩略图素材ID")
|
||||||
|
private String thumbMediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 微信素材上传表 创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxMediaUploadCreateReqVO extends WxMediaUploadBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信素材上传表 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxMediaUploadExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ExcelProperty("图片URL")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@ExcelProperty("素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ExcelProperty("缩略图素材ID")
|
||||||
|
private String thumbMediaId;
|
||||||
|
|
||||||
|
@ExcelProperty("微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 微信素材上传表 Excel 导出 Request VO", description = "参数和 WxMediaUploadPageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxMediaUploadExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片URL")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "缩略图素材ID")
|
||||||
|
private String thumbMediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 微信素材上传表 分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxMediaUploadPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片URL")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "缩略图素材ID")
|
||||||
|
private String thumbMediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 微信素材上传表 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxMediaUploadRespVO extends WxMediaUploadBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.mediaupload.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 微信素材上传表 更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxMediaUploadUpdateReqVO extends WxMediaUploadBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.menu;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.mp.dal.dataobject.menu.WxMenuDO;
|
||||||
|
import cn.iocoder.yudao.module.mp.convert.menu.WxMenuConvert;
|
||||||
|
import cn.iocoder.yudao.module.mp.service.menu.WxMenuService;
|
||||||
|
|
||||||
|
@Api(tags = "管理后台 - 微信菜单")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wechatMp/wx-menu")
|
||||||
|
@Validated
|
||||||
|
public class WxMenuController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxMenuService wxMenuService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建微信菜单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:create')")
|
||||||
|
public CommonResult<Integer> createWxMenu(@Valid @RequestBody WxMenuCreateReqVO createReqVO) {
|
||||||
|
return success(wxMenuService.createWxMenu(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新微信菜单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:update')")
|
||||||
|
public CommonResult<Boolean> updateWxMenu(@Valid @RequestBody WxMenuUpdateReqVO updateReqVO) {
|
||||||
|
wxMenuService.updateWxMenu(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除微信菜单")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWxMenu(@RequestParam("id") Integer id) {
|
||||||
|
wxMenuService.deleteWxMenu(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得微信菜单")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:query')")
|
||||||
|
public CommonResult<WxMenuRespVO> getWxMenu(@RequestParam("id") Integer id) {
|
||||||
|
WxMenuDO wxMenu = wxMenuService.getWxMenu(id);
|
||||||
|
return success(WxMenuConvert.INSTANCE.convert(wxMenu));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得微信菜单列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:query')")
|
||||||
|
public CommonResult<List<WxMenuRespVO>> getWxMenuList(@RequestParam("ids") Collection<Integer> ids) {
|
||||||
|
List<WxMenuDO> list = wxMenuService.getWxMenuList(ids);
|
||||||
|
return success(WxMenuConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("获得微信菜单分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:query')")
|
||||||
|
public CommonResult<PageResult<WxMenuRespVO>> getWxMenuPage(@Valid WxMenuPageReqVO pageVO) {
|
||||||
|
PageResult<WxMenuDO> pageResult = wxMenuService.getWxMenuPage(pageVO);
|
||||||
|
return success(WxMenuConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出微信菜单 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxMenuExcel(@Valid WxMenuExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxMenuDO> list = wxMenuService.getWxMenuList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxMenuExcelVO> datas = WxMenuConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "微信菜单.xls", "数据", WxMenuExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.menu.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信菜单 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxMenuBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父ID")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单名称")
|
||||||
|
private String menuName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单类型 1文本消息;2图文消息;3网址链接;4小程序")
|
||||||
|
private String menuType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单等级")
|
||||||
|
private String menuLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单URL")
|
||||||
|
private String menuUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private String menuSort;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序appid")
|
||||||
|
private String miniprogramAppid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序页面路径")
|
||||||
|
private String miniprogramPagepath;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.menu.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 微信菜单创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxMenuCreateReqVO extends WxMenuBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.menu.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信菜单 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxMenuExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("父ID")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
@ExcelProperty("菜单名称")
|
||||||
|
private String menuName;
|
||||||
|
|
||||||
|
@ExcelProperty("菜单类型 1文本消息;2图文消息;3网址链接;4小程序")
|
||||||
|
private String menuType;
|
||||||
|
|
||||||
|
@ExcelProperty("菜单等级")
|
||||||
|
private String menuLevel;
|
||||||
|
|
||||||
|
@ExcelProperty("模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ExcelProperty("菜单URL")
|
||||||
|
private String menuUrl;
|
||||||
|
|
||||||
|
@ExcelProperty("排序")
|
||||||
|
private String menuSort;
|
||||||
|
|
||||||
|
@ExcelProperty("微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ExcelProperty("小程序appid")
|
||||||
|
private String miniprogramAppid;
|
||||||
|
|
||||||
|
@ExcelProperty("小程序页面路径")
|
||||||
|
private String miniprogramPagepath;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.menu.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 微信菜单 Excel 导出 Request VO", description = "参数和 WxMenuPageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxMenuExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父ID")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单名称")
|
||||||
|
private String menuName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单类型 1文本消息;2图文消息;3网址链接;4小程序")
|
||||||
|
private String menuType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单等级")
|
||||||
|
private String menuLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单URL")
|
||||||
|
private String menuUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private String menuSort;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序appid")
|
||||||
|
private String miniprogramAppid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序页面路径")
|
||||||
|
private String miniprogramPagepath;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.menu.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 微信菜单分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxMenuPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父ID")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单名称")
|
||||||
|
private String menuName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单类型 1文本消息;2图文消息;3网址链接;4小程序")
|
||||||
|
private String menuType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单等级")
|
||||||
|
private String menuLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单URL")
|
||||||
|
private String menuUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private String menuSort;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序appid")
|
||||||
|
private String miniprogramAppid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序页面路径")
|
||||||
|
private String miniprogramPagepath;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.menu.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 微信菜单 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxMenuRespVO extends WxMenuBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.menu.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 微信菜单更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxMenuUpdateReqVO extends WxMenuBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newsarticleitem;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.newsarticleitem.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.mp.dal.dataobject.newsarticleitem.WxNewsArticleItemDO;
|
||||||
|
import cn.iocoder.yudao.module.mp.convert.newsarticleitem.WxNewsArticleItemConvert;
|
||||||
|
import cn.iocoder.yudao.module.mp.service.newsarticleitem.WxNewsArticleItemService;
|
||||||
|
|
||||||
|
@Api(tags = "管理后台 - 图文消息文章列表表 ")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wechatMp/wx-news-article-item")
|
||||||
|
@Validated
|
||||||
|
public class WxNewsArticleItemController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxNewsArticleItemService wxNewsArticleItemService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建图文消息文章列表表 ")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-article-item:create')")
|
||||||
|
public CommonResult<Integer> createWxNewsArticleItem(@Valid @RequestBody WxNewsArticleItemCreateReqVO createReqVO) {
|
||||||
|
return success(wxNewsArticleItemService.createWxNewsArticleItem(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新图文消息文章列表表 ")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-article-item:update')")
|
||||||
|
public CommonResult<Boolean> updateWxNewsArticleItem(@Valid @RequestBody WxNewsArticleItemUpdateReqVO updateReqVO) {
|
||||||
|
wxNewsArticleItemService.updateWxNewsArticleItem(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除图文消息文章列表表 ")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-article-item:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWxNewsArticleItem(@RequestParam("id") Integer id) {
|
||||||
|
wxNewsArticleItemService.deleteWxNewsArticleItem(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得图文消息文章列表表 ")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-article-item:query')")
|
||||||
|
public CommonResult<WxNewsArticleItemRespVO> getWxNewsArticleItem(@RequestParam("id") Integer id) {
|
||||||
|
WxNewsArticleItemDO wxNewsArticleItem = wxNewsArticleItemService.getWxNewsArticleItem(id);
|
||||||
|
return success(WxNewsArticleItemConvert.INSTANCE.convert(wxNewsArticleItem));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得图文消息文章列表表 列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-article-item:query')")
|
||||||
|
public CommonResult<List<WxNewsArticleItemRespVO>> getWxNewsArticleItemList(@RequestParam("ids") Collection<Integer> ids) {
|
||||||
|
List<WxNewsArticleItemDO> list = wxNewsArticleItemService.getWxNewsArticleItemList(ids);
|
||||||
|
return success(WxNewsArticleItemConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("获得图文消息文章列表表 分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-article-item:query')")
|
||||||
|
public CommonResult<PageResult<WxNewsArticleItemRespVO>> getWxNewsArticleItemPage(@Valid WxNewsArticleItemPageReqVO pageVO) {
|
||||||
|
PageResult<WxNewsArticleItemDO> pageResult = wxNewsArticleItemService.getWxNewsArticleItemPage(pageVO);
|
||||||
|
return success(WxNewsArticleItemConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出图文消息文章列表表 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-article-item:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxNewsArticleItemExcel(@Valid WxNewsArticleItemExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxNewsArticleItemDO> list = wxNewsArticleItemService.getWxNewsArticleItemList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxNewsArticleItemExcelVO> datas = WxNewsArticleItemConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "图文消息文章列表表 .xls", "数据", WxNewsArticleItemExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newsarticleitem.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文消息文章列表表 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxNewsArticleItemBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "摘要")
|
||||||
|
private String digest;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者")
|
||||||
|
private String author;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否展示封面图片(0/1)")
|
||||||
|
private String showCoverPic;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上传微信,封面图片标识")
|
||||||
|
private String thumbMediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容链接")
|
||||||
|
private String contentSourceUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章排序")
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片路径")
|
||||||
|
private String picPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否可以留言")
|
||||||
|
private String needOpenComment;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否仅粉丝可以留言")
|
||||||
|
private String onlyFansCanComment;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图文ID")
|
||||||
|
private String newsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newsarticleitem.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 图文消息文章列表表 创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxNewsArticleItemCreateReqVO extends WxNewsArticleItemBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newsarticleitem.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文消息文章列表表 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxNewsArticleItemExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ExcelProperty("摘要")
|
||||||
|
private String digest;
|
||||||
|
|
||||||
|
@ExcelProperty("作者")
|
||||||
|
private String author;
|
||||||
|
|
||||||
|
@ExcelProperty("是否展示封面图片(0/1)")
|
||||||
|
private String showCoverPic;
|
||||||
|
|
||||||
|
@ExcelProperty("上传微信,封面图片标识")
|
||||||
|
private String thumbMediaId;
|
||||||
|
|
||||||
|
@ExcelProperty("内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ExcelProperty("内容链接")
|
||||||
|
private String contentSourceUrl;
|
||||||
|
|
||||||
|
@ExcelProperty("文章排序")
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
@ExcelProperty("图片路径")
|
||||||
|
private String picPath;
|
||||||
|
|
||||||
|
@ExcelProperty("是否可以留言")
|
||||||
|
private String needOpenComment;
|
||||||
|
|
||||||
|
@ExcelProperty("是否仅粉丝可以留言")
|
||||||
|
private String onlyFansCanComment;
|
||||||
|
|
||||||
|
@ExcelProperty("图文ID")
|
||||||
|
private String newsId;
|
||||||
|
|
||||||
|
@ExcelProperty("微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newsarticleitem.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 图文消息文章列表表 Excel 导出 Request VO", description = "参数和 WxNewsArticleItemPageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxNewsArticleItemExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "摘要")
|
||||||
|
private String digest;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者")
|
||||||
|
private String author;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否展示封面图片(0/1)")
|
||||||
|
private String showCoverPic;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上传微信,封面图片标识")
|
||||||
|
private String thumbMediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容链接")
|
||||||
|
private String contentSourceUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章排序")
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片路径")
|
||||||
|
private String picPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否可以留言")
|
||||||
|
private String needOpenComment;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否仅粉丝可以留言")
|
||||||
|
private String onlyFansCanComment;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图文ID")
|
||||||
|
private String newsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newsarticleitem.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 图文消息文章列表表 分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxNewsArticleItemPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "摘要")
|
||||||
|
private String digest;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者")
|
||||||
|
private String author;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否展示封面图片(0/1)")
|
||||||
|
private String showCoverPic;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上传微信,封面图片标识")
|
||||||
|
private String thumbMediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容链接")
|
||||||
|
private String contentSourceUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章排序")
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片路径")
|
||||||
|
private String picPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否可以留言")
|
||||||
|
private String needOpenComment;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否仅粉丝可以留言")
|
||||||
|
private String onlyFansCanComment;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图文ID")
|
||||||
|
private String newsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newsarticleitem.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 图文消息文章列表表 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxNewsArticleItemRespVO extends WxNewsArticleItemBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newsarticleitem.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 图文消息文章列表表 更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxNewsArticleItemUpdateReqVO extends WxNewsArticleItemBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newstemplate;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.newstemplate.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.mp.dal.dataobject.newstemplate.WxNewsTemplateDO;
|
||||||
|
import cn.iocoder.yudao.module.mp.convert.newstemplate.WxNewsTemplateConvert;
|
||||||
|
import cn.iocoder.yudao.module.mp.service.newstemplate.WxNewsTemplateService;
|
||||||
|
|
||||||
|
@Api(tags = "管理后台 - 图文消息模板")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wechatMp/wx-news-template")
|
||||||
|
@Validated
|
||||||
|
public class WxNewsTemplateController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxNewsTemplateService wxNewsTemplateService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建图文消息模板")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-template:create')")
|
||||||
|
public CommonResult<Integer> createWxNewsTemplate(@Valid @RequestBody WxNewsTemplateCreateReqVO createReqVO) {
|
||||||
|
return success(wxNewsTemplateService.createWxNewsTemplate(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新图文消息模板")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-template:update')")
|
||||||
|
public CommonResult<Boolean> updateWxNewsTemplate(@Valid @RequestBody WxNewsTemplateUpdateReqVO updateReqVO) {
|
||||||
|
wxNewsTemplateService.updateWxNewsTemplate(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除图文消息模板")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-template:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWxNewsTemplate(@RequestParam("id") Integer id) {
|
||||||
|
wxNewsTemplateService.deleteWxNewsTemplate(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得图文消息模板")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-template:query')")
|
||||||
|
public CommonResult<WxNewsTemplateRespVO> getWxNewsTemplate(@RequestParam("id") Integer id) {
|
||||||
|
WxNewsTemplateDO wxNewsTemplate = wxNewsTemplateService.getWxNewsTemplate(id);
|
||||||
|
return success(WxNewsTemplateConvert.INSTANCE.convert(wxNewsTemplate));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得图文消息模板列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-template:query')")
|
||||||
|
public CommonResult<List<WxNewsTemplateRespVO>> getWxNewsTemplateList(@RequestParam("ids") Collection<Integer> ids) {
|
||||||
|
List<WxNewsTemplateDO> list = wxNewsTemplateService.getWxNewsTemplateList(ids);
|
||||||
|
return success(WxNewsTemplateConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("获得图文消息模板分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-template:query')")
|
||||||
|
public CommonResult<PageResult<WxNewsTemplateRespVO>> getWxNewsTemplatePage(@Valid WxNewsTemplatePageReqVO pageVO) {
|
||||||
|
PageResult<WxNewsTemplateDO> pageResult = wxNewsTemplateService.getWxNewsTemplatePage(pageVO);
|
||||||
|
return success(WxNewsTemplateConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出图文消息模板 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-news-template:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxNewsTemplateExcel(@Valid WxNewsTemplateExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxNewsTemplateDO> list = wxNewsTemplateService.getWxNewsTemplateList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxNewsTemplateExcelVO> datas = WxNewsTemplateConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "图文消息模板.xls", "数据", WxNewsTemplateExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newstemplate.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文消息模板 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxNewsTemplateBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板名称")
|
||||||
|
private String tplName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已上传微信")
|
||||||
|
private String isUpload;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newstemplate.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 图文消息模板创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxNewsTemplateCreateReqVO extends WxNewsTemplateBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newstemplate.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文消息模板 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxNewsTemplateExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键 主键ID")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("模板名称")
|
||||||
|
private String tplName;
|
||||||
|
|
||||||
|
@ExcelProperty("是否已上传微信")
|
||||||
|
private String isUpload;
|
||||||
|
|
||||||
|
@ExcelProperty("素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ExcelProperty("微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newstemplate.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 图文消息模板 Excel 导出 Request VO", description = "参数和 WxNewsTemplatePageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxNewsTemplateExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板名称")
|
||||||
|
private String tplName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已上传微信")
|
||||||
|
private String isUpload;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newstemplate.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 图文消息模板分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxNewsTemplatePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板名称")
|
||||||
|
private String tplName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已上传微信")
|
||||||
|
private String isUpload;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "素材ID")
|
||||||
|
private String mediaId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newstemplate.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 图文消息模板 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxNewsTemplateRespVO extends WxNewsTemplateBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键 主键ID", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.newstemplate.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 图文消息模板更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxNewsTemplateUpdateReqVO extends WxNewsTemplateBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键 主键ID", required = true)
|
||||||
|
@NotNull(message = "主键 主键ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.receivetext;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.mp.dal.dataobject.receivetext.WxReceiveTextDO;
|
||||||
|
import cn.iocoder.yudao.module.mp.convert.receivetext.WxReceiveTextConvert;
|
||||||
|
import cn.iocoder.yudao.module.mp.service.receivetext.WxReceiveTextService;
|
||||||
|
|
||||||
|
@Api(tags = "管理后台 - 回复关键字")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wechatMp/wx-receive-text")
|
||||||
|
@Validated
|
||||||
|
public class WxReceiveTextController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxReceiveTextService wxReceiveTextService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建回复关键字")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:create')")
|
||||||
|
public CommonResult<Integer> createWxReceiveText(@Valid @RequestBody WxReceiveTextCreateReqVO createReqVO) {
|
||||||
|
return success(wxReceiveTextService.createWxReceiveText(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新回复关键字")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:update')")
|
||||||
|
public CommonResult<Boolean> updateWxReceiveText(@Valid @RequestBody WxReceiveTextUpdateReqVO updateReqVO) {
|
||||||
|
wxReceiveTextService.updateWxReceiveText(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除回复关键字")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWxReceiveText(@RequestParam("id") Integer id) {
|
||||||
|
wxReceiveTextService.deleteWxReceiveText(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得回复关键字")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:query')")
|
||||||
|
public CommonResult<WxReceiveTextRespVO> getWxReceiveText(@RequestParam("id") Integer id) {
|
||||||
|
WxReceiveTextDO wxReceiveText = wxReceiveTextService.getWxReceiveText(id);
|
||||||
|
return success(WxReceiveTextConvert.INSTANCE.convert(wxReceiveText));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得回复关键字列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:query')")
|
||||||
|
public CommonResult<List<WxReceiveTextRespVO>> getWxReceiveTextList(@RequestParam("ids") Collection<Integer> ids) {
|
||||||
|
List<WxReceiveTextDO> list = wxReceiveTextService.getWxReceiveTextList(ids);
|
||||||
|
return success(WxReceiveTextConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("获得回复关键字分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:query')")
|
||||||
|
public CommonResult<PageResult<WxReceiveTextRespVO>> getWxReceiveTextPage(@Valid WxReceiveTextPageReqVO pageVO) {
|
||||||
|
PageResult<WxReceiveTextDO> pageResult = wxReceiveTextService.getWxReceiveTextPage(pageVO);
|
||||||
|
return success(WxReceiveTextConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出回复关键字 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-receive-text:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxReceiveTextExcel(@Valid WxReceiveTextExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxReceiveTextDO> list = wxReceiveTextService.getWxReceiveTextList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxReceiveTextExcelVO> datas = WxReceiveTextConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "回复关键字.xls", "数据", WxReceiveTextExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回复关键字 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxReceiveTextBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String receiveText;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消息类型 1文本消息;2图文消息;")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 回复关键字创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxReceiveTextCreateReqVO extends WxReceiveTextBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回复关键字 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxReceiveTextExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("关键字")
|
||||||
|
private String receiveText;
|
||||||
|
|
||||||
|
@ExcelProperty("消息类型 1文本消息;2图文消息;")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ExcelProperty("模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ExcelProperty("微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 回复关键字 Excel 导出 Request VO", description = "参数和 WxReceiveTextPageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxReceiveTextExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String receiveText;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消息类型 1文本消息;2图文消息;")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 回复关键字分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxReceiveTextPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String receiveText;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消息类型 1文本消息;2图文消息;")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 回复关键字 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxReceiveTextRespVO extends WxReceiveTextBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.receivetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 回复关键字更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxReceiveTextUpdateReqVO extends WxReceiveTextBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.subscribetext;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.mp.dal.dataobject.subscribetext.WxSubscribeTextDO;
|
||||||
|
import cn.iocoder.yudao.module.mp.convert.subscribetext.WxSubscribeTextConvert;
|
||||||
|
import cn.iocoder.yudao.module.mp.service.subscribetext.WxSubscribeTextService;
|
||||||
|
|
||||||
|
@Api(tags = "管理后台 - 关注欢迎语")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wechatMp/wx-subscribe-text")
|
||||||
|
@Validated
|
||||||
|
public class WxSubscribeTextController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WxSubscribeTextService wxSubscribeTextService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@ApiOperation("创建关注欢迎语")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-subscribe-text:create')")
|
||||||
|
public CommonResult<Integer> createWxSubscribeText(@Valid @RequestBody WxSubscribeTextCreateReqVO createReqVO) {
|
||||||
|
return success(wxSubscribeTextService.createWxSubscribeText(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@ApiOperation("更新关注欢迎语")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-subscribe-text:update')")
|
||||||
|
public CommonResult<Boolean> updateWxSubscribeText(@Valid @RequestBody WxSubscribeTextUpdateReqVO updateReqVO) {
|
||||||
|
wxSubscribeTextService.updateWxSubscribeText(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ApiOperation("删除关注欢迎语")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-subscribe-text:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWxSubscribeText(@RequestParam("id") Integer id) {
|
||||||
|
wxSubscribeTextService.deleteWxSubscribeText(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@ApiOperation("获得关注欢迎语")
|
||||||
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-subscribe-text:query')")
|
||||||
|
public CommonResult<WxSubscribeTextRespVO> getWxSubscribeText(@RequestParam("id") Integer id) {
|
||||||
|
WxSubscribeTextDO wxSubscribeText = wxSubscribeTextService.getWxSubscribeText(id);
|
||||||
|
return success(WxSubscribeTextConvert.INSTANCE.convert(wxSubscribeText));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获得关注欢迎语列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-subscribe-text:query')")
|
||||||
|
public CommonResult<List<WxSubscribeTextRespVO>> getWxSubscribeTextList(@RequestParam("ids") Collection<Integer> ids) {
|
||||||
|
List<WxSubscribeTextDO> list = wxSubscribeTextService.getWxSubscribeTextList(ids);
|
||||||
|
return success(WxSubscribeTextConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("获得关注欢迎语分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-subscribe-text:query')")
|
||||||
|
public CommonResult<PageResult<WxSubscribeTextRespVO>> getWxSubscribeTextPage(@Valid WxSubscribeTextPageReqVO pageVO) {
|
||||||
|
PageResult<WxSubscribeTextDO> pageResult = wxSubscribeTextService.getWxSubscribeTextPage(pageVO);
|
||||||
|
return success(WxSubscribeTextConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@ApiOperation("导出关注欢迎语 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('wechatMp:wx-subscribe-text:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWxSubscribeTextExcel(@Valid WxSubscribeTextExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<WxSubscribeTextDO> list = wxSubscribeTextService.getWxSubscribeTextList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<WxSubscribeTextExcelVO> datas = WxSubscribeTextConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "关注欢迎语.xls", "数据", WxSubscribeTextExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关注欢迎语 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||||
|
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxSubscribeTextBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消息类型 1文本消息;2图文消息;")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 关注欢迎语创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxSubscribeTextCreateReqVO extends WxSubscribeTextBaseVO {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关注欢迎语 Excel VO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WxSubscribeTextExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ExcelProperty("消息类型 1文本消息;2图文消息;")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ExcelProperty("模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ExcelProperty("微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel(value = "管理后台 - 关注欢迎语 Excel 导出 Request VO", description = "参数和 WxSubscribeTextPageReqVO 是一致的")
|
||||||
|
@Data
|
||||||
|
public class WxSubscribeTextExportReqVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消息类型 1文本消息;2图文消息;")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 关注欢迎语分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxSubscribeTextPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消息类型 1文本消息;2图文消息;")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板ID")
|
||||||
|
private String tplId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信账号ID")
|
||||||
|
private String wxAccountId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "开始创建时间")
|
||||||
|
private Date beginCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@ApiModelProperty(value = "结束创建时间")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 关注欢迎语 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxSubscribeTextRespVO extends WxSubscribeTextBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 关注欢迎语更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WxSubscribeTextUpdateReqVO extends WxSubscribeTextBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user