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,11 +2,9 @@ package cn.iocoder.yudao.module.mp.controller.admin.account; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||
| 6 | -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 7 | import cn.iocoder.yudao.module.mp.controller.admin.account.vo.*; | 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 | import cn.iocoder.yudao.module.mp.service.account.WxAccountService; | 8 | import cn.iocoder.yudao.module.mp.service.account.WxAccountService; |
| 11 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiImplicitParam; | 10 | import io.swagger.annotations.ApiImplicitParam; |
| @@ -16,87 +14,58 @@ import org.springframework.validation.annotation.Validated; | @@ -16,87 +14,58 @@ import org.springframework.validation.annotation.Validated; | ||
| 16 | import org.springframework.web.bind.annotation.*; | 14 | import org.springframework.web.bind.annotation.*; |
| 17 | 15 | ||
| 18 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| 19 | -import javax.servlet.http.HttpServletResponse; | ||
| 20 | import javax.validation.Valid; | 17 | import javax.validation.Valid; |
| 21 | -import java.io.IOException; | ||
| 22 | -import java.util.Collection; | ||
| 23 | -import java.util.List; | ||
| 24 | 18 | ||
| 25 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 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 | @Api(tags = "管理后台 - 公众号账户") | 21 | @Api(tags = "管理后台 - 公众号账户") |
| 32 | @RestController | 22 | @RestController |
| 33 | -@RequestMapping("/wechatMp/account") | 23 | +@RequestMapping("/mp/account") |
| 34 | @Validated | 24 | @Validated |
| 35 | -public class WxAccountController { | 25 | +public class MpAccountController { |
| 36 | 26 | ||
| 37 | @Resource | 27 | @Resource |
| 38 | private WxAccountService wxAccountService; | 28 | private WxAccountService wxAccountService; |
| 39 | 29 | ||
| 40 | @PostMapping("/create") | 30 | @PostMapping("/create") |
| 41 | @ApiOperation("创建公众号账户") | 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 | @PutMapping("/update") | 37 | @PutMapping("/update") |
| 48 | @ApiOperation("更新公众号账户") | 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 | return success(true); | 42 | return success(true); |
| 53 | } | 43 | } |
| 54 | 44 | ||
| 55 | @DeleteMapping("/delete") | 45 | @DeleteMapping("/delete") |
| 56 | @ApiOperation("删除公众号账户") | 46 | @ApiOperation("删除公众号账户") |
| 57 | @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | 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 | public CommonResult<Boolean> deleteWxAccount(@RequestParam("id") Long id) { | 49 | public CommonResult<Boolean> deleteWxAccount(@RequestParam("id") Long id) { |
| 60 | - wxAccountService.deleteWxAccount(id); | 50 | + wxAccountService.deleteAccount(id); |
| 61 | return success(true); | 51 | return success(true); |
| 62 | } | 52 | } |
| 63 | 53 | ||
| 64 | @GetMapping("/get") | 54 | @GetMapping("/get") |
| 65 | @ApiOperation("获得公众号账户") | 55 | @ApiOperation("获得公众号账户") |
| 66 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | 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 | @GetMapping("/page") | 63 | @GetMapping("/page") |
| 83 | @ApiOperation("获得公众号账户分页") | 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,7 +12,7 @@ import javax.validation.constraints.NotNull; | ||
| 12 | * @author fengdan | 12 | * @author fengdan |
| 13 | */ | 13 | */ |
| 14 | @Data | 14 | @Data |
| 15 | -public class WxAccountBaseVO { | 15 | +public class MpAccountBaseVO { |
| 16 | 16 | ||
| 17 | @ApiModelProperty(value = "公众号名称", required = true) | 17 | @ApiModelProperty(value = "公众号名称", required = true) |
| 18 | @NotNull(message = "公众号名称不能为空") | 18 | @NotNull(message = "公众号名称不能为空") |
| @@ -22,15 +22,15 @@ public class WxAccountBaseVO { | @@ -22,15 +22,15 @@ public class WxAccountBaseVO { | ||
| 22 | @NotNull(message = "公众号账户不能为空") | 22 | @NotNull(message = "公众号账户不能为空") |
| 23 | private String account; | 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 | private String appId; | 27 | private String appId; |
| 28 | 28 | ||
| 29 | @ApiModelProperty(value = "公众号密钥", required = true) | 29 | @ApiModelProperty(value = "公众号密钥", required = true) |
| 30 | @NotNull(message = "公众号密钥不能为空") | 30 | @NotNull(message = "公众号密钥不能为空") |
| 31 | private String appSecret; | 31 | private String appSecret; |
| 32 | 32 | ||
| 33 | - @ApiModelProperty(value = "公众号token") | 33 | + @ApiModelProperty(value = "公众号 token", required = true) |
| 34 | private String token; | 34 | private String token; |
| 35 | 35 | ||
| 36 | @ApiModelProperty(value = "加密密钥") | 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,13 +5,10 @@ import lombok.Data; | ||
| 5 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| 6 | import lombok.ToString; | 6 | import lombok.ToString; |
| 7 | 7 | ||
| 8 | -/** | ||
| 9 | - * @author fengdan | ||
| 10 | - */ | ||
| 11 | @ApiModel("管理后台 - 公众号账户创建 Request VO") | 8 | @ApiModel("管理后台 - 公众号账户创建 Request VO") |
| 12 | @Data | 9 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 10 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 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 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; | 1 | package cn.iocoder.yudao.module.mp.controller.admin.account.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 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 | @ApiModel("管理后台 - 公众号账户分页 Request VO") | 7 | @ApiModel("管理后台 - 公众号账户分页 Request VO") |
| 15 | @Data | 8 | @Data |
| 16 | @EqualsAndHashCode(callSuper = true) | 9 | @EqualsAndHashCode(callSuper = true) |
| 17 | @ToString(callSuper = true) | 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 | private String name; | 14 | private String name; |
| 21 | 15 | ||
| 22 | - @ApiModelProperty(value = "公众号账户") | 16 | + @ApiModelProperty(value = "公众号账户", notes = "模糊匹配") |
| 23 | private String account; | 17 | private String account; |
| 24 | 18 | ||
| 25 | - @ApiModelProperty(value = "公众号appid") | 19 | + @ApiModelProperty(value = "公众号 appid", notes = "模糊匹配") |
| 26 | private String appId; | 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,14 +15,11 @@ import java.util.Date; | ||
| 15 | @Data | 15 | @Data |
| 16 | @EqualsAndHashCode(callSuper = true) | 16 | @EqualsAndHashCode(callSuper = true) |
| 17 | @ToString(callSuper = true) | 17 | @ToString(callSuper = true) |
| 18 | -public class WxAccountRespVO extends WxAccountBaseVO { | 18 | +public class MpAccountRespVO extends MpAccountBaseVO { |
| 19 | 19 | ||
| 20 | @ApiModelProperty(value = "编号", required = true) | 20 | @ApiModelProperty(value = "编号", required = true) |
| 21 | private Long id; | 21 | private Long id; |
| 22 | 22 | ||
| 23 | - @ApiModelProperty(value = "公众号url") | ||
| 24 | - private String url; | ||
| 25 | - | ||
| 26 | @ApiModelProperty(value = "二维码图片URL") | 23 | @ApiModelProperty(value = "二维码图片URL") |
| 27 | private String qrCodeUrl; | 24 | private String qrCodeUrl; |
| 28 | 25 | ||
| @@ -31,4 +28,5 @@ public class WxAccountRespVO extends WxAccountBaseVO { | @@ -31,4 +28,5 @@ public class WxAccountRespVO extends WxAccountBaseVO { | ||
| 31 | 28 | ||
| 32 | @ApiModelProperty(value = "公众号密钥", required = true) | 29 | @ApiModelProperty(value = "公众号密钥", required = true) |
| 33 | private String appSecret; | 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,7 +11,7 @@ import javax.validation.constraints.*; | ||
| 11 | @Data | 11 | @Data |
| 12 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 13 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 14 | -public class WxAccountUpdateReqVO extends WxAccountBaseVO { | 14 | +public class MpAccountUpdateReqVO extends MpAccountBaseVO { |
| 15 | 15 | ||
| 16 | @ApiModelProperty(value = "编号", required = true) | 16 | @ApiModelProperty(value = "编号", required = true) |
| 17 | @NotNull(message = "编号不能为空") | 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,21 +10,20 @@ import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps; | ||
| 10 | import me.chanjar.weixin.mp.config.WxMpConfigStorage; | 10 | import me.chanjar.weixin.mp.config.WxMpConfigStorage; |
| 11 | import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl; | 11 | import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl; |
| 12 | 12 | ||
| 13 | -// TODO 亚洲:这个模块的相关类,使用 Mp 作为前缀哈 | ||
| 14 | /** | 13 | /** |
| 15 | * 公众号账户 DO | 14 | * 公众号账户 DO |
| 16 | * | 15 | * |
| 17 | * @author 芋道源码 | 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 | @Data | 20 | @Data |
| 22 | @EqualsAndHashCode(callSuper = true) | 21 | @EqualsAndHashCode(callSuper = true) |
| 23 | @ToString(callSuper = true) | 22 | @ToString(callSuper = true) |
| 24 | @Builder | 23 | @Builder |
| 25 | @NoArgsConstructor | 24 | @NoArgsConstructor |
| 26 | @AllArgsConstructor | 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,10 +47,6 @@ public class WxAccountDO extends BaseDO { | ||
| 48 | */ | 47 | */ |
| 49 | private String appSecret; | 48 | private String appSecret; |
| 50 | /** | 49 | /** |
| 51 | - * 公众号url | ||
| 52 | - */ | ||
| 53 | - private String url; | ||
| 54 | - /** | ||
| 55 | * 公众号token | 50 | * 公众号token |
| 56 | */ | 51 | */ |
| 57 | private String token; | 52 | private String token; |
| @@ -68,6 +63,7 @@ public class WxAccountDO extends BaseDO { | @@ -68,6 +63,7 @@ public class WxAccountDO extends BaseDO { | ||
| 68 | */ | 63 | */ |
| 69 | private String remark; | 64 | private String remark; |
| 70 | 65 | ||
| 66 | + // TODO 芋艿:需要迁移走 | ||
| 71 | public WxMpConfigStorage toWxMpConfigStorage(RedisTemplateWxRedisOps redisTemplateWxRedisOps, WxMpProperties wxMpProperties) { | 67 | public WxMpConfigStorage toWxMpConfigStorage(RedisTemplateWxRedisOps redisTemplateWxRedisOps, WxMpProperties wxMpProperties) { |
| 72 | WxMpRedisConfigImpl wxMpRedisConfig = new WxMpRedisConfigImpl(redisTemplateWxRedisOps, wxMpProperties.getConfigStorage().getKeyPrefix()); | 68 | WxMpRedisConfigImpl wxMpRedisConfig = new WxMpRedisConfigImpl(redisTemplateWxRedisOps, wxMpProperties.getConfigStorage().getKeyPrefix()); |
| 73 | wxMpRedisConfig.setAppId(appId); | 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 +7,7 @@ import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | ||
| 7 | import cn.iocoder.yudao.module.infra.api.file.FileApi; | 7 | import cn.iocoder.yudao.module.infra.api.file.FileApi; |
| 8 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; | 8 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; |
| 9 | import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.WxFansMsgCreateReqVO; | 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 | import cn.iocoder.yudao.module.mp.service.account.WxAccountService; | 11 | import cn.iocoder.yudao.module.mp.service.account.WxAccountService; |
| 12 | import cn.iocoder.yudao.module.mp.service.fansmsg.WxFansMsgService; | 12 | import cn.iocoder.yudao.module.mp.service.fansmsg.WxFansMsgService; |
| 13 | import lombok.extern.slf4j.Slf4j; | 13 | import lombok.extern.slf4j.Slf4j; |
| @@ -55,7 +55,7 @@ public class MsgHandler implements WxMpMessageHandler { | @@ -55,7 +55,7 @@ public class MsgHandler implements WxMpMessageHandler { | ||
| 55 | WxMpUser wxmpUser = weixinService.getUserService() | 55 | WxMpUser wxmpUser = weixinService.getUserService() |
| 56 | .userInfo(wxMessage.getFromUser(), null); | 56 | .userInfo(wxMessage.getFromUser(), null); |
| 57 | if (wxmpUser != null) { | 57 | if (wxmpUser != null) { |
| 58 | - WxAccountDO wxAccount = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); | 58 | + MpAccountDO wxAccount = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); |
| 59 | if (wxAccount != null) { | 59 | if (wxAccount != null) { |
| 60 | 60 | ||
| 61 | if (wxMessage.getMsgType().equals(WxConsts.XmlMsgType.TEXT)) { | 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,7 +5,7 @@ import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | ||
| 5 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; | 5 | import cn.iocoder.yudao.module.mp.builder.TextBuilder; |
| 6 | import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansCreateReqVO; | 6 | import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansCreateReqVO; |
| 7 | import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansUpdateReqVO; | 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 | import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO; | 9 | import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO; |
| 10 | import cn.iocoder.yudao.module.mp.dal.dataobject.subscribetext.WxSubscribeTextDO; | 10 | import cn.iocoder.yudao.module.mp.dal.dataobject.subscribetext.WxSubscribeTextDO; |
| 11 | import cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate.WxTextTemplateDO; | 11 | import cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate.WxTextTemplateDO; |
| @@ -60,7 +60,7 @@ public class SubscribeHandler implements WxMpMessageHandler { | @@ -60,7 +60,7 @@ public class SubscribeHandler implements WxMpMessageHandler { | ||
| 60 | .userInfo(wxMessage.getFromUser(), null); | 60 | .userInfo(wxMessage.getFromUser(), null); |
| 61 | if (wxmpUser != null) { | 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 | if (wxAccount != null) { | 64 | if (wxAccount != null) { |
| 65 | WxAccountFansDO wxAccountFans = wxAccountFansService.findBy(WxAccountFansDO::getOpenid, wxmpUser.getOpenId()); | 65 | WxAccountFansDO wxAccountFans = wxAccountFansService.findBy(WxAccountFansDO::getOpenid, wxmpUser.getOpenId()); |
| 66 | if (wxAccountFans == null) {//insert | 66 | if (wxAccountFans == null) {//insert |
| @@ -128,7 +128,7 @@ public class SubscribeHandler implements WxMpMessageHandler { | @@ -128,7 +128,7 @@ public class SubscribeHandler implements WxMpMessageHandler { | ||
| 128 | 128 | ||
| 129 | try { | 129 | try { |
| 130 | String content = "感谢关注!";//默认 | 130 | String content = "感谢关注!";//默认 |
| 131 | - WxAccountDO wxAccount = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); | 131 | + MpAccountDO wxAccount = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); |
| 132 | if (wxAccount != null) { | 132 | if (wxAccount != null) { |
| 133 | WxSubscribeTextDO wxSubscribeText = wxSubscribeTextService.findBy(WxSubscribeTextDO::getWxAccountId, String.valueOf(wxAccount.getId())); | 133 | WxSubscribeTextDO wxSubscribeText = wxSubscribeTextService.findBy(WxSubscribeTextDO::getWxAccountId, String.valueOf(wxAccount.getId())); |
| 134 | if (wxSubscribeText != null) { | 134 | if (wxSubscribeText != null) { |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/UnsubscribeHandler.java
| 1 | package cn.iocoder.yudao.module.mp.handler; | 1 | package cn.iocoder.yudao.module.mp.handler; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansUpdateReqVO; | 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 | import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO; | 5 | import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO; |
| 6 | import cn.iocoder.yudao.module.mp.service.account.WxAccountService; | 6 | import cn.iocoder.yudao.module.mp.service.account.WxAccountService; |
| 7 | import cn.iocoder.yudao.module.mp.service.accountfans.WxAccountFansService; | 7 | import cn.iocoder.yudao.module.mp.service.accountfans.WxAccountFansService; |
| @@ -34,7 +34,7 @@ public class UnsubscribeHandler implements WxMpMessageHandler { | @@ -34,7 +34,7 @@ public class UnsubscribeHandler implements WxMpMessageHandler { | ||
| 34 | log.info("取消关注用户 OPENID: " + openId); | 34 | log.info("取消关注用户 OPENID: " + openId); |
| 35 | // TODO 可以更新本地数据库为取消关注状态 | 35 | // TODO 可以更新本地数据库为取消关注状态 |
| 36 | 36 | ||
| 37 | - WxAccountDO wxAccountDO = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); | 37 | + MpAccountDO wxAccountDO = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); |
| 38 | if (wxAccountDO != null) { | 38 | if (wxAccountDO != null) { |
| 39 | WxAccountFansDO wxAccountFansDO = wxAccountFansService.findBy(WxAccountFansDO::getOpenid, openId); | 39 | WxAccountFansDO wxAccountFansDO = wxAccountFansService.findBy(WxAccountFansDO::getOpenid, openId); |
| 40 | if (wxAccountFansDO != null) { | 40 | if (wxAccountFansDO != null) { |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountService.java
| 1 | package cn.iocoder.yudao.module.mp.service.account; | 1 | package cn.iocoder.yudao.module.mp.service.account; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 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 | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | 8 | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| 10 | 9 | ||
| 11 | import javax.validation.Valid; | 10 | import javax.validation.Valid; |
| 12 | -import java.util.Collection; | ||
| 13 | -import java.util.List; | ||
| 14 | 11 | ||
| 15 | /** | 12 | /** |
| 16 | * 公众号账户 Service 接口 | 13 | * 公众号账户 Service 接口 |
| @@ -25,21 +22,21 @@ public interface WxAccountService { | @@ -25,21 +22,21 @@ public interface WxAccountService { | ||
| 25 | * @param createReqVO 创建信息 | 22 | * @param createReqVO 创建信息 |
| 26 | * @return 编号 | 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 | * @param updateReqVO 更新信息 | 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 | * @param id 编号 | 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,15 +44,7 @@ public interface WxAccountService { | ||
| 47 | * @param id 编号 | 44 | * @param id 编号 |
| 48 | * @return 公众号账户 | 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,16 +52,9 @@ public interface WxAccountService { | ||
| 63 | * @param pageReqVO 分页查询 | 52 | * @param pageReqVO 分页查询 |
| 64 | * @return 公众号账户分页 | 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,7 +62,7 @@ public interface WxAccountService { | ||
| 80 | * @param val | 62 | * @param val |
| 81 | * @return | 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,13 +3,12 @@ package cn.iocoder.yudao.module.mp.service.account; | ||
| 3 | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; | 3 | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; |
| 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; | 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 | import cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants; | 12 | import cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants; |
| 14 | import cn.iocoder.yudao.module.mp.mq.producer.WxMpConfigDataProducer; | 13 | import cn.iocoder.yudao.module.mp.mq.producer.WxMpConfigDataProducer; |
| 15 | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | 14 | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| @@ -27,7 +26,6 @@ import org.springframework.validation.annotation.Validated; | @@ -27,7 +26,6 @@ import org.springframework.validation.annotation.Validated; | ||
| 27 | 26 | ||
| 28 | import javax.annotation.PostConstruct; | 27 | import javax.annotation.PostConstruct; |
| 29 | import javax.annotation.Resource; | 28 | import javax.annotation.Resource; |
| 30 | -import java.util.Collection; | ||
| 31 | import java.util.HashMap; | 29 | import java.util.HashMap; |
| 32 | import java.util.List; | 30 | import java.util.List; |
| 33 | import java.util.Map; | 31 | import java.util.Map; |
| @@ -44,8 +42,9 @@ import java.util.Map; | @@ -44,8 +42,9 @@ import java.util.Map; | ||
| 44 | public class WxAccountServiceImpl implements WxAccountService { | 42 | public class WxAccountServiceImpl implements WxAccountService { |
| 45 | 43 | ||
| 46 | private static final long SCHEDULER_PERIOD = 5 * 60 * 1000L; | 44 | private static final long SCHEDULER_PERIOD = 5 * 60 * 1000L; |
| 45 | + | ||
| 47 | @Resource | 46 | @Resource |
| 48 | - private WxAccountMapper wxAccountMapper; | 47 | + private MpAccountMapper wxAccountMapper; |
| 49 | @Resource | 48 | @Resource |
| 50 | private WxMpConfigDataProducer wxMpConfigDataProducer; | 49 | private WxMpConfigDataProducer wxMpConfigDataProducer; |
| 51 | @Resource | 50 | @Resource |
| @@ -59,31 +58,39 @@ public class WxAccountServiceImpl implements WxAccountService { | @@ -59,31 +58,39 @@ public class WxAccountServiceImpl implements WxAccountService { | ||
| 59 | private WxAccountService self; | 58 | private WxAccountService self; |
| 60 | 59 | ||
| 61 | @Override | 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 | wxAccountMapper.insert(wxAccount); | 65 | wxAccountMapper.insert(wxAccount); |
| 66 | + | ||
| 67 | + // TODO 芋艿:刷新的方式 | ||
| 66 | wxMpConfigDataProducer.sendDictDataRefreshMessage(); | 68 | wxMpConfigDataProducer.sendDictDataRefreshMessage(); |
| 67 | // 返回 | 69 | // 返回 |
| 68 | return wxAccount.getId(); | 70 | return wxAccount.getId(); |
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | @Override | 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 | wxAccountMapper.updateById(updateObj); | 80 | wxAccountMapper.updateById(updateObj); |
| 81 | + | ||
| 82 | + // TODO 芋艿:刷新的方式 | ||
| 78 | wxMpConfigDataProducer.sendDictDataRefreshMessage(); | 83 | wxMpConfigDataProducer.sendDictDataRefreshMessage(); |
| 79 | } | 84 | } |
| 80 | 85 | ||
| 81 | @Override | 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 | wxAccountMapper.deleteById(id); | 91 | wxAccountMapper.deleteById(id); |
| 92 | + | ||
| 93 | + // TODO 芋艿:刷新的方式 | ||
| 87 | wxMpConfigDataProducer.sendDictDataRefreshMessage(); | 94 | wxMpConfigDataProducer.sendDictDataRefreshMessage(); |
| 88 | } | 95 | } |
| 89 | 96 | ||
| @@ -94,27 +101,17 @@ public class WxAccountServiceImpl implements WxAccountService { | @@ -94,27 +101,17 @@ public class WxAccountServiceImpl implements WxAccountService { | ||
| 94 | } | 101 | } |
| 95 | 102 | ||
| 96 | @Override | 103 | @Override |
| 97 | - public WxAccountDO getWxAccount(Long id) { | 104 | + public MpAccountDO getAccount(Long id) { |
| 98 | return wxAccountMapper.selectById(id); | 105 | return wxAccountMapper.selectById(id); |
| 99 | } | 106 | } |
| 100 | 107 | ||
| 101 | @Override | 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 | return wxAccountMapper.selectPage(pageReqVO); | 110 | return wxAccountMapper.selectPage(pageReqVO); |
| 109 | } | 111 | } |
| 110 | 112 | ||
| 111 | @Override | 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 | return wxAccountMapper.selectOne(field, val); | 115 | return wxAccountMapper.selectOne(field, val); |
| 119 | } | 116 | } |
| 120 | 117 | ||
| @@ -122,7 +119,8 @@ public class WxAccountServiceImpl implements WxAccountService { | @@ -122,7 +119,8 @@ public class WxAccountServiceImpl implements WxAccountService { | ||
| 122 | @TenantIgnore | 119 | @TenantIgnore |
| 123 | @Override | 120 | @Override |
| 124 | public void initLoadWxMpConfigStorages() { | 121 | public void initLoadWxMpConfigStorages() { |
| 125 | - List<WxAccountDO> wxAccountList = this.wxAccountMapper.selectList(); | 122 | + // TODO 芋艿:刷新的方式 |
| 123 | + List<MpAccountDO> wxAccountList = this.wxAccountMapper.selectList(); | ||
| 126 | if (CollectionUtils.isEmpty(wxAccountList)) { | 124 | if (CollectionUtils.isEmpty(wxAccountList)) { |
| 127 | log.info("未读取到公众号配置,请在管理后台添加"); | 125 | log.info("未读取到公众号配置,请在管理后台添加"); |
| 128 | return; | 126 | return; |
| @@ -137,7 +135,7 @@ public class WxAccountServiceImpl implements WxAccountService { | @@ -137,7 +135,7 @@ public class WxAccountServiceImpl implements WxAccountService { | ||
| 137 | * | 135 | * |
| 138 | * @param account 公众号 | 136 | * @param account 公众号 |
| 139 | */ | 137 | */ |
| 140 | - private synchronized void addAccountToRuntime(WxAccountDO account, RedisTemplateWxRedisOps redisOps) { | 138 | + private synchronized void addAccountToRuntime(MpAccountDO account, RedisTemplateWxRedisOps redisOps) { |
| 141 | String appId = account.getAppId(); | 139 | String appId = account.getAppId(); |
| 142 | WxMpConfigStorage wxMpRedisConfig = account.toWxMpConfigStorage(redisOps, wxMpProperties); | 140 | WxMpConfigStorage wxMpRedisConfig = account.toWxMpConfigStorage(redisOps, wxMpProperties); |
| 143 | try { | 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,7 +4,7 @@ import java.util.*; | ||
| 4 | import javax.validation.*; | 4 | import javax.validation.*; |
| 5 | 5 | ||
| 6 | import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; | 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 | import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; | 8 | import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; |
| 9 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 9 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 10 | import me.chanjar.weixin.mp.bean.result.WxMpUser; | 10 | import me.chanjar.weixin.mp.bean.result.WxMpUser; |
| @@ -70,5 +70,5 @@ public interface WxAccountFansTagService { | @@ -70,5 +70,5 @@ public interface WxAccountFansTagService { | ||
| 70 | */ | 70 | */ |
| 71 | List<WxAccountFansTagDO> getWxAccountFansTagList(WxAccountFansTagExportReqVO exportReqVO); | 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 | package cn.iocoder.yudao.module.mp.service.accountfanstag; | 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 | import me.chanjar.weixin.mp.bean.result.WxMpUser; | 4 | import me.chanjar.weixin.mp.bean.result.WxMpUser; |
| 6 | import org.springframework.stereotype.Service; | 5 | import org.springframework.stereotype.Service; |
| 7 | 6 | ||
| @@ -86,7 +85,7 @@ public class WxAccountFansTagServiceImpl implements WxAccountFansTagService { | @@ -86,7 +85,7 @@ public class WxAccountFansTagServiceImpl implements WxAccountFansTagService { | ||
| 86 | } | 85 | } |
| 87 | 86 | ||
| 88 | @Override | 87 | @Override |
| 89 | - public void processFansTags(WxAccountDO wxAccountDO, WxMpUser wxmpUser) { | 88 | + public void processFansTags(MpAccountDO wxAccountDO, WxMpUser wxmpUser) { |
| 90 | WxAccountFansTagExportReqVO wxAccountFansTagTpl = new WxAccountFansTagExportReqVO(); | 89 | WxAccountFansTagExportReqVO wxAccountFansTagTpl = new WxAccountFansTagExportReqVO(); |
| 91 | wxAccountFansTagTpl.setOpenid(wxmpUser.getOpenId()); | 90 | wxAccountFansTagTpl.setOpenid(wxmpUser.getOpenId()); |
| 92 | List<WxAccountFansTagDO> wxAccountFansTagList = this.getWxAccountFansTagList(wxAccountFansTagTpl); | 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,7 +4,6 @@ import java.util.*; | ||
| 4 | import javax.validation.*; | 4 | import javax.validation.*; |
| 5 | 5 | ||
| 6 | import cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo.*; | 6 | import cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo.*; |
| 7 | -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; | ||
| 8 | import cn.iocoder.yudao.module.mp.dal.dataobject.subscribetext.WxSubscribeTextDO; | 7 | import cn.iocoder.yudao.module.mp.dal.dataobject.subscribetext.WxSubscribeTextDO; |
| 9 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 10 | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | 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,7 +3,7 @@ import request from '@/utils/request' | ||
| 3 | // 创建公众号账户 | 3 | // 创建公众号账户 |
| 4 | export function createAccount(data) { | 4 | export function createAccount(data) { |
| 5 | return request({ | 5 | return request({ |
| 6 | - url: '/wechatMp/account/create', | 6 | + url: '/mp/account/create', |
| 7 | method: 'post', | 7 | method: 'post', |
| 8 | data: data | 8 | data: data |
| 9 | }) | 9 | }) |
| @@ -12,7 +12,7 @@ export function createAccount(data) { | @@ -12,7 +12,7 @@ export function createAccount(data) { | ||
| 12 | // 更新公众号账户 | 12 | // 更新公众号账户 |
| 13 | export function updateAccount(data) { | 13 | export function updateAccount(data) { |
| 14 | return request({ | 14 | return request({ |
| 15 | - url: '/wechatMp/account/update', | 15 | + url: '/mp/account/update', |
| 16 | method: 'put', | 16 | method: 'put', |
| 17 | data: data | 17 | data: data |
| 18 | }) | 18 | }) |
| @@ -21,7 +21,7 @@ export function updateAccount(data) { | @@ -21,7 +21,7 @@ export function updateAccount(data) { | ||
| 21 | // 删除公众号账户 | 21 | // 删除公众号账户 |
| 22 | export function deleteAccount(id) { | 22 | export function deleteAccount(id) { |
| 23 | return request({ | 23 | return request({ |
| 24 | - url: '/wechatMp/account/delete?id=' + id, | 24 | + url: '/mp/account/delete?id=' + id, |
| 25 | method: 'delete' | 25 | method: 'delete' |
| 26 | }) | 26 | }) |
| 27 | } | 27 | } |
| @@ -29,7 +29,7 @@ export function deleteAccount(id) { | @@ -29,7 +29,7 @@ export function deleteAccount(id) { | ||
| 29 | // 获得公众号账户 | 29 | // 获得公众号账户 |
| 30 | export function getAccount(id) { | 30 | export function getAccount(id) { |
| 31 | return request({ | 31 | return request({ |
| 32 | - url: '/wechatMp/account/get?id=' + id, | 32 | + url: '/mp/account/get?id=' + id, |
| 33 | method: 'get' | 33 | method: 'get' |
| 34 | }) | 34 | }) |
| 35 | } | 35 | } |
| @@ -37,7 +37,7 @@ export function getAccount(id) { | @@ -37,7 +37,7 @@ export function getAccount(id) { | ||
| 37 | // 获得公众号账户分页 | 37 | // 获得公众号账户分页 |
| 38 | export function getAccountPage(query) { | 38 | export function getAccountPage(query) { |
| 39 | return request({ | 39 | return request({ |
| 40 | - url: '/wechatMp/account/page', | 40 | + url: '/mp/account/page', |
| 41 | method: 'get', | 41 | method: 'get', |
| 42 | params: query | 42 | params: query |
| 43 | }) | 43 | }) |
| @@ -46,7 +46,7 @@ export function getAccountPage(query) { | @@ -46,7 +46,7 @@ export function getAccountPage(query) { | ||
| 46 | // 导出公众号账户 Excel | 46 | // 导出公众号账户 Excel |
| 47 | export function exportAccountExcel(query) { | 47 | export function exportAccountExcel(query) { |
| 48 | return request({ | 48 | return request({ |
| 49 | - url: '/wechatMp/account/export-excel', | 49 | + url: '/mp/account/export-excel', |
| 50 | method: 'get', | 50 | method: 'get', |
| 51 | params: query, | 51 | params: query, |
| 52 | responseType: 'blob' | 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,13 +4,9 @@ | ||
| 4 | <!-- 搜索工作栏 --> | 4 | <!-- 搜索工作栏 --> |
| 5 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | 5 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 6 | <el-form-item label="名称" prop="name"> | 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 | @keyup.enter.native="handleQuery"/> | 8 | @keyup.enter.native="handleQuery"/> |
| 9 | </el-form-item> | 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 | <el-form-item> | 10 | <el-form-item> |
| 15 | <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | 11 | <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> |
| 16 | <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | 12 | <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
| @@ -21,13 +17,7 @@ | @@ -21,13 +17,7 @@ | ||
| 21 | <el-row :gutter="10" class="mb8"> | 17 | <el-row :gutter="10" class="mb8"> |
| 22 | <el-col :span="1.5"> | 18 | <el-col :span="1.5"> |
| 23 | <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | 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 | </el-button> | 21 | </el-button> |
| 32 | </el-col> | 22 | </el-col> |
| 33 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | 23 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| @@ -35,13 +25,12 @@ | @@ -35,13 +25,12 @@ | ||
| 35 | 25 | ||
| 36 | <!-- 列表 --> | 26 | <!-- 列表 --> |
| 37 | <el-table v-loading="loading" :data="list"> | 27 | <el-table v-loading="loading" :data="list"> |
| 38 | - <el-table-column label="编号" align="center" prop="id"/> | ||
| 39 | <el-table-column label="名称" align="center" prop="name"/> | 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 | <el-table-column label="Token" align="center" prop="token"/> | 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 | <el-table-column label="二维码" align="center" prop="qrCodeUrl"/> | 34 | <el-table-column label="二维码" align="center" prop="qrCodeUrl"/> |
| 46 | <el-table-column label="备注" align="center" prop="remark"/> | 35 | <el-table-column label="备注" align="center" prop="remark"/> |
| 47 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | 36 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| @@ -52,10 +41,10 @@ | @@ -52,10 +41,10 @@ | ||
| 52 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | 41 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 53 | <template slot-scope="scope"> | 42 | <template slot-scope="scope"> |
| 54 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | 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 | </el-button> | 45 | </el-button> |
| 57 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | 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 | </el-button> | 48 | </el-button> |
| 60 | </template> | 49 | </template> |
| 61 | </el-table-column> | 50 | </el-table-column> |
| @@ -66,35 +55,37 @@ | @@ -66,35 +55,37 @@ | ||
| 66 | 55 | ||
| 67 | <!-- 对话框(添加 / 修改) --> | 56 | <!-- 对话框(添加 / 修改) --> |
| 68 | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | 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 | </el-form-item> | 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 | <el-form-item label="token" prop="token"> | 89 | <el-form-item label="token" prop="token"> |
| 99 | <el-input v-model="form.token" placeholder="请输入公众号token"/> | 90 | <el-input v-model="form.token" placeholder="请输入公众号token"/> |
| 100 | </el-form-item> | 91 | </el-form-item> |
| @@ -114,17 +105,10 @@ | @@ -114,17 +105,10 @@ | ||
| 114 | </template> | 105 | </template> |
| 115 | 106 | ||
| 116 | <script> | 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 | export default { | 110 | export default { |
| 127 | - name: 'wxAccount', | 111 | + name: 'mpAccount', |
| 128 | components: {}, | 112 | components: {}, |
| 129 | data() { | 113 | data() { |
| 130 | return { | 114 | return { |
| @@ -142,7 +126,6 @@ export default { | @@ -142,7 +126,6 @@ export default { | ||
| 142 | title: '', | 126 | title: '', |
| 143 | // 是否显示弹出层 | 127 | // 是否显示弹出层 |
| 144 | open: false, | 128 | open: false, |
| 145 | - dateRangeCreateTime: [], | ||
| 146 | // 查询参数 | 129 | // 查询参数 |
| 147 | queryParams: { | 130 | queryParams: { |
| 148 | pageNo: 1, | 131 | pageNo: 1, |
| @@ -155,10 +138,11 @@ export default { | @@ -155,10 +138,11 @@ export default { | ||
| 155 | form: {}, | 138 | form: {}, |
| 156 | // 表单校验 | 139 | // 表单校验 |
| 157 | rules: { | 140 | rules: { |
| 158 | - name: [{required: true, message: '公众号名称不能为空', trigger: 'blur'}], | 141 | + name: [{required: true, message: '名称不能为空', trigger: 'blur'}], |
| 159 | account: [{required: true, message: '公众号账户不能为空', trigger: 'blur'}], | 142 | account: [{required: true, message: '公众号账户不能为空', trigger: 'blur'}], |
| 160 | - appId: [{required: true, message: '公众号appid不能为空', trigger: 'blur'}], | 143 | + appId: [{required: true, message: '公众号 appId 不能为空', trigger: 'blur'}], |
| 161 | appSecret: [{required: true, message: '公众号密钥不能为空', trigger: 'blur'}], | 144 | appSecret: [{required: true, message: '公众号密钥不能为空', trigger: 'blur'}], |
| 145 | + token: [{required: true, message: '公众号 token 不能为空', trigger: 'blur'}], | ||
| 162 | }, | 146 | }, |
| 163 | // 禁用属性 | 147 | // 禁用属性 |
| 164 | disabled: false, | 148 | disabled: false, |
| @@ -173,7 +157,6 @@ export default { | @@ -173,7 +157,6 @@ export default { | ||
| 173 | this.loading = true | 157 | this.loading = true |
| 174 | // 处理查询参数 | 158 | // 处理查询参数 |
| 175 | let params = {...this.queryParams} | 159 | let params = {...this.queryParams} |
| 176 | - this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime') | ||
| 177 | // 执行查询 | 160 | // 执行查询 |
| 178 | getAccountPage(params).then(response => { | 161 | getAccountPage(params).then(response => { |
| 179 | this.list = response.data.list | 162 | this.list = response.data.list |
| @@ -255,7 +238,7 @@ export default { | @@ -255,7 +238,7 @@ export default { | ||
| 255 | /** 删除按钮操作 */ | 238 | /** 删除按钮操作 */ |
| 256 | handleDelete(row) { | 239 | handleDelete(row) { |
| 257 | const id = row.id | 240 | const id = row.id |
| 258 | - this.$modal.confirm('是否确认删除公众号账户编号为"' + id + '"的数据项?').then(function () { | 241 | + this.$modal.confirm('是否确认删除公众号账户编号为"' + row.name + '"的数据项?').then(function () { |
| 259 | return deleteAccount(id) | 242 | return deleteAccount(id) |
| 260 | }).then(() => { | 243 | }).then(() => { |
| 261 | this.getList() | 244 | this.getList() |
| @@ -263,23 +246,6 @@ export default { | @@ -263,23 +246,6 @@ export default { | ||
| 263 | }).catch(() => { | 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 | </script> | 251 | </script> |
yudao-ui-admin/src/views/wechatMp/wxFansTag/index.vue
| @@ -104,7 +104,7 @@ import { | @@ -104,7 +104,7 @@ import { | ||
| 104 | getWxFansTagList, | 104 | getWxFansTagList, |
| 105 | updateWxFansTag | 105 | updateWxFansTag |
| 106 | } from '@/api/wechatMp/wxFansTag' | 106 | } from '@/api/wechatMp/wxFansTag' |
| 107 | -import {getAccountPage} from '@/api/wechatMp/wxAccount' | 107 | +import {getAccountPage} from '@/api/mp/account' |
| 108 | 108 | ||
| 109 | export default { | 109 | export default { |
| 110 | name: 'WxFansTag', | 110 | name: 'WxFansTag', |