diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/MpAccountController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/MpAccountController.java new file mode 100644 index 000000000..a044e889c --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/MpAccountController.java @@ -0,0 +1,71 @@ +package cn.iocoder.yudao.module.mp.controller.admin.account; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.*; +import cn.iocoder.yudao.module.mp.convert.account.MpAccountConvert; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; +import cn.iocoder.yudao.module.mp.service.account.WxAccountService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Api(tags = "管理后台 - 公众号账户") +@RestController +@RequestMapping("/mp/account") +@Validated +public class MpAccountController { + + @Resource + private WxAccountService wxAccountService; + + @PostMapping("/create") + @ApiOperation("创建公众号账户") + @PreAuthorize("@ss.hasPermission('mp:account:create')") + public CommonResult createWxAccount(@Valid @RequestBody MpAccountCreateReqVO createReqVO) { + return success(wxAccountService.createAccount(createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新公众号账户") + @PreAuthorize("@ss.hasPermission('mp:account:update')") + public CommonResult updateWxAccount(@Valid @RequestBody MpAccountUpdateReqVO updateReqVO) { + wxAccountService.updateAccount(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除公众号账户") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('mp:account:delete')") + public CommonResult deleteWxAccount(@RequestParam("id") Long id) { + wxAccountService.deleteAccount(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得公众号账户") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('mp:account:query')") + public CommonResult getWxAccount(@RequestParam("id") Long id) { + MpAccountDO wxAccount = wxAccountService.getAccount(id); + return success(MpAccountConvert.INSTANCE.convert(wxAccount)); + } + + @GetMapping("/page") + @ApiOperation("获得公众号账户分页") + @PreAuthorize("@ss.hasPermission('mp:account:query')") + public CommonResult> getWxAccountPage(@Valid MpAccountPageReqVO pageVO) { + PageResult pageResult = wxAccountService.getAccountPage(pageVO); + return success(MpAccountConvert.INSTANCE.convertPage(pageResult)); + } + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/WxAccountController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/WxAccountController.java deleted file mode 100644 index 8d1952e2d..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/WxAccountController.java +++ /dev/null @@ -1,102 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.account; - -import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.*; -import cn.iocoder.yudao.module.mp.convert.account.WxAccountConvert; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; -import cn.iocoder.yudao.module.mp.service.account.WxAccountService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.IOException; -import java.util.Collection; -import java.util.List; - -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; - -/** - * @author fengdan - */ -@Api(tags = "管理后台 - 公众号账户") -@RestController -@RequestMapping("/wechatMp/account") -@Validated -public class WxAccountController { - - @Resource - private WxAccountService wxAccountService; - - @PostMapping("/create") - @ApiOperation("创建公众号账户") - @PreAuthorize("@ss.hasPermission('wechatMp:account:create')") - public CommonResult createWxAccount(@Valid @RequestBody WxAccountCreateReqVO createReqVO) { - return success(wxAccountService.createWxAccount(createReqVO)); - } - - @PutMapping("/update") - @ApiOperation("更新公众号账户") - @PreAuthorize("@ss.hasPermission('wechatMp:account:update')") - public CommonResult updateWxAccount(@Valid @RequestBody WxAccountUpdateReqVO updateReqVO) { - wxAccountService.updateWxAccount(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @ApiOperation("删除公众号账户") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) - @PreAuthorize("@ss.hasPermission('wechatMp:account:delete')") - public CommonResult deleteWxAccount(@RequestParam("id") Long id) { - wxAccountService.deleteWxAccount(id); - return success(true); - } - - @GetMapping("/get") - @ApiOperation("获得公众号账户") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) - @PreAuthorize("@ss.hasPermission('wechatMp:account:query')") - public CommonResult getWxAccount(@RequestParam("id") Long id) { - WxAccountDO wxAccount = wxAccountService.getWxAccount(id); - return success(WxAccountConvert.INSTANCE.convert(wxAccount)); - } - - @GetMapping("/list") - @ApiOperation("获得公众号账户列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) - @PreAuthorize("@ss.hasPermission('wechatMp:account:query')") - public CommonResult> getWxAccountList(@RequestParam("ids") Collection ids) { - List list = wxAccountService.getWxAccountList(ids); - return success(WxAccountConvert.INSTANCE.convertList(list)); - } - - @GetMapping("/page") - @ApiOperation("获得公众号账户分页") - @PreAuthorize("@ss.hasPermission('wechatMp:account:query')") - public CommonResult> getWxAccountPage(@Valid WxAccountPageReqVO pageVO) { - PageResult pageResult = wxAccountService.getWxAccountPage(pageVO); - return success(WxAccountConvert.INSTANCE.convertPage(pageResult)); - } - - @GetMapping("/export-excel") - @ApiOperation("导出公众号账户 Excel") - @PreAuthorize("@ss.hasPermission('wechatMp:account:export')") - @OperateLog(type = EXPORT) - public void exportWxAccountExcel(@Valid WxAccountExportReqVO exportReqVO, - HttpServletResponse response) throws IOException { - List list = wxAccountService.getWxAccountList(exportReqVO); - // 导出 Excel - List datas = WxAccountConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "公众号账户.xls", "数据", WxAccountExcelVO.class, datas); - } - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java similarity index 82% rename from yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountBaseVO.java rename to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java index acd8dcc6b..7930b5c82 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountBaseVO.java +++ b/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; * @author fengdan */ @Data -public class WxAccountBaseVO { +public class MpAccountBaseVO { @ApiModelProperty(value = "公众号名称", required = true) @NotNull(message = "公众号名称不能为空") @@ -22,15 +22,15 @@ public class WxAccountBaseVO { @NotNull(message = "公众号账户不能为空") private String account; - @ApiModelProperty(value = "公众号appid", required = true) - @NotNull(message = "公众号appid不能为空") + @ApiModelProperty(value = "公众号 appid", required = true) + @NotNull(message = "公众号 appid 不能为空") private String appId; @ApiModelProperty(value = "公众号密钥", required = true) @NotNull(message = "公众号密钥不能为空") private String appSecret; - @ApiModelProperty(value = "公众号token") + @ApiModelProperty(value = "公众号 token", required = true) private String token; @ApiModelProperty(value = "加密密钥") diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountCreateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountCreateReqVO.java similarity index 78% rename from yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountCreateReqVO.java rename to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountCreateReqVO.java index d2d7414fd..571664317 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountCreateReqVO.java +++ b/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; import lombok.EqualsAndHashCode; import lombok.ToString; -/** - * @author fengdan - */ @ApiModel("管理后台 - 公众号账户创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class WxAccountCreateReqVO extends WxAccountBaseVO { +public class MpAccountCreateReqVO extends MpAccountBaseVO { } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountPageReqVO.java new file mode 100644 index 000000000..7446fb3f2 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountPageReqVO.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.mp.controller.admin.account.vo; + +import lombok.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; + +@ApiModel("管理后台 - 公众号账户分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MpAccountPageReqVO extends PageParam { + + @ApiModelProperty(value = "公众号名称", notes = "模糊匹配") + private String name; + + @ApiModelProperty(value = "公众号账户", notes = "模糊匹配") + private String account; + + @ApiModelProperty(value = "公众号 appid", notes = "模糊匹配") + private String appId; + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountRespVO.java similarity index 85% rename from yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountRespVO.java rename to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountRespVO.java index 235bebc6d..0a2dcdc82 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountRespVO.java +++ b/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; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class WxAccountRespVO extends WxAccountBaseVO { +public class MpAccountRespVO extends MpAccountBaseVO { @ApiModelProperty(value = "编号", required = true) private Long id; - @ApiModelProperty(value = "公众号url") - private String url; - @ApiModelProperty(value = "二维码图片URL") private String qrCodeUrl; @@ -31,4 +28,5 @@ public class WxAccountRespVO extends WxAccountBaseVO { @ApiModelProperty(value = "公众号密钥", required = true) private String appSecret; + } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountUpdateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountUpdateReqVO.java similarity index 88% rename from yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountUpdateReqVO.java rename to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountUpdateReqVO.java index d1607d777..33cc57e01 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountUpdateReqVO.java +++ b/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.*; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class WxAccountUpdateReqVO extends WxAccountBaseVO { +public class MpAccountUpdateReqVO extends MpAccountBaseVO { @ApiModelProperty(value = "编号", required = true) @NotNull(message = "编号不能为空") diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExcelVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExcelVO.java deleted file mode 100644 index e889b353b..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExcelVO.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.account.vo; - -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; - -import java.util.Date; - - -/** - * 公众号账户 Excel VO - * - * @author 芋道源码 - */ -@Data -public class WxAccountExcelVO { - - @ExcelProperty("编号") - private Long id; - - @ExcelProperty("公众号名称") - private String name; - - @ExcelProperty("公众号账户") - private String account; - - @ExcelProperty("公众号appid") - private String appId; - - @ExcelProperty("公众号url") - private String url; - - @ExcelProperty("公众号token") - private String token; - - @ExcelProperty("加密密钥") - private String aesKey; - - @ExcelProperty("二维码图片URL") - private String qrCodeUrl; - - @ExcelProperty("备注") - private String remark; - - @ExcelProperty("创建时间") - private Date createTime; -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExportReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExportReqVO.java deleted file mode 100644 index ac3a98dc3..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountExportReqVO.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.account.vo; - -import lombok.*; -import java.util.*; -import io.swagger.annotations.*; -import org.springframework.format.annotation.DateTimeFormat; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -/** - * @author fengdan - */ -@ApiModel(value = "管理后台 - 公众号账户 Excel 导出 Request VO", description = "参数和 WxAccountPageReqVO 是一致的") -@Data -public class WxAccountExportReqVO { - - @ApiModelProperty(value = "公众号名称") - private String name; - - @ApiModelProperty(value = "公众号账户") - private String account; - - @ApiModelProperty(value = "公众号appid") - private String appId; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始创建时间") - private Date beginCreateTime; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "结束创建时间") - private Date endCreateTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountPageReqVO.java deleted file mode 100644 index d3145170d..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/WxAccountPageReqVO.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.account.vo; - -import lombok.*; -import java.util.*; -import io.swagger.annotations.*; -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import org.springframework.format.annotation.DateTimeFormat; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -/** - * @author fengdan - */ -@ApiModel("管理后台 - 公众号账户分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class WxAccountPageReqVO extends PageParam { - @ApiModelProperty(value = "公众号名称") - private String name; - - @ApiModelProperty(value = "公众号账户") - private String account; - - @ApiModelProperty(value = "公众号appid") - private String appId; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始创建时间") - private Date beginCreateTime; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "结束创建时间") - private Date endCreateTime; -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/account/MpAccountConvert.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/account/MpAccountConvert.java new file mode 100644 index 000000000..32c212230 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/account/MpAccountConvert.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.module.mp.convert.account; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountCreateReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountRespVO; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountUpdateReqVO; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +@Mapper +public interface MpAccountConvert { + + MpAccountConvert INSTANCE = Mappers.getMapper(MpAccountConvert.class); + + MpAccountDO convert(MpAccountCreateReqVO bean); + + MpAccountDO convert(MpAccountUpdateReqVO bean); + + MpAccountRespVO convert(MpAccountDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/account/WxAccountConvert.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/account/WxAccountConvert.java deleted file mode 100644 index 4646722b8..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/account/WxAccountConvert.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.yudao.module.mp.convert.account; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountCreateReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountExcelVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountRespVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountUpdateReqVO; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 公众号账户 Convert - * - * @author 芋道源码 - */ -@Mapper -public interface WxAccountConvert { - - WxAccountConvert INSTANCE = Mappers.getMapper(WxAccountConvert.class); - - WxAccountDO convert(WxAccountCreateReqVO bean); - - WxAccountDO convert(WxAccountUpdateReqVO bean); - - WxAccountRespVO convert(WxAccountDO bean); - - List convertList(List list); - - PageResult convertPage(PageResult page); - - List convertList02(List list); - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/account/WxAccountDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/account/MpAccountDO.java similarity index 87% rename from yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/account/WxAccountDO.java rename to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/account/MpAccountDO.java index 2507c4691..adefbfc57 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/account/WxAccountDO.java +++ b/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; import me.chanjar.weixin.mp.config.WxMpConfigStorage; import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl; -// TODO 亚洲:这个模块的相关类,使用 Mp 作为前缀哈 /** * 公众号账户 DO * * @author 芋道源码 */ -@TableName("wx_account") -@KeySequence("wx_account_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@TableName("mp_account") +@KeySequence("mp_account_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor -public class WxAccountDO extends BaseDO { +public class MpAccountDO extends BaseDO { /** * 编号 @@ -47,10 +46,6 @@ public class WxAccountDO extends BaseDO { * 公众号密钥 */ private String appSecret; - /** - * 公众号url - */ - private String url; /** * 公众号token */ @@ -68,6 +63,7 @@ public class WxAccountDO extends BaseDO { */ private String remark; + // TODO 芋艿:需要迁移走 public WxMpConfigStorage toWxMpConfigStorage(RedisTemplateWxRedisOps redisTemplateWxRedisOps, WxMpProperties wxMpProperties) { WxMpRedisConfigImpl wxMpRedisConfig = new WxMpRedisConfigImpl(redisTemplateWxRedisOps, wxMpProperties.getConfigStorage().getKeyPrefix()); wxMpRedisConfig.setAppId(appId); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/account/MpAccountMapper.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/account/MpAccountMapper.java new file mode 100644 index 000000000..7f03c2ccf --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/account/MpAccountMapper.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.mp.dal.mysql.account; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountPageReqVO; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MpAccountMapper extends BaseMapperX { + + default PageResult selectPage(MpAccountPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(MpAccountDO::getName, reqVO.getName()) + .likeIfPresent(MpAccountDO::getAccount, reqVO.getAccount()) + .likeIfPresent(MpAccountDO::getAppId, reqVO.getAppId()) + .orderByDesc(MpAccountDO::getId)); + } + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/account/WxAccountMapper.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/account/WxAccountMapper.java deleted file mode 100644 index ada54e8e6..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/account/WxAccountMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.yudao.module.mp.dal.mysql.account; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountExportReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountPageReqVO; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** - * 公众号账户 Mapper - * - * @author 芋道源码 - */ -@Mapper -public interface WxAccountMapper extends BaseMapperX { - - default PageResult selectPage(WxAccountPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(WxAccountDO::getName, reqVO.getName()) - .eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount()) - .eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId()) - .betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(WxAccountDO::getId)); - } - - default List selectList(WxAccountExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .likeIfPresent(WxAccountDO::getName, reqVO.getName()) - .eqIfPresent(WxAccountDO::getAccount, reqVO.getAccount()) - .eqIfPresent(WxAccountDO::getAppId, reqVO.getAppId()) - .betweenIfPresent(WxAccountDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(WxAccountDO::getId)); - } - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/MsgHandler.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/MsgHandler.java index c7a73b51f..87d2b2c8a 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/MsgHandler.java +++ b/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; import cn.iocoder.yudao.module.infra.api.file.FileApi; import cn.iocoder.yudao.module.mp.builder.TextBuilder; import cn.iocoder.yudao.module.mp.controller.admin.fansmsg.vo.WxFansMsgCreateReqVO; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; import cn.iocoder.yudao.module.mp.service.account.WxAccountService; import cn.iocoder.yudao.module.mp.service.fansmsg.WxFansMsgService; import lombok.extern.slf4j.Slf4j; @@ -55,7 +55,7 @@ public class MsgHandler implements WxMpMessageHandler { WxMpUser wxmpUser = weixinService.getUserService() .userInfo(wxMessage.getFromUser(), null); if (wxmpUser != null) { - WxAccountDO wxAccount = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); + MpAccountDO wxAccount = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); if (wxAccount != null) { if (wxMessage.getMsgType().equals(WxConsts.XmlMsgType.TEXT)) { diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/SubscribeHandler.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/SubscribeHandler.java index a25372dcc..606fa32c2 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/SubscribeHandler.java +++ b/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; import cn.iocoder.yudao.module.mp.builder.TextBuilder; import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansCreateReqVO; import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansUpdateReqVO; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO; import cn.iocoder.yudao.module.mp.dal.dataobject.subscribetext.WxSubscribeTextDO; import cn.iocoder.yudao.module.mp.dal.dataobject.texttemplate.WxTextTemplateDO; @@ -60,7 +60,7 @@ public class SubscribeHandler implements WxMpMessageHandler { .userInfo(wxMessage.getFromUser(), null); if (wxmpUser != null) { // 可以添加关注用户到本地数据库 - WxAccountDO wxAccount = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); + MpAccountDO wxAccount = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); if (wxAccount != null) { WxAccountFansDO wxAccountFans = wxAccountFansService.findBy(WxAccountFansDO::getOpenid, wxmpUser.getOpenId()); if (wxAccountFans == null) {//insert @@ -128,7 +128,7 @@ public class SubscribeHandler implements WxMpMessageHandler { try { String content = "感谢关注!";//默认 - WxAccountDO wxAccount = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); + MpAccountDO wxAccount = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); if (wxAccount != null) { WxSubscribeTextDO wxSubscribeText = wxSubscribeTextService.findBy(WxSubscribeTextDO::getWxAccountId, String.valueOf(wxAccount.getId())); if (wxSubscribeText != null) { diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/UnsubscribeHandler.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/UnsubscribeHandler.java index 825834fdf..b9d81f446 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/UnsubscribeHandler.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/handler/UnsubscribeHandler.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.mp.handler; import cn.iocoder.yudao.module.mp.controller.admin.accountfans.vo.WxAccountFansUpdateReqVO; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; import cn.iocoder.yudao.module.mp.dal.dataobject.accountfans.WxAccountFansDO; import cn.iocoder.yudao.module.mp.service.account.WxAccountService; import cn.iocoder.yudao.module.mp.service.accountfans.WxAccountFansService; @@ -34,7 +34,7 @@ public class UnsubscribeHandler implements WxMpMessageHandler { log.info("取消关注用户 OPENID: " + openId); // TODO 可以更新本地数据库为取消关注状态 - WxAccountDO wxAccountDO = wxAccountService.findBy(WxAccountDO::getAccount, wxMessage.getToUser()); + MpAccountDO wxAccountDO = wxAccountService.findBy(MpAccountDO::getAccount, wxMessage.getToUser()); if (wxAccountDO != null) { WxAccountFansDO wxAccountFansDO = wxAccountFansService.findBy(WxAccountFansDO::getOpenid, openId); if (wxAccountFansDO != null) { diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountService.java index 79650c2d7..c832e6947 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountService.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountService.java @@ -1,16 +1,13 @@ package cn.iocoder.yudao.module.mp.service.account; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountCreateReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountExportReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountPageReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountUpdateReqVO; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountCreateReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountPageReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountUpdateReqVO; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import javax.validation.Valid; -import java.util.Collection; -import java.util.List; /** * 公众号账户 Service 接口 @@ -25,21 +22,21 @@ public interface WxAccountService { * @param createReqVO 创建信息 * @return 编号 */ - Long createWxAccount(@Valid WxAccountCreateReqVO createReqVO); + Long createAccount(@Valid MpAccountCreateReqVO createReqVO); /** * 更新公众号账户 * * @param updateReqVO 更新信息 */ - void updateWxAccount(@Valid WxAccountUpdateReqVO updateReqVO); + void updateAccount(@Valid MpAccountUpdateReqVO updateReqVO); /** * 删除公众号账户 * * @param id 编号 */ - void deleteWxAccount(Long id); + void deleteAccount(Long id); /** * 获得公众号账户 @@ -47,15 +44,7 @@ public interface WxAccountService { * @param id 编号 * @return 公众号账户 */ - WxAccountDO getWxAccount(Long id); - - /** - * 获得公众号账户列表 - * - * @param ids 编号 - * @return 公众号账户列表 - */ - List getWxAccountList(Collection ids); + MpAccountDO getAccount(Long id); /** * 获得公众号账户分页 @@ -63,16 +52,9 @@ public interface WxAccountService { * @param pageReqVO 分页查询 * @return 公众号账户分页 */ - PageResult getWxAccountPage(WxAccountPageReqVO pageReqVO); - - /** - * 获得公众号账户列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 公众号账户列表 - */ - List getWxAccountList(WxAccountExportReqVO exportReqVO); + PageResult getAccountPage(MpAccountPageReqVO pageReqVO); + // TODO 芋艿:去除这样的方法 /** * 查询账户 * @@ -80,7 +62,7 @@ public interface WxAccountService { * @param val * @return */ - WxAccountDO findBy(SFunction field, Object val); + MpAccountDO findBy(SFunction field, Object val); /** * 初始化 diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountServiceImpl.java index 6b550bb20..094d5b375 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/account/WxAccountServiceImpl.java +++ b/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; import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountCreateReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountExportReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountPageReqVO; -import cn.iocoder.yudao.module.mp.controller.admin.account.vo.WxAccountUpdateReqVO; -import cn.iocoder.yudao.module.mp.convert.account.WxAccountConvert; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; -import cn.iocoder.yudao.module.mp.dal.mysql.account.WxAccountMapper; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountCreateReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountPageReqVO; +import cn.iocoder.yudao.module.mp.controller.admin.account.vo.MpAccountUpdateReqVO; +import cn.iocoder.yudao.module.mp.convert.account.MpAccountConvert; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; +import cn.iocoder.yudao.module.mp.dal.mysql.account.MpAccountMapper; import cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.mp.mq.producer.WxMpConfigDataProducer; import com.baomidou.mybatisplus.core.toolkit.support.SFunction; @@ -27,7 +26,6 @@ import org.springframework.validation.annotation.Validated; import javax.annotation.PostConstruct; import javax.annotation.Resource; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -44,8 +42,9 @@ import java.util.Map; public class WxAccountServiceImpl implements WxAccountService { private static final long SCHEDULER_PERIOD = 5 * 60 * 1000L; + @Resource - private WxAccountMapper wxAccountMapper; + private MpAccountMapper wxAccountMapper; @Resource private WxMpConfigDataProducer wxMpConfigDataProducer; @Resource @@ -59,31 +58,39 @@ public class WxAccountServiceImpl implements WxAccountService { private WxAccountService self; @Override - public Long createWxAccount(WxAccountCreateReqVO createReqVO) { + public Long createAccount(MpAccountCreateReqVO createReqVO) { + // TODO 芋艿:校验唯一性 // 插入 - WxAccountDO wxAccount = WxAccountConvert.INSTANCE.convert(createReqVO); + MpAccountDO wxAccount = MpAccountConvert.INSTANCE.convert(createReqVO); wxAccountMapper.insert(wxAccount); + + // TODO 芋艿:刷新的方式 wxMpConfigDataProducer.sendDictDataRefreshMessage(); // 返回 return wxAccount.getId(); } @Override - public void updateWxAccount(WxAccountUpdateReqVO updateReqVO) { + public void updateAccount(MpAccountUpdateReqVO updateReqVO) { + // TODO 芋艿:校验唯一性 // 校验存在 - this.validateWxAccountExists(updateReqVO.getId()); + validateWxAccountExists(updateReqVO.getId()); // 更新 - WxAccountDO updateObj = WxAccountConvert.INSTANCE.convert(updateReqVO); + MpAccountDO updateObj = MpAccountConvert.INSTANCE.convert(updateReqVO); wxAccountMapper.updateById(updateObj); + + // TODO 芋艿:刷新的方式 wxMpConfigDataProducer.sendDictDataRefreshMessage(); } @Override - public void deleteWxAccount(Long id) { + public void deleteAccount(Long id) { // 校验存在 - this.validateWxAccountExists(id); + validateWxAccountExists(id); // 删除 wxAccountMapper.deleteById(id); + + // TODO 芋艿:刷新的方式 wxMpConfigDataProducer.sendDictDataRefreshMessage(); } @@ -94,27 +101,17 @@ public class WxAccountServiceImpl implements WxAccountService { } @Override - public WxAccountDO getWxAccount(Long id) { + public MpAccountDO getAccount(Long id) { return wxAccountMapper.selectById(id); } @Override - public List getWxAccountList(Collection ids) { - return wxAccountMapper.selectBatchIds(ids); - } - - @Override - public PageResult getWxAccountPage(WxAccountPageReqVO pageReqVO) { + public PageResult getAccountPage(MpAccountPageReqVO pageReqVO) { return wxAccountMapper.selectPage(pageReqVO); } @Override - public List getWxAccountList(WxAccountExportReqVO exportReqVO) { - return wxAccountMapper.selectList(exportReqVO); - } - - @Override - public WxAccountDO findBy(SFunction field, Object val) { + public MpAccountDO findBy(SFunction field, Object val) { return wxAccountMapper.selectOne(field, val); } @@ -122,7 +119,8 @@ public class WxAccountServiceImpl implements WxAccountService { @TenantIgnore @Override public void initLoadWxMpConfigStorages() { - List wxAccountList = this.wxAccountMapper.selectList(); + // TODO 芋艿:刷新的方式 + List wxAccountList = this.wxAccountMapper.selectList(); if (CollectionUtils.isEmpty(wxAccountList)) { log.info("未读取到公众号配置,请在管理后台添加"); return; @@ -137,7 +135,7 @@ public class WxAccountServiceImpl implements WxAccountService { * * @param account 公众号 */ - private synchronized void addAccountToRuntime(WxAccountDO account, RedisTemplateWxRedisOps redisOps) { + private synchronized void addAccountToRuntime(MpAccountDO account, RedisTemplateWxRedisOps redisOps) { String appId = account.getAppId(); WxMpConfigStorage wxMpRedisConfig = account.toWxMpConfigStorage(redisOps, wxMpProperties); try { diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagService.java index 6247069a4..a7f2141e3 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagService.java +++ b/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.*; import javax.validation.*; import cn.iocoder.yudao.module.mp.controller.admin.accountfanstag.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; import cn.iocoder.yudao.module.mp.dal.dataobject.accountfanstag.WxAccountFansTagDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import me.chanjar.weixin.mp.bean.result.WxMpUser; @@ -70,5 +70,5 @@ public interface WxAccountFansTagService { */ List getWxAccountFansTagList(WxAccountFansTagExportReqVO exportReqVO); - void processFansTags(WxAccountDO wxAccount, WxMpUser wxmpUser); + void processFansTags(MpAccountDO wxAccount, WxMpUser wxmpUser); } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java index 436856178..50d0dc485 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/accountfanstag/WxAccountFansTagServiceImpl.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.mp.service.accountfanstag; -import cn.hutool.core.date.DateUtil; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; import me.chanjar.weixin.mp.bean.result.WxMpUser; import org.springframework.stereotype.Service; @@ -86,7 +85,7 @@ public class WxAccountFansTagServiceImpl implements WxAccountFansTagService { } @Override - public void processFansTags(WxAccountDO wxAccountDO, WxMpUser wxmpUser) { + public void processFansTags(MpAccountDO wxAccountDO, WxMpUser wxmpUser) { WxAccountFansTagExportReqVO wxAccountFansTagTpl = new WxAccountFansTagExportReqVO(); wxAccountFansTagTpl.setOpenid(wxmpUser.getOpenId()); List wxAccountFansTagList = this.getWxAccountFansTagList(wxAccountFansTagTpl); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/subscribetext/WxSubscribeTextService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/subscribetext/WxSubscribeTextService.java index a4294494e..e28adb0aa 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/subscribetext/WxSubscribeTextService.java +++ b/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.*; import javax.validation.*; import cn.iocoder.yudao.module.mp.controller.admin.subscribetext.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.account.WxAccountDO; import cn.iocoder.yudao.module.mp.dal.dataobject.subscribetext.WxSubscribeTextDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import com.baomidou.mybatisplus.core.toolkit.support.SFunction; diff --git a/yudao-ui-admin/src/api/wechatMp/wxAccount.js b/yudao-ui-admin/src/api/mp/account.js similarity index 76% rename from yudao-ui-admin/src/api/wechatMp/wxAccount.js rename to yudao-ui-admin/src/api/mp/account.js index 22d826279..4ff18ffac 100644 --- a/yudao-ui-admin/src/api/wechatMp/wxAccount.js +++ b/yudao-ui-admin/src/api/mp/account.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 创建公众号账户 export function createAccount(data) { return request({ - url: '/wechatMp/account/create', + url: '/mp/account/create', method: 'post', data: data }) @@ -12,7 +12,7 @@ export function createAccount(data) { // 更新公众号账户 export function updateAccount(data) { return request({ - url: '/wechatMp/account/update', + url: '/mp/account/update', method: 'put', data: data }) @@ -21,7 +21,7 @@ export function updateAccount(data) { // 删除公众号账户 export function deleteAccount(id) { return request({ - url: '/wechatMp/account/delete?id=' + id, + url: '/mp/account/delete?id=' + id, method: 'delete' }) } @@ -29,7 +29,7 @@ export function deleteAccount(id) { // 获得公众号账户 export function getAccount(id) { return request({ - url: '/wechatMp/account/get?id=' + id, + url: '/mp/account/get?id=' + id, method: 'get' }) } @@ -37,7 +37,7 @@ export function getAccount(id) { // 获得公众号账户分页 export function getAccountPage(query) { return request({ - url: '/wechatMp/account/page', + url: '/mp/account/page', method: 'get', params: query }) @@ -46,7 +46,7 @@ export function getAccountPage(query) { // 导出公众号账户 Excel export function exportAccountExcel(query) { return request({ - url: '/wechatMp/account/export-excel', + url: '/mp/account/export-excel', method: 'get', params: query, responseType: 'blob' diff --git a/yudao-ui-admin/src/views/wechatMp/wxAccount/index.vue b/yudao-ui-admin/src/views/mp/account/index.vue similarity index 63% rename from yudao-ui-admin/src/views/wechatMp/wxAccount/index.vue rename to yudao-ui-admin/src/views/mp/account/index.vue index e61ad6b2b..c81977a86 100644 --- a/yudao-ui-admin/src/views/wechatMp/wxAccount/index.vue +++ b/yudao-ui-admin/src/views/mp/account/index.vue @@ -4,13 +4,9 @@ - - - - 搜索 重置 @@ -21,13 +17,7 @@ 新增 - - - - 导出 + v-hasPermi="['mp:account:create']">新增 @@ -35,13 +25,12 @@ - - - - + + + - + @@ -52,10 +41,10 @@ @@ -66,35 +55,37 @@ - - - + + + + + + + + + + 微信号 + + + + + + + + + appId + + + + + + + + + 密钥 + + - - - - - - - - - - - - - - - - - - - @@ -114,17 +105,10 @@ diff --git a/yudao-ui-admin/src/views/wechatMp/wxFansTag/index.vue b/yudao-ui-admin/src/views/wechatMp/wxFansTag/index.vue index bc647291a..b2c2fc5af 100644 --- a/yudao-ui-admin/src/views/wechatMp/wxFansTag/index.vue +++ b/yudao-ui-admin/src/views/wechatMp/wxFansTag/index.vue @@ -104,7 +104,7 @@ import { getWxFansTagList, updateWxFansTag } from '@/api/wechatMp/wxFansTag' -import {getAccountPage} from '@/api/wechatMp/wxAccount' +import {getAccountPage} from '@/api/mp/account' export default { name: 'WxFansTag',