Commit 627cb3951743e1c12ff0de1ce18c98d3f42c1e0c
1 parent
48520a45
mp:完善公众号的账号管理
Showing
24 changed files
with
188 additions
and
403 deletions
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/WxAccountController.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/MpAccountController.java
| ... | ... | @@ -2,11 +2,9 @@ package cn.iocoder.yudao.module.mp.controller.admin.account; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | |
| 6 | -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | |
| 7 | 5 | import cn.iocoder.yudao.module.mp.controller.admin.account.vo.*; |
| 8 | -import cn.iocoder.yudao.module.mp.convert.account.WxAccountConvert; | |
| 9 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 6 | +import cn.iocoder.yudao.module.mp.convert.account.MpAccountConvert; | |
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 10 | 8 | import cn.iocoder.yudao.module.mp.service.account.WxAccountService; |
| 11 | 9 | import io.swagger.annotations.Api; |
| 12 | 10 | import io.swagger.annotations.ApiImplicitParam; |
| ... | ... | @@ -16,87 +14,58 @@ import org.springframework.validation.annotation.Validated; |
| 16 | 14 | import org.springframework.web.bind.annotation.*; |
| 17 | 15 | |
| 18 | 16 | import javax.annotation.Resource; |
| 19 | -import javax.servlet.http.HttpServletResponse; | |
| 20 | 17 | import javax.validation.Valid; |
| 21 | -import java.io.IOException; | |
| 22 | -import java.util.Collection; | |
| 23 | -import java.util.List; | |
| 24 | 18 | |
| 25 | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 26 | -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | |
| 27 | 20 | |
| 28 | -/** | |
| 29 | - * @author fengdan | |
| 30 | - */ | |
| 31 | 21 | @Api(tags = "管理后台 - 公众号账户") |
| 32 | 22 | @RestController |
| 33 | -@RequestMapping("/wechatMp/account") | |
| 23 | +@RequestMapping("/mp/account") | |
| 34 | 24 | @Validated |
| 35 | -public class WxAccountController { | |
| 25 | +public class MpAccountController { | |
| 36 | 26 | |
| 37 | 27 | @Resource |
| 38 | 28 | private WxAccountService wxAccountService; |
| 39 | 29 | |
| 40 | 30 | @PostMapping("/create") |
| 41 | 31 | @ApiOperation("创建公众号账户") |
| 42 | - @PreAuthorize("@ss.hasPermission('wechatMp:account:create')") | |
| 43 | - public CommonResult<Long> createWxAccount(@Valid @RequestBody WxAccountCreateReqVO createReqVO) { | |
| 44 | - return success(wxAccountService.createWxAccount(createReqVO)); | |
| 32 | + @PreAuthorize("@ss.hasPermission('mp:account:create')") | |
| 33 | + public CommonResult<Long> createWxAccount(@Valid @RequestBody MpAccountCreateReqVO createReqVO) { | |
| 34 | + return success(wxAccountService.createAccount(createReqVO)); | |
| 45 | 35 | } |
| 46 | 36 | |
| 47 | 37 | @PutMapping("/update") |
| 48 | 38 | @ApiOperation("更新公众号账户") |
| 49 | - @PreAuthorize("@ss.hasPermission('wechatMp:account:update')") | |
| 50 | - public CommonResult<Boolean> updateWxAccount(@Valid @RequestBody WxAccountUpdateReqVO updateReqVO) { | |
| 51 | - wxAccountService.updateWxAccount(updateReqVO); | |
| 39 | + @PreAuthorize("@ss.hasPermission('mp:account:update')") | |
| 40 | + public CommonResult<Boolean> updateWxAccount(@Valid @RequestBody MpAccountUpdateReqVO updateReqVO) { | |
| 41 | + wxAccountService.updateAccount(updateReqVO); | |
| 52 | 42 | return success(true); |
| 53 | 43 | } |
| 54 | 44 | |
| 55 | 45 | @DeleteMapping("/delete") |
| 56 | 46 | @ApiOperation("删除公众号账户") |
| 57 | 47 | @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) |
| 58 | - @PreAuthorize("@ss.hasPermission('wechatMp:account:delete')") | |
| 48 | + @PreAuthorize("@ss.hasPermission('mp:account:delete')") | |
| 59 | 49 | public CommonResult<Boolean> deleteWxAccount(@RequestParam("id") Long id) { |
| 60 | - wxAccountService.deleteWxAccount(id); | |
| 50 | + wxAccountService.deleteAccount(id); | |
| 61 | 51 | return success(true); |
| 62 | 52 | } |
| 63 | 53 | |
| 64 | 54 | @GetMapping("/get") |
| 65 | 55 | @ApiOperation("获得公众号账户") |
| 66 | 56 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) |
| 67 | - @PreAuthorize("@ss.hasPermission('wechatMp:account:query')") | |
| 68 | - public CommonResult<WxAccountRespVO> getWxAccount(@RequestParam("id") Long id) { | |
| 69 | - WxAccountDO wxAccount = wxAccountService.getWxAccount(id); | |
| 70 | - return success(WxAccountConvert.INSTANCE.convert(wxAccount)); | |
| 71 | - } | |
| 72 | - | |
| 73 | - @GetMapping("/list") | |
| 74 | - @ApiOperation("获得公众号账户列表") | |
| 75 | - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) | |
| 76 | - @PreAuthorize("@ss.hasPermission('wechatMp:account:query')") | |
| 77 | - public CommonResult<List<WxAccountRespVO>> getWxAccountList(@RequestParam("ids") Collection<Long> ids) { | |
| 78 | - List<WxAccountDO> list = wxAccountService.getWxAccountList(ids); | |
| 79 | - return success(WxAccountConvert.INSTANCE.convertList(list)); | |
| 57 | + @PreAuthorize("@ss.hasPermission('mp:account:query')") | |
| 58 | + public CommonResult<MpAccountRespVO> getWxAccount(@RequestParam("id") Long id) { | |
| 59 | + MpAccountDO wxAccount = wxAccountService.getAccount(id); | |
| 60 | + return success(MpAccountConvert.INSTANCE.convert(wxAccount)); | |
| 80 | 61 | } |
| 81 | 62 | |
| 82 | 63 | @GetMapping("/page") |
| 83 | 64 | @ApiOperation("获得公众号账户分页") |
| 84 | - @PreAuthorize("@ss.hasPermission('wechatMp:account:query')") | |
| 85 | - public CommonResult<PageResult<WxAccountRespVO>> getWxAccountPage(@Valid WxAccountPageReqVO pageVO) { | |
| 86 | - PageResult<WxAccountDO> pageResult = wxAccountService.getWxAccountPage(pageVO); | |
| 87 | - return success(WxAccountConvert.INSTANCE.convertPage(pageResult)); | |
| 88 | - } | |
| 89 | - | |
| 90 | - @GetMapping("/export-excel") | |
| 91 | - @ApiOperation("导出公众号账户 Excel") | |
| 92 | - @PreAuthorize("@ss.hasPermission('wechatMp:account:export')") | |
| 93 | - @OperateLog(type = EXPORT) | |
| 94 | - public void exportWxAccountExcel(@Valid WxAccountExportReqVO exportReqVO, | |
| 95 | - HttpServletResponse response) throws IOException { | |
| 96 | - List<WxAccountDO> list = wxAccountService.getWxAccountList(exportReqVO); | |
| 97 | - // 导出 Excel | |
| 98 | - List<WxAccountExcelVO> datas = WxAccountConvert.INSTANCE.convertList02(list); | |
| 99 | - ExcelUtils.write(response, "公众号账户.xls", "数据", WxAccountExcelVO.class, datas); | |
| 65 | + @PreAuthorize("@ss.hasPermission('mp:account:query')") | |
| 66 | + public CommonResult<PageResult<MpAccountRespVO>> getWxAccountPage(@Valid MpAccountPageReqVO pageVO) { | |
| 67 | + PageResult<MpAccountDO> pageResult = wxAccountService.getAccountPage(pageVO); | |
| 68 | + return success(MpAccountConvert.INSTANCE.convertPage(pageResult)); | |
| 100 | 69 | } |
| 101 | 70 | |
| 102 | 71 | } | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountBaseVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java
| ... | ... | @@ -12,7 +12,7 @@ import javax.validation.constraints.NotNull; |
| 12 | 12 | * @author fengdan |
| 13 | 13 | */ |
| 14 | 14 | @Data |
| 15 | -public class WxAccountBaseVO { | |
| 15 | +public class MpAccountBaseVO { | |
| 16 | 16 | |
| 17 | 17 | @ApiModelProperty(value = "公众号名称", required = true) |
| 18 | 18 | @NotNull(message = "公众号名称不能为空") |
| ... | ... | @@ -22,15 +22,15 @@ public class WxAccountBaseVO { |
| 22 | 22 | @NotNull(message = "公众号账户不能为空") |
| 23 | 23 | private String account; |
| 24 | 24 | |
| 25 | - @ApiModelProperty(value = "公众号appid", required = true) | |
| 26 | - @NotNull(message = "公众号appid不能为空") | |
| 25 | + @ApiModelProperty(value = "公众号 appid", required = true) | |
| 26 | + @NotNull(message = "公众号 appid 不能为空") | |
| 27 | 27 | private String appId; |
| 28 | 28 | |
| 29 | 29 | @ApiModelProperty(value = "公众号密钥", required = true) |
| 30 | 30 | @NotNull(message = "公众号密钥不能为空") |
| 31 | 31 | private String appSecret; |
| 32 | 32 | |
| 33 | - @ApiModelProperty(value = "公众号token") | |
| 33 | + @ApiModelProperty(value = "公众号 token", required = true) | |
| 34 | 34 | private String token; |
| 35 | 35 | |
| 36 | 36 | @ApiModelProperty(value = "加密密钥") | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountCreateReqVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountCreateReqVO.java
| ... | ... | @@ -5,13 +5,10 @@ import lombok.Data; |
| 5 | 5 | import lombok.EqualsAndHashCode; |
| 6 | 6 | import lombok.ToString; |
| 7 | 7 | |
| 8 | -/** | |
| 9 | - * @author fengdan | |
| 10 | - */ | |
| 11 | 8 | @ApiModel("管理后台 - 公众号账户创建 Request VO") |
| 12 | 9 | @Data |
| 13 | 10 | @EqualsAndHashCode(callSuper = true) |
| 14 | 11 | @ToString(callSuper = true) |
| 15 | -public class WxAccountCreateReqVO extends WxAccountBaseVO { | |
| 12 | +public class MpAccountCreateReqVO extends MpAccountBaseVO { | |
| 16 | 13 | |
| 17 | 14 | } | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountPageReqVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountPageReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | -import java.util.*; | |
| 5 | 4 | import io.swagger.annotations.*; |
| 6 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 7 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | 6 | |
| 9 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * @author fengdan | |
| 13 | - */ | |
| 14 | 7 | @ApiModel("管理后台 - 公众号账户分页 Request VO") |
| 15 | 8 | @Data |
| 16 | 9 | @EqualsAndHashCode(callSuper = true) |
| 17 | 10 | @ToString(callSuper = true) |
| 18 | -public class WxAccountPageReqVO extends PageParam { | |
| 19 | - @ApiModelProperty(value = "公众号名称") | |
| 11 | +public class MpAccountPageReqVO extends PageParam { | |
| 12 | + | |
| 13 | + @ApiModelProperty(value = "公众号名称", notes = "模糊匹配") | |
| 20 | 14 | private String name; |
| 21 | 15 | |
| 22 | - @ApiModelProperty(value = "公众号账户") | |
| 16 | + @ApiModelProperty(value = "公众号账户", notes = "模糊匹配") | |
| 23 | 17 | private String account; |
| 24 | 18 | |
| 25 | - @ApiModelProperty(value = "公众号appid") | |
| 19 | + @ApiModelProperty(value = "公众号 appid", notes = "模糊匹配") | |
| 26 | 20 | private String appId; |
| 27 | 21 | |
| 28 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 29 | - @ApiModelProperty(value = "开始创建时间") | |
| 30 | - private Date beginCreateTime; | |
| 31 | - | |
| 32 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 33 | - @ApiModelProperty(value = "结束创建时间") | |
| 34 | - private Date endCreateTime; | |
| 35 | 22 | } | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountRespVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountRespVO.java
| ... | ... | @@ -15,14 +15,11 @@ import java.util.Date; |
| 15 | 15 | @Data |
| 16 | 16 | @EqualsAndHashCode(callSuper = true) |
| 17 | 17 | @ToString(callSuper = true) |
| 18 | -public class WxAccountRespVO extends WxAccountBaseVO { | |
| 18 | +public class MpAccountRespVO extends MpAccountBaseVO { | |
| 19 | 19 | |
| 20 | 20 | @ApiModelProperty(value = "编号", required = true) |
| 21 | 21 | private Long id; |
| 22 | 22 | |
| 23 | - @ApiModelProperty(value = "公众号url") | |
| 24 | - private String url; | |
| 25 | - | |
| 26 | 23 | @ApiModelProperty(value = "二维码图片URL") |
| 27 | 24 | private String qrCodeUrl; |
| 28 | 25 | |
| ... | ... | @@ -31,4 +28,5 @@ public class WxAccountRespVO extends WxAccountBaseVO { |
| 31 | 28 | |
| 32 | 29 | @ApiModelProperty(value = "公众号密钥", required = true) |
| 33 | 30 | private String appSecret; |
| 31 | + | |
| 34 | 32 | } | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountUpdateReqVO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountUpdateReqVO.java
| ... | ... | @@ -11,7 +11,7 @@ import javax.validation.constraints.*; |
| 11 | 11 | @Data |
| 12 | 12 | @EqualsAndHashCode(callSuper = true) |
| 13 | 13 | @ToString(callSuper = true) |
| 14 | -public class WxAccountUpdateReqVO extends WxAccountBaseVO { | |
| 14 | +public class MpAccountUpdateReqVO extends MpAccountBaseVO { | |
| 15 | 15 | |
| 16 | 16 | @ApiModelProperty(value = "编号", required = true) |
| 17 | 17 | @NotNull(message = "编号不能为空") | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | |
| 2 | - | |
| 3 | -import com.alibaba.excel.annotation.ExcelProperty; | |
| 4 | -import lombok.Data; | |
| 5 | - | |
| 6 | -import java.util.Date; | |
| 7 | - | |
| 8 | - | |
| 9 | -/** | |
| 10 | - * 公众号账户 Excel VO | |
| 11 | - * | |
| 12 | - * @author 芋道源码 | |
| 13 | - */ | |
| 14 | -@Data | |
| 15 | -public class WxAccountExcelVO { | |
| 16 | - | |
| 17 | - @ExcelProperty("编号") | |
| 18 | - private Long id; | |
| 19 | - | |
| 20 | - @ExcelProperty("公众号名称") | |
| 21 | - private String name; | |
| 22 | - | |
| 23 | - @ExcelProperty("公众号账户") | |
| 24 | - private String account; | |
| 25 | - | |
| 26 | - @ExcelProperty("公众号appid") | |
| 27 | - private String appId; | |
| 28 | - | |
| 29 | - @ExcelProperty("公众号url") | |
| 30 | - private String url; | |
| 31 | - | |
| 32 | - @ExcelProperty("公众号token") | |
| 33 | - private String token; | |
| 34 | - | |
| 35 | - @ExcelProperty("加密密钥") | |
| 36 | - private String aesKey; | |
| 37 | - | |
| 38 | - @ExcelProperty("二维码图片URL") | |
| 39 | - private String qrCodeUrl; | |
| 40 | - | |
| 41 | - @ExcelProperty("备注") | |
| 42 | - private String remark; | |
| 43 | - | |
| 44 | - @ExcelProperty("创建时间") | |
| 45 | - private Date createTime; | |
| 46 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExportReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | |
| 2 | - | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | -import io.swagger.annotations.*; | |
| 6 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 7 | - | |
| 8 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * @author fengdan | |
| 12 | - */ | |
| 13 | -@ApiModel(value = "管理后台 - 公众号账户 Excel 导出 Request VO", description = "参数和 WxAccountPageReqVO 是一致的") | |
| 14 | -@Data | |
| 15 | -public class WxAccountExportReqVO { | |
| 16 | - | |
| 17 | - @ApiModelProperty(value = "公众号名称") | |
| 18 | - private String name; | |
| 19 | - | |
| 20 | - @ApiModelProperty(value = "公众号账户") | |
| 21 | - private String account; | |
| 22 | - | |
| 23 | - @ApiModelProperty(value = "公众号appid") | |
| 24 | - private String appId; | |
| 25 | - | |
| 26 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 27 | - @ApiModelProperty(value = "开始创建时间") | |
| 28 | - private Date beginCreateTime; | |
| 29 | - | |
| 30 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 31 | - @ApiModelProperty(value = "结束创建时间") | |
| 32 | - private Date endCreateTime; | |
| 33 | - | |
| 34 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/account/MpAccountConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.convert.account; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountRespVO; | |
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 8 | +import org.mapstruct.Mapper; | |
| 9 | +import org.mapstruct.factory.Mappers; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +@Mapper | |
| 14 | +public interface MpAccountConvert { | |
| 15 | + | |
| 16 | + MpAccountConvert INSTANCE = Mappers.getMapper(MpAccountConvert.class); | |
| 17 | + | |
| 18 | + MpAccountDO convert(MpAccountCreateReqVO bean); | |
| 19 | + | |
| 20 | + MpAccountDO convert(MpAccountUpdateReqVO bean); | |
| 21 | + | |
| 22 | + MpAccountRespVO convert(MpAccountDO bean); | |
| 23 | + | |
| 24 | + List<MpAccountRespVO> convertList(List<MpAccountDO> list); | |
| 25 | + | |
| 26 | + PageResult<MpAccountRespVO> convertPage(PageResult<MpAccountDO> page); | |
| 27 | + | |
| 28 | +} | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/account/WxAccountConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.convert.account; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountCreateReqVO; | |
| 5 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountExcelVO; | |
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountRespVO; | |
| 7 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountUpdateReqVO; | |
| 8 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 9 | -import org.mapstruct.Mapper; | |
| 10 | -import org.mapstruct.factory.Mappers; | |
| 11 | - | |
| 12 | -import java.util.List; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * 公众号账户 Convert | |
| 16 | - * | |
| 17 | - * @author 芋道源码 | |
| 18 | - */ | |
| 19 | -@Mapper | |
| 20 | -public interface WxAccountConvert { | |
| 21 | - | |
| 22 | - WxAccountConvert INSTANCE = Mappers.getMapper(WxAccountConvert.class); | |
| 23 | - | |
| 24 | - WxAccountDO convert(WxAccountCreateReqVO bean); | |
| 25 | - | |
| 26 | - WxAccountDO convert(WxAccountUpdateReqVO bean); | |
| 27 | - | |
| 28 | - WxAccountRespVO convert(WxAccountDO bean); | |
| 29 | - | |
| 30 | - List<WxAccountRespVO> convertList(List<WxAccountDO> list); | |
| 31 | - | |
| 32 | - PageResult<WxAccountRespVO> convertPage(PageResult<WxAccountDO> page); | |
| 33 | - | |
| 34 | - List<WxAccountExcelVO> convertList02(List<WxAccountDO> list); | |
| 35 | - | |
| 36 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/account/WxAccountDO.java renamed to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/account/MpAccountDO.java
| ... | ... | @@ -10,21 +10,20 @@ import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps; |
| 10 | 10 | import me.chanjar.weixin.mp.config.WxMpConfigStorage; |
| 11 | 11 | import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl; |
| 12 | 12 | |
| 13 | -// TODO 亚洲:这个模块的相关类,使用 Mp 作为前缀哈 | |
| 14 | 13 | /** |
| 15 | 14 | * 公众号账户 DO |
| 16 | 15 | * |
| 17 | 16 | * @author 芋道源码 |
| 18 | 17 | */ |
| 19 | -@TableName("wx_account") | |
| 20 | -@KeySequence("wx_account_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 18 | +@TableName("mp_account") | |
| 19 | +@KeySequence("mp_account_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 21 | 20 | @Data |
| 22 | 21 | @EqualsAndHashCode(callSuper = true) |
| 23 | 22 | @ToString(callSuper = true) |
| 24 | 23 | @Builder |
| 25 | 24 | @NoArgsConstructor |
| 26 | 25 | @AllArgsConstructor |
| 27 | -public class WxAccountDO extends BaseDO { | |
| 26 | +public class MpAccountDO extends BaseDO { | |
| 28 | 27 | |
| 29 | 28 | /** |
| 30 | 29 | * 编号 |
| ... | ... | @@ -48,10 +47,6 @@ public class WxAccountDO extends BaseDO { |
| 48 | 47 | */ |
| 49 | 48 | private String appSecret; |
| 50 | 49 | /** |
| 51 | - * 公众号url | |
| 52 | - */ | |
| 53 | - private String url; | |
| 54 | - /** | |
| 55 | 50 | * 公众号token |
| 56 | 51 | */ |
| 57 | 52 | private String token; |
| ... | ... | @@ -68,6 +63,7 @@ public class WxAccountDO extends BaseDO { |
| 68 | 63 | */ |
| 69 | 64 | private String remark; |
| 70 | 65 | |
| 66 | + // TODO 芋艿:需要迁移走 | |
| 71 | 67 | public WxMpConfigStorage toWxMpConfigStorage(RedisTemplateWxRedisOps redisTemplateWxRedisOps, WxMpProperties wxMpProperties) { |
| 72 | 68 | WxMpRedisConfigImpl wxMpRedisConfig = new WxMpRedisConfigImpl(redisTemplateWxRedisOps, wxMpProperties.getConfigStorage().getKeyPrefix()); |
| 73 | 69 | wxMpRedisConfig.setAppId(appId); | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/account/MpAccountMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mp.dal.mysql.account; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +@Mapper | |
| 11 | +public interface MpAccountMapper extends BaseMapperX<MpAccountDO> { | |
| 12 | + | |
| 13 | + default PageResult<MpAccountDO> selectPage(MpAccountPageReqVO reqVO) { | |
| 14 | + return selectPage(reqVO, new LambdaQueryWrapperX<MpAccountDO>() | |
| 15 | + .likeIfPresent(MpAccountDO::getName, reqVO.getName()) | |
| 16 | + .likeIfPresent(MpAccountDO::getAccount, reqVO.getAccount()) | |
| 17 | + .likeIfPresent(MpAccountDO::getAppId, reqVO.getAppId()) | |
| 18 | + .orderByDesc(MpAccountDO::getId)); | |
| 19 | + } | |
| 20 | + | |
| 21 | +} | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/account/WxAccountMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.mp.dal.mysql.account; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountExportReqVO; | |
| 7 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountPageReqVO; | |
| 8 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 9 | -import org.apache.ibatis.annotations.Mapper; | |
| 10 | - | |
| 11 | -import java.util.List; | |
| 12 | - | |
| 13 | -/** | |
| 14 | - * 公众号账户 Mapper | |
| 15 | - * | |
| 16 | - * @author 芋道源码 | |
| 17 | - */ | |
| 18 | -@Mapper | |
| 19 | -public interface WxAccountMapper extends BaseMapperX<WxAccountDO> { | |
| 20 | - | |
| 21 | - default PageResult<WxAccountDO> selectPage(WxAccountPageReqVO reqVO) { | |
| 22 | - return selectPage(reqVO, new LambdaQueryWrapperX<WxAccountDO>() | |
| 23 | - .likeIfPresent(WxAccountDO::getName, reqVO.getName()) | |
| 24 | - .eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount()) | |
| 25 | - .eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId()) | |
| 26 | - .betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 27 | - .orderByDesc(WxAccountDO::getId)); | |
| 28 | - } | |
| 29 | - | |
| 30 | - default List<WxAccountDO> selectList(WxAccountExportReqVO reqVO) { | |
| 31 | - return selectList(new LambdaQueryWrapperX<WxAccountDO>() | |
| 32 | - .likeIfPresent(WxAccountDO::getName, reqVO.getName()) | |
| 33 | - .eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount()) | |
| 34 | - .eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId()) | |
| 35 | - .betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 36 | - .orderByDesc(WxAccountDO::getId)); | |
| 37 | - } | |
| 38 | - | |
| 39 | -} |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/MsgHandler.java
| ... | ... | @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 7 | 7 | import cn.iocoder.yudao.module.infra.api.file.FileApi; |
| 8 | 8 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; |
| 9 | 9 | import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.WxFansMsgCreateReqVO; |
| 10 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 10 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 11 | 11 | import cn.iocoder.yudao.module.mp.service.account.WxAccountService; |
| 12 | 12 | import cn.iocoder.yudao.module.mp.service.fansmsg.WxFansMsgService; |
| 13 | 13 | import lombok.extern.slf4j.Slf4j; |
| ... | ... | @@ -55,7 +55,7 @@ public class MsgHandler implements WxMpMessageHandler { |
| 55 | 55 | WxMpUser wxmpUser = weixinService.getUserService() |
| 56 | 56 | .userInfo(wxMessage.getFromUser(), null); |
| 57 | 57 | if (wxmpUser != null) { |
| 58 | - WxAccountDO wxAccount = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); | |
| 58 | + MpAccountDO wxAccount = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); | |
| 59 | 59 | if (wxAccount != null) { |
| 60 | 60 | |
| 61 | 61 | if (wxMessage.getMsgType().equals(WxConsts.XmlMsgType.TEXT)) { | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/SubscribeHandler.java
| ... | ... | @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 5 | 5 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; |
| 6 | 6 | import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansCreateReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansUpdateReqVO; |
| 8 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 8 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 9 | 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO; |
| 10 | 10 | import cn.iocoder.yudao.module.mp.dal.dataobject.subscribetext.WxSubscribeTextDO; |
| 11 | 11 | import cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate.WxTextTemplateDO; |
| ... | ... | @@ -60,7 +60,7 @@ public class SubscribeHandler implements WxMpMessageHandler { |
| 60 | 60 | .userInfo(wxMessage.getFromUser(), null); |
| 61 | 61 | if (wxmpUser != null) { |
| 62 | 62 | // 可以添加关注用户到本地数据库 |
| 63 | - WxAccountDO wxAccount = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); | |
| 63 | + MpAccountDO wxAccount = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); | |
| 64 | 64 | if (wxAccount != null) { |
| 65 | 65 | WxAccountFansDO wxAccountFans = wxAccountFansService.findBy(WxAccountFansDO::getOpenid, wxmpUser.getOpenId()); |
| 66 | 66 | if (wxAccountFans == null) {//insert |
| ... | ... | @@ -128,7 +128,7 @@ public class SubscribeHandler implements WxMpMessageHandler { |
| 128 | 128 | |
| 129 | 129 | try { |
| 130 | 130 | String content = "感谢关注!";//默认 |
| 131 | - WxAccountDO wxAccount = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); | |
| 131 | + MpAccountDO wxAccount = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); | |
| 132 | 132 | if (wxAccount != null) { |
| 133 | 133 | WxSubscribeTextDO wxSubscribeText = wxSubscribeTextService.findBy(WxSubscribeTextDO::getWxAccountId, String.valueOf(wxAccount.getId())); |
| 134 | 134 | if (wxSubscribeText != null) { | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/UnsubscribeHandler.java
| 1 | 1 | package cn.iocoder.yudao.module.mp.handler; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansUpdateReqVO; |
| 4 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 4 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 5 | 5 | import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO; |
| 6 | 6 | import cn.iocoder.yudao.module.mp.service.account.WxAccountService; |
| 7 | 7 | import cn.iocoder.yudao.module.mp.service.accountfans.WxAccountFansService; |
| ... | ... | @@ -34,7 +34,7 @@ public class UnsubscribeHandler implements WxMpMessageHandler { |
| 34 | 34 | log.info("取消关注用户 OPENID: " + openId); |
| 35 | 35 | // TODO 可以更新本地数据库为取消关注状态 |
| 36 | 36 | |
| 37 | - WxAccountDO wxAccountDO = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); | |
| 37 | + MpAccountDO wxAccountDO = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); | |
| 38 | 38 | if (wxAccountDO != null) { |
| 39 | 39 | WxAccountFansDO wxAccountFansDO = wxAccountFansService.findBy(WxAccountFansDO::getOpenid, openId); |
| 40 | 40 | if (wxAccountFansDO != null) { | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountService.java
| 1 | 1 | package cn.iocoder.yudao.module.mp.service.account; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountCreateReqVO; | |
| 5 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountExportReqVO; | |
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountPageReqVO; | |
| 7 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountUpdateReqVO; | |
| 8 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 4 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 9 | 8 | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| 10 | 9 | |
| 11 | 10 | import javax.validation.Valid; |
| 12 | -import java.util.Collection; | |
| 13 | -import java.util.List; | |
| 14 | 11 | |
| 15 | 12 | /** |
| 16 | 13 | * 公众号账户 Service 接口 |
| ... | ... | @@ -25,21 +22,21 @@ public interface WxAccountService { |
| 25 | 22 | * @param createReqVO 创建信息 |
| 26 | 23 | * @return 编号 |
| 27 | 24 | */ |
| 28 | - Long createWxAccount(@Valid WxAccountCreateReqVO createReqVO); | |
| 25 | + Long createAccount(@Valid MpAccountCreateReqVO createReqVO); | |
| 29 | 26 | |
| 30 | 27 | /** |
| 31 | 28 | * 更新公众号账户 |
| 32 | 29 | * |
| 33 | 30 | * @param updateReqVO 更新信息 |
| 34 | 31 | */ |
| 35 | - void updateWxAccount(@Valid WxAccountUpdateReqVO updateReqVO); | |
| 32 | + void updateAccount(@Valid MpAccountUpdateReqVO updateReqVO); | |
| 36 | 33 | |
| 37 | 34 | /** |
| 38 | 35 | * 删除公众号账户 |
| 39 | 36 | * |
| 40 | 37 | * @param id 编号 |
| 41 | 38 | */ |
| 42 | - void deleteWxAccount(Long id); | |
| 39 | + void deleteAccount(Long id); | |
| 43 | 40 | |
| 44 | 41 | /** |
| 45 | 42 | * 获得公众号账户 |
| ... | ... | @@ -47,15 +44,7 @@ public interface WxAccountService { |
| 47 | 44 | * @param id 编号 |
| 48 | 45 | * @return 公众号账户 |
| 49 | 46 | */ |
| 50 | - WxAccountDO getWxAccount(Long id); | |
| 51 | - | |
| 52 | - /** | |
| 53 | - * 获得公众号账户列表 | |
| 54 | - * | |
| 55 | - * @param ids 编号 | |
| 56 | - * @return 公众号账户列表 | |
| 57 | - */ | |
| 58 | - List<WxAccountDO> getWxAccountList(Collection<Long> ids); | |
| 47 | + MpAccountDO getAccount(Long id); | |
| 59 | 48 | |
| 60 | 49 | /** |
| 61 | 50 | * 获得公众号账户分页 |
| ... | ... | @@ -63,16 +52,9 @@ public interface WxAccountService { |
| 63 | 52 | * @param pageReqVO 分页查询 |
| 64 | 53 | * @return 公众号账户分页 |
| 65 | 54 | */ |
| 66 | - PageResult<WxAccountDO> getWxAccountPage(WxAccountPageReqVO pageReqVO); | |
| 67 | - | |
| 68 | - /** | |
| 69 | - * 获得公众号账户列表, 用于 Excel 导出 | |
| 70 | - * | |
| 71 | - * @param exportReqVO 查询条件 | |
| 72 | - * @return 公众号账户列表 | |
| 73 | - */ | |
| 74 | - List<WxAccountDO> getWxAccountList(WxAccountExportReqVO exportReqVO); | |
| 55 | + PageResult<MpAccountDO> getAccountPage(MpAccountPageReqVO pageReqVO); | |
| 75 | 56 | |
| 57 | + // TODO 芋艿:去除这样的方法 | |
| 76 | 58 | /** |
| 77 | 59 | * 查询账户 |
| 78 | 60 | * |
| ... | ... | @@ -80,7 +62,7 @@ public interface WxAccountService { |
| 80 | 62 | * @param val |
| 81 | 63 | * @return |
| 82 | 64 | */ |
| 83 | - WxAccountDO findBy(SFunction<WxAccountDO, ?> field, Object val); | |
| 65 | + MpAccountDO findBy(SFunction<MpAccountDO, ?> field, Object val); | |
| 84 | 66 | |
| 85 | 67 | /** |
| 86 | 68 | * 初始化 | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountServiceImpl.java
| ... | ... | @@ -3,13 +3,12 @@ package cn.iocoder.yudao.module.mp.service.account; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; |
| 6 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountCreateReqVO; | |
| 7 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountExportReqVO; | |
| 8 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountPageReqVO; | |
| 9 | -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountUpdateReqVO; | |
| 10 | -import cn.iocoder.yudao.module.mp.convert.account.WxAccountConvert; | |
| 11 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 12 | -import cn.iocoder.yudao.module.mp.dal.mysql.account.WxAccountMapper; | |
| 6 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountCreateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.mp.convert.account.MpAccountConvert; | |
| 10 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 11 | +import cn.iocoder.yudao.module.mp.dal.mysql.account.MpAccountMapper; | |
| 13 | 12 | import cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants; |
| 14 | 13 | import cn.iocoder.yudao.module.mp.mq.producer.WxMpConfigDataProducer; |
| 15 | 14 | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| ... | ... | @@ -27,7 +26,6 @@ import org.springframework.validation.annotation.Validated; |
| 27 | 26 | |
| 28 | 27 | import javax.annotation.PostConstruct; |
| 29 | 28 | import javax.annotation.Resource; |
| 30 | -import java.util.Collection; | |
| 31 | 29 | import java.util.HashMap; |
| 32 | 30 | import java.util.List; |
| 33 | 31 | import java.util.Map; |
| ... | ... | @@ -44,8 +42,9 @@ import java.util.Map; |
| 44 | 42 | public class WxAccountServiceImpl implements WxAccountService { |
| 45 | 43 | |
| 46 | 44 | private static final long SCHEDULER_PERIOD = 5 * 60 * 1000L; |
| 45 | + | |
| 47 | 46 | @Resource |
| 48 | - private WxAccountMapper wxAccountMapper; | |
| 47 | + private MpAccountMapper wxAccountMapper; | |
| 49 | 48 | @Resource |
| 50 | 49 | private WxMpConfigDataProducer wxMpConfigDataProducer; |
| 51 | 50 | @Resource |
| ... | ... | @@ -59,31 +58,39 @@ public class WxAccountServiceImpl implements WxAccountService { |
| 59 | 58 | private WxAccountService self; |
| 60 | 59 | |
| 61 | 60 | @Override |
| 62 | - public Long createWxAccount(WxAccountCreateReqVO createReqVO) { | |
| 61 | + public Long createAccount(MpAccountCreateReqVO createReqVO) { | |
| 62 | + // TODO 芋艿:校验唯一性 | |
| 63 | 63 | // 插入 |
| 64 | - WxAccountDO wxAccount = WxAccountConvert.INSTANCE.convert(createReqVO); | |
| 64 | + MpAccountDO wxAccount = MpAccountConvert.INSTANCE.convert(createReqVO); | |
| 65 | 65 | wxAccountMapper.insert(wxAccount); |
| 66 | + | |
| 67 | + // TODO 芋艿:刷新的方式 | |
| 66 | 68 | wxMpConfigDataProducer.sendDictDataRefreshMessage(); |
| 67 | 69 | // 返回 |
| 68 | 70 | return wxAccount.getId(); |
| 69 | 71 | } |
| 70 | 72 | |
| 71 | 73 | @Override |
| 72 | - public void updateWxAccount(WxAccountUpdateReqVO updateReqVO) { | |
| 74 | + public void updateAccount(MpAccountUpdateReqVO updateReqVO) { | |
| 75 | + // TODO 芋艿:校验唯一性 | |
| 73 | 76 | // 校验存在 |
| 74 | - this.validateWxAccountExists(updateReqVO.getId()); | |
| 77 | + validateWxAccountExists(updateReqVO.getId()); | |
| 75 | 78 | // 更新 |
| 76 | - WxAccountDO updateObj = WxAccountConvert.INSTANCE.convert(updateReqVO); | |
| 79 | + MpAccountDO updateObj = MpAccountConvert.INSTANCE.convert(updateReqVO); | |
| 77 | 80 | wxAccountMapper.updateById(updateObj); |
| 81 | + | |
| 82 | + // TODO 芋艿:刷新的方式 | |
| 78 | 83 | wxMpConfigDataProducer.sendDictDataRefreshMessage(); |
| 79 | 84 | } |
| 80 | 85 | |
| 81 | 86 | @Override |
| 82 | - public void deleteWxAccount(Long id) { | |
| 87 | + public void deleteAccount(Long id) { | |
| 83 | 88 | // 校验存在 |
| 84 | - this.validateWxAccountExists(id); | |
| 89 | + validateWxAccountExists(id); | |
| 85 | 90 | // 删除 |
| 86 | 91 | wxAccountMapper.deleteById(id); |
| 92 | + | |
| 93 | + // TODO 芋艿:刷新的方式 | |
| 87 | 94 | wxMpConfigDataProducer.sendDictDataRefreshMessage(); |
| 88 | 95 | } |
| 89 | 96 | |
| ... | ... | @@ -94,27 +101,17 @@ public class WxAccountServiceImpl implements WxAccountService { |
| 94 | 101 | } |
| 95 | 102 | |
| 96 | 103 | @Override |
| 97 | - public WxAccountDO getWxAccount(Long id) { | |
| 104 | + public MpAccountDO getAccount(Long id) { | |
| 98 | 105 | return wxAccountMapper.selectById(id); |
| 99 | 106 | } |
| 100 | 107 | |
| 101 | 108 | @Override |
| 102 | - public List<WxAccountDO> getWxAccountList(Collection<Long> ids) { | |
| 103 | - return wxAccountMapper.selectBatchIds(ids); | |
| 104 | - } | |
| 105 | - | |
| 106 | - @Override | |
| 107 | - public PageResult<WxAccountDO> getWxAccountPage(WxAccountPageReqVO pageReqVO) { | |
| 109 | + public PageResult<MpAccountDO> getAccountPage(MpAccountPageReqVO pageReqVO) { | |
| 108 | 110 | return wxAccountMapper.selectPage(pageReqVO); |
| 109 | 111 | } |
| 110 | 112 | |
| 111 | 113 | @Override |
| 112 | - public List<WxAccountDO> getWxAccountList(WxAccountExportReqVO exportReqVO) { | |
| 113 | - return wxAccountMapper.selectList(exportReqVO); | |
| 114 | - } | |
| 115 | - | |
| 116 | - @Override | |
| 117 | - public WxAccountDO findBy(SFunction<WxAccountDO, ?> field, Object val) { | |
| 114 | + public MpAccountDO findBy(SFunction<MpAccountDO, ?> field, Object val) { | |
| 118 | 115 | return wxAccountMapper.selectOne(field, val); |
| 119 | 116 | } |
| 120 | 117 | |
| ... | ... | @@ -122,7 +119,8 @@ public class WxAccountServiceImpl implements WxAccountService { |
| 122 | 119 | @TenantIgnore |
| 123 | 120 | @Override |
| 124 | 121 | public void initLoadWxMpConfigStorages() { |
| 125 | - List<WxAccountDO> wxAccountList = this.wxAccountMapper.selectList(); | |
| 122 | + // TODO 芋艿:刷新的方式 | |
| 123 | + List<MpAccountDO> wxAccountList = this.wxAccountMapper.selectList(); | |
| 126 | 124 | if (CollectionUtils.isEmpty(wxAccountList)) { |
| 127 | 125 | log.info("未读取到公众号配置,请在管理后台添加"); |
| 128 | 126 | return; |
| ... | ... | @@ -137,7 +135,7 @@ public class WxAccountServiceImpl implements WxAccountService { |
| 137 | 135 | * |
| 138 | 136 | * @param account 公众号 |
| 139 | 137 | */ |
| 140 | - private synchronized void addAccountToRuntime(WxAccountDO account, RedisTemplateWxRedisOps redisOps) { | |
| 138 | + private synchronized void addAccountToRuntime(MpAccountDO account, RedisTemplateWxRedisOps redisOps) { | |
| 141 | 139 | String appId = account.getAppId(); |
| 142 | 140 | WxMpConfigStorage wxMpRedisConfig = account.toWxMpConfigStorage(redisOps, wxMpProperties); |
| 143 | 141 | try { | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagService.java
| ... | ... | @@ -4,7 +4,7 @@ import java.util.*; |
| 4 | 4 | import javax.validation.*; |
| 5 | 5 | |
| 6 | 6 | import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; |
| 7 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 7 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 8 | 8 | import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; |
| 9 | 9 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 10 | 10 | import me.chanjar.weixin.mp.bean.result.WxMpUser; |
| ... | ... | @@ -70,5 +70,5 @@ public interface WxAccountFansTagService { |
| 70 | 70 | */ |
| 71 | 71 | List<WxAccountFansTagDO> getWxAccountFansTagList(WxAccountFansTagExportReqVO exportReqVO); |
| 72 | 72 | |
| 73 | - void processFansTags(WxAccountDO wxAccount, WxMpUser wxmpUser); | |
| 73 | + void processFansTags(MpAccountDO wxAccount, WxMpUser wxmpUser); | |
| 74 | 74 | } | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.mp.service.accountfanstag; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.date.DateUtil; | |
| 4 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 3 | +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; | |
| 5 | 4 | import me.chanjar.weixin.mp.bean.result.WxMpUser; |
| 6 | 5 | import org.springframework.stereotype.Service; |
| 7 | 6 | |
| ... | ... | @@ -86,7 +85,7 @@ public class WxAccountFansTagServiceImpl implements WxAccountFansTagService { |
| 86 | 85 | } |
| 87 | 86 | |
| 88 | 87 | @Override |
| 89 | - public void processFansTags(WxAccountDO wxAccountDO, WxMpUser wxmpUser) { | |
| 88 | + public void processFansTags(MpAccountDO wxAccountDO, WxMpUser wxmpUser) { | |
| 90 | 89 | WxAccountFansTagExportReqVO wxAccountFansTagTpl = new WxAccountFansTagExportReqVO(); |
| 91 | 90 | wxAccountFansTagTpl.setOpenid(wxmpUser.getOpenId()); |
| 92 | 91 | List<WxAccountFansTagDO> wxAccountFansTagList = this.getWxAccountFansTagList(wxAccountFansTagTpl); | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/subscribetext/WxSubscribeTextService.java
| ... | ... | @@ -4,7 +4,6 @@ import java.util.*; |
| 4 | 4 | import javax.validation.*; |
| 5 | 5 | |
| 6 | 6 | import cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo.*; |
| 7 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | |
| 8 | 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.subscribetext.WxSubscribeTextDO; |
| 9 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 10 | 9 | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | ... | ... |
yudao-ui-admin/src/api/wechatMp/wxAccount.js renamed to yudao-ui-admin/src/api/mp/account.js
| ... | ... | @@ -3,7 +3,7 @@ import request from '@/utils/request' |
| 3 | 3 | // 创建公众号账户 |
| 4 | 4 | export function createAccount(data) { |
| 5 | 5 | return request({ |
| 6 | - url: '/wechatMp/account/create', | |
| 6 | + url: '/mp/account/create', | |
| 7 | 7 | method: 'post', |
| 8 | 8 | data: data |
| 9 | 9 | }) |
| ... | ... | @@ -12,7 +12,7 @@ export function createAccount(data) { |
| 12 | 12 | // 更新公众号账户 |
| 13 | 13 | export function updateAccount(data) { |
| 14 | 14 | return request({ |
| 15 | - url: '/wechatMp/account/update', | |
| 15 | + url: '/mp/account/update', | |
| 16 | 16 | method: 'put', |
| 17 | 17 | data: data |
| 18 | 18 | }) |
| ... | ... | @@ -21,7 +21,7 @@ export function updateAccount(data) { |
| 21 | 21 | // 删除公众号账户 |
| 22 | 22 | export function deleteAccount(id) { |
| 23 | 23 | return request({ |
| 24 | - url: '/wechatMp/account/delete?id=' + id, | |
| 24 | + url: '/mp/account/delete?id=' + id, | |
| 25 | 25 | method: 'delete' |
| 26 | 26 | }) |
| 27 | 27 | } |
| ... | ... | @@ -29,7 +29,7 @@ export function deleteAccount(id) { |
| 29 | 29 | // 获得公众号账户 |
| 30 | 30 | export function getAccount(id) { |
| 31 | 31 | return request({ |
| 32 | - url: '/wechatMp/account/get?id=' + id, | |
| 32 | + url: '/mp/account/get?id=' + id, | |
| 33 | 33 | method: 'get' |
| 34 | 34 | }) |
| 35 | 35 | } |
| ... | ... | @@ -37,7 +37,7 @@ export function getAccount(id) { |
| 37 | 37 | // 获得公众号账户分页 |
| 38 | 38 | export function getAccountPage(query) { |
| 39 | 39 | return request({ |
| 40 | - url: '/wechatMp/account/page', | |
| 40 | + url: '/mp/account/page', | |
| 41 | 41 | method: 'get', |
| 42 | 42 | params: query |
| 43 | 43 | }) |
| ... | ... | @@ -46,7 +46,7 @@ export function getAccountPage(query) { |
| 46 | 46 | // 导出公众号账户 Excel |
| 47 | 47 | export function exportAccountExcel(query) { |
| 48 | 48 | return request({ |
| 49 | - url: '/wechatMp/account/export-excel', | |
| 49 | + url: '/mp/account/export-excel', | |
| 50 | 50 | method: 'get', |
| 51 | 51 | params: query, |
| 52 | 52 | responseType: 'blob' | ... | ... |
yudao-ui-admin/src/views/wechatMp/wxAccount/index.vue renamed to yudao-ui-admin/src/views/mp/account/index.vue
| ... | ... | @@ -4,13 +4,9 @@ |
| 4 | 4 | <!-- 搜索工作栏 --> |
| 5 | 5 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 6 | 6 | <el-form-item label="名称" prop="name"> |
| 7 | - <el-input v-model="queryParams.name" placeholder="请输入公众号名称" clearable | |
| 7 | + <el-input v-model="queryParams.name" placeholder="请输入名称" clearable | |
| 8 | 8 | @keyup.enter.native="handleQuery"/> |
| 9 | 9 | </el-form-item> |
| 10 | - <el-form-item label="创建时间"> | |
| 11 | - <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" | |
| 12 | - type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"/> | |
| 13 | - </el-form-item> | |
| 14 | 10 | <el-form-item> |
| 15 | 11 | <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> |
| 16 | 12 | <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
| ... | ... | @@ -21,13 +17,7 @@ |
| 21 | 17 | <el-row :gutter="10" class="mb8"> |
| 22 | 18 | <el-col :span="1.5"> |
| 23 | 19 | <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" |
| 24 | - v-hasPermi="['wechatMp:account:create']">新增 | |
| 25 | - </el-button> | |
| 26 | - </el-col> | |
| 27 | - <el-col :span="1.5"> | |
| 28 | - <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | |
| 29 | - :loading="exportLoading" | |
| 30 | - v-hasPermi="['wechatMp:account:export']">导出 | |
| 20 | + v-hasPermi="['mp:account:create']">新增 | |
| 31 | 21 | </el-button> |
| 32 | 22 | </el-col> |
| 33 | 23 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| ... | ... | @@ -35,13 +25,12 @@ |
| 35 | 25 | |
| 36 | 26 | <!-- 列表 --> |
| 37 | 27 | <el-table v-loading="loading" :data="list"> |
| 38 | - <el-table-column label="编号" align="center" prop="id"/> | |
| 39 | 28 | <el-table-column label="名称" align="center" prop="name"/> |
| 40 | - <el-table-column label="微信原始ID" align="center" prop="account"/> | |
| 41 | - <el-table-column label="appId" align="center" prop="appId"/> | |
| 42 | - <el-table-column label="url" align="center" prop="url"/> | |
| 29 | + <el-table-column label="微信号" align="center" prop="account" width="180"/> | |
| 30 | + <el-table-column label="appId" align="center" prop="appId" width="180"/> | |
| 31 | + <el-table-column label="appSecret" align="center" prop="appSecret" width="180"/> | |
| 43 | 32 | <el-table-column label="Token" align="center" prop="token"/> |
| 44 | - <el-table-column label="加密密钥" align="center" prop="aesKey"/> | |
| 33 | + <el-table-column label="密钥" align="center" prop="aesKey"/> | |
| 45 | 34 | <el-table-column label="二维码" align="center" prop="qrCodeUrl"/> |
| 46 | 35 | <el-table-column label="备注" align="center" prop="remark"/> |
| 47 | 36 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| ... | ... | @@ -52,10 +41,10 @@ |
| 52 | 41 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 53 | 42 | <template slot-scope="scope"> |
| 54 | 43 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 55 | - v-hasPermi="['wechatMp:account:update']">修改 | |
| 44 | + v-hasPermi="['mp:account:update']">修改 | |
| 56 | 45 | </el-button> |
| 57 | 46 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| 58 | - v-hasPermi="['wechatMp:account:delete']">删除 | |
| 47 | + v-hasPermi="['mp:account:delete']">删除 | |
| 59 | 48 | </el-button> |
| 60 | 49 | </template> |
| 61 | 50 | </el-table-column> |
| ... | ... | @@ -66,35 +55,37 @@ |
| 66 | 55 | |
| 67 | 56 | <!-- 对话框(添加 / 修改) --> |
| 68 | 57 | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| 69 | - <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | |
| 70 | - <el-form-item label="公众号名称" prop="name"> | |
| 71 | - <el-input v-model="form.name" placeholder="请输入公众号名称"/> | |
| 58 | + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> | |
| 59 | + <el-form-item label="名称" prop="name"> | |
| 60 | + <el-input v-model="form.name" placeholder="请输入名称"/> | |
| 61 | + </el-form-item> | |
| 62 | + <el-form-item label="微信号" prop="account"> | |
| 63 | + <span slot="label"> | |
| 64 | + <el-tooltip content="在微信公众平台(mp.weixin.qq.com)的菜单【设置】-【公众号设置】-【帐号详情】中能找到原始ID" placement="top"> | |
| 65 | + <i class="el-icon-question" /> | |
| 66 | + </el-tooltip> | |
| 67 | + 微信号 | |
| 68 | + </span> | |
| 69 | + <el-input v-model="form.account" placeholder="请输入微信号"/> | |
| 70 | + </el-form-item> | |
| 71 | + <el-form-item label="appId" prop="appId"> | |
| 72 | + <span slot="label"> | |
| 73 | + <el-tooltip content="在微信公众平台(mp.weixin.qq.com)的菜单【开发】-【基本配置】中能找到 appId" placement="top"> | |
| 74 | + <i class="el-icon-question" /> | |
| 75 | + </el-tooltip> | |
| 76 | + appId | |
| 77 | + </span> | |
| 78 | + <el-input v-model="form.appId" placeholder="请输入公众号 appId"/> | |
| 79 | + </el-form-item> | |
| 80 | + <el-form-item label="密钥" prop="appSecret"> | |
| 81 | + <span slot="label"> | |
| 82 | + <el-tooltip content="在微信公众平台(mp.weixin.qq.com)的菜单【开发】-【基本配置】中能找到密钥" placement="top"> | |
| 83 | + <i class="el-icon-question" /> | |
| 84 | + </el-tooltip> | |
| 85 | + 密钥 | |
| 86 | + </span> | |
| 87 | + <el-input v-model="form.appSecret" placeholder="请输入公众号 appSecret"/> | |
| 72 | 88 | </el-form-item> |
| 73 | - | |
| 74 | - <el-tooltip class="item" effect="dark" | |
| 75 | - content="在微信公众平台(mp.weixin.qq.com)的菜单【设置】-【公众号设置】-【帐号详情】中能找到原始ID" | |
| 76 | - placement="right"> | |
| 77 | - <el-form-item label="微信原始ID" prop="account"> | |
| 78 | - <el-input v-model="form.account" placeholder="请输入微信原始ID" :disabled='disabled'/> | |
| 79 | - </el-form-item> | |
| 80 | - </el-tooltip> | |
| 81 | - | |
| 82 | - <el-tooltip class="item" effect="dark" | |
| 83 | - content="在微信公众平台(mp.weixin.qq.com)的菜单【开发】-【基本配置】中能找到AppID " | |
| 84 | - placement="right"> | |
| 85 | - <el-form-item label="AppID" prop="appId"> | |
| 86 | - <el-input v-model="form.appId" placeholder="请输入公众号appId" :disabled='disabled'/> | |
| 87 | - </el-form-item> | |
| 88 | - </el-tooltip> | |
| 89 | - | |
| 90 | - <el-tooltip class="item" effect="dark" | |
| 91 | - content="在微信公众平台(mp.weixin.qq.com)的菜单【开发】-【基本配置】中能找到AppSecret" | |
| 92 | - placement="right"> | |
| 93 | - <el-form-item label="AppSecret" prop="appSecret"> | |
| 94 | - <el-input v-model="form.appSecret" placeholder="请输入公众号密钥" :disabled='disabled'/> | |
| 95 | - </el-form-item> | |
| 96 | - </el-tooltip> | |
| 97 | - | |
| 98 | 89 | <el-form-item label="token" prop="token"> |
| 99 | 90 | <el-input v-model="form.token" placeholder="请输入公众号token"/> |
| 100 | 91 | </el-form-item> |
| ... | ... | @@ -114,17 +105,10 @@ |
| 114 | 105 | </template> |
| 115 | 106 | |
| 116 | 107 | <script> |
| 117 | -import { | |
| 118 | - createAccount, | |
| 119 | - deleteAccount, | |
| 120 | - exportAccountExcel, | |
| 121 | - getAccount, | |
| 122 | - getAccountPage, | |
| 123 | - updateAccount | |
| 124 | -} from '@/api/wechatMp/wxAccount' | |
| 108 | +import { createAccount, deleteAccount, getAccount, getAccountPage, updateAccount} from '@/api/mp/account' | |
| 125 | 109 | |
| 126 | 110 | export default { |
| 127 | - name: 'wxAccount', | |
| 111 | + name: 'mpAccount', | |
| 128 | 112 | components: {}, |
| 129 | 113 | data() { |
| 130 | 114 | return { |
| ... | ... | @@ -142,7 +126,6 @@ export default { |
| 142 | 126 | title: '', |
| 143 | 127 | // 是否显示弹出层 |
| 144 | 128 | open: false, |
| 145 | - dateRangeCreateTime: [], | |
| 146 | 129 | // 查询参数 |
| 147 | 130 | queryParams: { |
| 148 | 131 | pageNo: 1, |
| ... | ... | @@ -155,10 +138,11 @@ export default { |
| 155 | 138 | form: {}, |
| 156 | 139 | // 表单校验 |
| 157 | 140 | rules: { |
| 158 | - name: [{required: true, message: '公众号名称不能为空', trigger: 'blur'}], | |
| 141 | + name: [{required: true, message: '名称不能为空', trigger: 'blur'}], | |
| 159 | 142 | account: [{required: true, message: '公众号账户不能为空', trigger: 'blur'}], |
| 160 | - appId: [{required: true, message: '公众号appid不能为空', trigger: 'blur'}], | |
| 143 | + appId: [{required: true, message: '公众号 appId 不能为空', trigger: 'blur'}], | |
| 161 | 144 | appSecret: [{required: true, message: '公众号密钥不能为空', trigger: 'blur'}], |
| 145 | + token: [{required: true, message: '公众号 token 不能为空', trigger: 'blur'}], | |
| 162 | 146 | }, |
| 163 | 147 | // 禁用属性 |
| 164 | 148 | disabled: false, |
| ... | ... | @@ -173,7 +157,6 @@ export default { |
| 173 | 157 | this.loading = true |
| 174 | 158 | // 处理查询参数 |
| 175 | 159 | let params = {...this.queryParams} |
| 176 | - this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime') | |
| 177 | 160 | // 执行查询 |
| 178 | 161 | getAccountPage(params).then(response => { |
| 179 | 162 | this.list = response.data.list |
| ... | ... | @@ -255,7 +238,7 @@ export default { |
| 255 | 238 | /** 删除按钮操作 */ |
| 256 | 239 | handleDelete(row) { |
| 257 | 240 | const id = row.id |
| 258 | - this.$modal.confirm('是否确认删除公众号账户编号为"' + id + '"的数据项?').then(function () { | |
| 241 | + this.$modal.confirm('是否确认删除公众号账户编号为"' + row.name + '"的数据项?').then(function () { | |
| 259 | 242 | return deleteAccount(id) |
| 260 | 243 | }).then(() => { |
| 261 | 244 | this.getList() |
| ... | ... | @@ -263,23 +246,6 @@ export default { |
| 263 | 246 | }).catch(() => { |
| 264 | 247 | }) |
| 265 | 248 | }, |
| 266 | - /** 导出按钮操作 */ | |
| 267 | - handleExport() { | |
| 268 | - // 处理查询参数 | |
| 269 | - let params = {...this.queryParams} | |
| 270 | - params.pageNo = undefined | |
| 271 | - params.pageSize = undefined | |
| 272 | - this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime') | |
| 273 | - // 执行导出 | |
| 274 | - this.$modal.confirm('是否确认导出所有公众号账户数据项?').then(() => { | |
| 275 | - this.exportLoading = true | |
| 276 | - return exportAccountExcel(params) | |
| 277 | - }).then(response => { | |
| 278 | - this.$download.excel(response, '公众号账户.xls') | |
| 279 | - this.exportLoading = false | |
| 280 | - }).catch(() => { | |
| 281 | - }) | |
| 282 | - } | |
| 283 | 249 | } |
| 284 | 250 | } |
| 285 | 251 | </script> | ... | ... |
yudao-ui-admin/src/views/wechatMp/wxFansTag/index.vue
| ... | ... | @@ -104,7 +104,7 @@ import { |
| 104 | 104 | getWxFansTagList, |
| 105 | 105 | updateWxFansTag |
| 106 | 106 | } from '@/api/wechatMp/wxFansTag' |
| 107 | -import {getAccountPage} from '@/api/wechatMp/wxAccount' | |
| 107 | +import {getAccountPage} from '@/api/mp/account' | |
| 108 | 108 | |
| 109 | 109 | export default { |
| 110 | 110 | name: 'WxFansTag', | ... | ... |