diff --git a/http-client.env.json b/http-client.env.json index 6cb5343e0..4a4cb5221 100644 --- a/http-client.env.json +++ b/http-client.env.json @@ -2,7 +2,7 @@ "local": { "baseUrl": "http://127.0.0.1:48080/admin-api", "token": "test1", - "appTenantId": "1", + "adminTenentId": "1", "appApi": "http://127.0.0.1:48080/app-api", "appToken": "test247", diff --git a/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/enums/ErrorCodeConstants.java b/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/enums/ErrorCodeConstants.java index 14e82db38..d41ac356c 100644 --- a/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/enums/ErrorCodeConstants.java +++ b/yudao-module-mp/yudao-module-mp-api/src/main/java/cn/iocoder/yudao/module/mp/enums/ErrorCodeConstants.java @@ -3,15 +3,15 @@ package cn.iocoder.yudao.module.mp.enums; import cn.iocoder.yudao.framework.common.exception.ErrorCode; /** - * Member 错误码枚举类 + * Mp 错误码枚举类 * - * wechatMp 系统,使用 1-004-000-000 段 + * mp 系统,使用 1-006-000-000 段 */ public interface ErrorCodeConstants { // ========== 用户相关 1004001000============ - ErrorCode WX_ACCOUNT_NOT_EXISTS = new ErrorCode(1004001000, "公众号账户不存在"); - ErrorCode WX_ACCOUNT_FANS_NOT_EXISTS = new ErrorCode(1004001001, "粉丝账号不存在"); - ErrorCode COMMON_NOT_EXISTS = new ErrorCode(1004001002, "用户不存在"); + ErrorCode WX_ACCOUNT_NOT_EXISTS = new ErrorCode(1006001000, "公众号账户不存在"); + ErrorCode WX_ACCOUNT_FANS_NOT_EXISTS = new ErrorCode(1006001001, "粉丝账号不存在"); + ErrorCode COMMON_NOT_EXISTS = new ErrorCode(1006001002, "用户不存在"); } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java index 7930b5c82..cc1b158a7 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java @@ -22,8 +22,8 @@ public class MpAccountBaseVO { @NotNull(message = "公众号账户不能为空") private String account; - @ApiModelProperty(value = "公众号 appid", required = true) - @NotNull(message = "公众号 appid 不能为空") + @ApiModelProperty(value = "公众号 appId", required = true, example = "wx5b23ba7a5589ecbb") + @NotNull(message = "公众号 appId 不能为空") private String appId; @ApiModelProperty(value = "公众号密钥", required = true) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/WxAccountFansTagController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/WxAccountFansTagController.java index aa4a0e311..c006dbc0d 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/WxAccountFansTagController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/accountfanstag/WxAccountFansTagController.java @@ -88,16 +88,4 @@ public class WxAccountFansTagController { return success(WxAccountFansTagConvert.INSTANCE.convertPage(pageResult)); } - @GetMapping("/export-excel") - @ApiOperation("导出粉丝标签关联 Excel") - @PreAuthorize("@ss.hasPermission('wechatMp:wx-account-fans-tag:export')") - @OperateLog(type = EXPORT) - public void exportWxAccountFansTagExcel(@Valid WxAccountFansTagExportReqVO exportReqVO, - HttpServletResponse response) throws IOException { - List list = wxAccountFansTagService.getWxAccountFansTagList(exportReqVO); - // 导出 Excel - List datas = WxAccountFansTagConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "粉丝标签关联.xls", "数据", WxAccountFansTagExcelVO.class, datas); - } - } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.http b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.http new file mode 100644 index 000000000..85b202374 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.http @@ -0,0 +1,20 @@ +### 请求 /login 接口 => 成功 +POST {{baseUrl}}/mp/menu/save +Content-Type: application/json +Authorization: Bearer {{token}} +tenant-id: {{adminTenentId}} + +{ + "accountId": "1", + "buttons": [ + { + "type":"click", + "name":"今日歌曲", + "key":"V1001_TODAY_MUSIC" + }, + { + "name":"搜索", + "type":"view", + "url":"http://www.soso.com/" + }] +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.java new file mode 100644 index 000000000..7e427ad85 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.mp.controller.admin.menu; + +import cn.iocoder.yudao.module.mp.convert.menu.MpMenuConvert; +import cn.iocoder.yudao.module.mp.dal.dataobject.menu.MpMenuDO; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.annotations.*; + +import javax.validation.*; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*; +import cn.iocoder.yudao.module.mp.service.menu.MpMenuService; + +@Api(tags = "管理后台 - 微信菜单") +@RestController +@RequestMapping("/mp/menu") +@Validated +public class MpMenuController { + + @Resource + private MpMenuService mpMenuService; + + @PostMapping("/save") + @ApiOperation("保存微信菜单") + @PreAuthorize("@ss.hasPermission('mp:menu:save')") + public CommonResult saveMenu(@Valid @RequestBody MpMenuSaveReqVO createReqVO) { + return success(mpMenuService.saveMenu(createReqVO)); + } + + @DeleteMapping("/delete") + @ApiOperation("删除微信菜单") + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('mp:menu:delete')") + public CommonResult deleteMenu(@RequestParam("id") Long id) { + mpMenuService.deleteMenu(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得微信菜单") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('mp:menu:query')") + public CommonResult getMenu(@RequestParam("id") Long id) { + MpMenuDO menu = mpMenuService.getMenu(id); + return success(MpMenuConvert.INSTANCE.convert(menu)); + } + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/WxMenuController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/WxMenuController.java deleted file mode 100644 index d8472fb5d..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/WxMenuController.java +++ /dev/null @@ -1,103 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.menu; - -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import io.swagger.annotations.*; - -import javax.validation.*; -import javax.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.pojo.CommonResult; - -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; - -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; - -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; - -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; - -import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.menu.WxMenuDO; -import cn.iocoder.yudao.module.mp.convert.menu.WxMenuConvert; -import cn.iocoder.yudao.module.mp.service.menu.WxMenuService; - -@Api(tags = "管理后台 - 微信菜单") -@RestController -@RequestMapping("/wechatMp/wx-menu") -@Validated -public class WxMenuController { - - @Resource - private WxMenuService wxMenuService; - - @PostMapping("/create") - @ApiOperation("创建微信菜单") - @PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:create')") - public CommonResult createWxMenu(@Valid @RequestBody WxMenuCreateReqVO createReqVO) { - return success(wxMenuService.createWxMenu(createReqVO)); - } - - @PutMapping("/update") - @ApiOperation("更新微信菜单") - @PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:update')") - public CommonResult updateWxMenu(@Valid @RequestBody WxMenuUpdateReqVO updateReqVO) { - wxMenuService.updateWxMenu(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @ApiOperation("删除微信菜单") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class) - @PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:delete')") - public CommonResult deleteWxMenu(@RequestParam("id") Integer id) { - wxMenuService.deleteWxMenu(id); - return success(true); - } - - @GetMapping("/get") - @ApiOperation("获得微信菜单") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class) - @PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:query')") - public CommonResult getWxMenu(@RequestParam("id") Integer id) { - WxMenuDO wxMenu = wxMenuService.getWxMenu(id); - return success(WxMenuConvert.INSTANCE.convert(wxMenu)); - } - - @GetMapping("/list") - @ApiOperation("获得微信菜单列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) - @PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:query')") - public CommonResult> getWxMenuList(@RequestParam("ids") Collection ids) { - List list = wxMenuService.getWxMenuList(ids); - return success(WxMenuConvert.INSTANCE.convertList(list)); - } - - @GetMapping("/page") - @ApiOperation("获得微信菜单分页") - @PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:query')") - public CommonResult> getWxMenuPage(@Valid WxMenuPageReqVO pageVO) { - PageResult pageResult = wxMenuService.getWxMenuPage(pageVO); - return success(WxMenuConvert.INSTANCE.convertPage(pageResult)); - } - - @GetMapping("/export-excel") - @ApiOperation("导出微信菜单 Excel") - @PreAuthorize("@ss.hasPermission('wechatMp:wx-menu:export')") - @OperateLog(type = EXPORT) - public void exportWxMenuExcel(@Valid WxMenuExportReqVO exportReqVO, - HttpServletResponse response) throws IOException { - List list = wxMenuService.getWxMenuList(exportReqVO); - // 导出 Excel - List datas = WxMenuConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "微信菜单.xls", "数据", WxMenuExcelVO.class, datas); - } - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java new file mode 100644 index 000000000..070d7c2f5 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import me.chanjar.weixin.common.bean.menu.WxMenuButton; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 微信菜单 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class MpMenuBaseVO { + + @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @NotNull(message = "公众号账号的编号不能为空") + private Long accountId; + + @NotNull(message = "按钮不能为空") + private List buttons; + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuRespVO.java similarity index 84% rename from yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuRespVO.java rename to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuRespVO.java index 21ccf9834..c8f0f1f42 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuRespVO.java @@ -10,10 +10,10 @@ import io.swagger.annotations.*; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class WxMenuRespVO extends WxMenuBaseVO { +public class MpMenuRespVO extends MpMenuBaseVO { @ApiModelProperty(value = "主键", required = true) - private Integer id; + private Long id; @ApiModelProperty(value = "创建时间", required = true) private Date createTime; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuCreateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuSaveReqVO.java similarity index 62% rename from yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuCreateReqVO.java rename to yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuSaveReqVO.java index 1f5e52749..6c84eb2e5 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuCreateReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuSaveReqVO.java @@ -3,10 +3,10 @@ package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; import lombok.*; import io.swagger.annotations.*; -@ApiModel("管理后台 - 微信菜单创建 Request VO") +@ApiModel("管理后台 - 微信菜单保存 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class WxMenuCreateReqVO extends WxMenuBaseVO { +public class MpMenuSaveReqVO extends MpMenuBaseVO { } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuBaseVO.java deleted file mode 100644 index 303d4a818..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuBaseVO.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; - -import lombok.*; -import io.swagger.annotations.*; - -/** - * 微信菜单 Base VO,提供给添加、修改、详细的子 VO 使用 - * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 - */ -@Data -public class WxMenuBaseVO { - - @ApiModelProperty(value = "父ID") - private String parentId; - - @ApiModelProperty(value = "菜单名称") - private String menuName; - - @ApiModelProperty(value = "菜单类型 1文本消息;2图文消息;3网址链接;4小程序") - private String menuType; - - @ApiModelProperty(value = "菜单等级") - private String menuLevel; - - @ApiModelProperty(value = "模板ID") - private String tplId; - - @ApiModelProperty(value = "菜单URL") - private String menuUrl; - - @ApiModelProperty(value = "排序") - private String menuSort; - - @ApiModelProperty(value = "微信账号ID") - private String wxAccountId; - - @ApiModelProperty(value = "小程序appid") - private String miniprogramAppid; - - @ApiModelProperty(value = "小程序页面路径") - private String miniprogramPagepath; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuExcelVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuExcelVO.java deleted file mode 100644 index 89302f2d2..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuExcelVO.java +++ /dev/null @@ -1,53 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; - -import lombok.*; - -import java.util.*; - -import com.alibaba.excel.annotation.ExcelProperty; - -/** - * 微信菜单 Excel VO - * - * @author 芋道源码 - */ -@Data -public class WxMenuExcelVO { - - @ExcelProperty("主键") - private Integer id; - - @ExcelProperty("父ID") - private String parentId; - - @ExcelProperty("菜单名称") - private String menuName; - - @ExcelProperty("菜单类型 1文本消息;2图文消息;3网址链接;4小程序") - private String menuType; - - @ExcelProperty("菜单等级") - private String menuLevel; - - @ExcelProperty("模板ID") - private String tplId; - - @ExcelProperty("菜单URL") - private String menuUrl; - - @ExcelProperty("排序") - private String menuSort; - - @ExcelProperty("微信账号ID") - private String wxAccountId; - - @ExcelProperty("小程序appid") - private String miniprogramAppid; - - @ExcelProperty("小程序页面路径") - private String miniprogramPagepath; - - @ExcelProperty("创建时间") - private Date createTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuExportReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuExportReqVO.java deleted file mode 100644 index 4faa5338f..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuExportReqVO.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; - -import lombok.*; - -import java.util.*; - -import io.swagger.annotations.*; -import org.springframework.format.annotation.DateTimeFormat; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@ApiModel(value = "管理后台 - 微信菜单 Excel 导出 Request VO", description = "参数和 WxMenuPageReqVO 是一致的") -@Data -public class WxMenuExportReqVO { - - @ApiModelProperty(value = "父ID") - private String parentId; - - @ApiModelProperty(value = "菜单名称") - private String menuName; - - @ApiModelProperty(value = "菜单类型 1文本消息;2图文消息;3网址链接;4小程序") - private String menuType; - - @ApiModelProperty(value = "菜单等级") - private String menuLevel; - - @ApiModelProperty(value = "模板ID") - private String tplId; - - @ApiModelProperty(value = "菜单URL") - private String menuUrl; - - @ApiModelProperty(value = "排序") - private String menuSort; - - @ApiModelProperty(value = "微信账号ID") - private String wxAccountId; - - @ApiModelProperty(value = "小程序appid") - private String miniprogramAppid; - - @ApiModelProperty(value = "小程序页面路径") - private String miniprogramPagepath; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始创建时间") - private Date beginCreateTime; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "结束创建时间") - private Date endCreateTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuPageReqVO.java deleted file mode 100644 index 5fe1cbe0f..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuPageReqVO.java +++ /dev/null @@ -1,57 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; - -import lombok.*; - -import java.util.*; - -import io.swagger.annotations.*; -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import org.springframework.format.annotation.DateTimeFormat; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@ApiModel("管理后台 - 微信菜单分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class WxMenuPageReqVO extends PageParam { - - @ApiModelProperty(value = "父ID") - private String parentId; - - @ApiModelProperty(value = "菜单名称") - private String menuName; - - @ApiModelProperty(value = "菜单类型 1文本消息;2图文消息;3网址链接;4小程序") - private String menuType; - - @ApiModelProperty(value = "菜单等级") - private String menuLevel; - - @ApiModelProperty(value = "模板ID") - private String tplId; - - @ApiModelProperty(value = "菜单URL") - private String menuUrl; - - @ApiModelProperty(value = "排序") - private String menuSort; - - @ApiModelProperty(value = "微信账号ID") - private String wxAccountId; - - @ApiModelProperty(value = "小程序appid") - private String miniprogramAppid; - - @ApiModelProperty(value = "小程序页面路径") - private String miniprogramPagepath; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始创建时间") - private Date beginCreateTime; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "结束创建时间") - private Date endCreateTime; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuUpdateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuUpdateReqVO.java deleted file mode 100644 index 5603624a4..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/WxMenuUpdateReqVO.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; - -import lombok.*; -import io.swagger.annotations.*; - -import javax.validation.constraints.*; - -@ApiModel("管理后台 - 微信菜单更新 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class WxMenuUpdateReqVO extends WxMenuBaseVO { - - @ApiModelProperty(value = "主键", required = true) - @NotNull(message = "主键不能为空") - private Integer id; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/menu/MpMenuConvert.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/menu/MpMenuConvert.java new file mode 100644 index 000000000..6de73893e --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/menu/MpMenuConvert.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.mp.convert.menu; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*; +import cn.iocoder.yudao.module.mp.dal.dataobject.menu.MpMenuDO; + +@Mapper +public interface MpMenuConvert { + + MpMenuConvert INSTANCE = Mappers.getMapper(MpMenuConvert.class); + + MpMenuDO convert(MpMenuSaveReqVO bean); + + MpMenuRespVO convert(MpMenuDO bean); + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/menu/WxMenuConvert.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/menu/WxMenuConvert.java deleted file mode 100644 index 38d0c516e..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/menu/WxMenuConvert.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.yudao.module.mp.convert.menu; - -import java.util.*; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; -import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.menu.WxMenuDO; - -/** - * 微信菜单 Convert - * - * @author 芋道源码 - */ -@Mapper -public interface WxMenuConvert { - - WxMenuConvert INSTANCE = Mappers.getMapper(WxMenuConvert.class); - - WxMenuDO convert(WxMenuCreateReqVO bean); - - WxMenuDO convert(WxMenuUpdateReqVO bean); - - WxMenuRespVO convert(WxMenuDO 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/menu/MpMenuDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/menu/MpMenuDO.java new file mode 100644 index 000000000..3d1c2bba4 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/menu/MpMenuDO.java @@ -0,0 +1,75 @@ +package cn.iocoder.yudao.module.mp.dal.dataobject.menu; + +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; +import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; +import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; +import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler; +import lombok.*; + +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import me.chanjar.weixin.common.bean.menu.WxMenu; +import me.chanjar.weixin.common.bean.menu.WxMenuButton; + +import java.util.List; + +/** + * 微信菜单 DO + * + * 一个公众号,只有一个 MpMenuDO 记录。一个公众号的多个菜单,对应到就是 {@link #buttons} 多个按钮 + * + * @author 芋道源码 + */ +@TableName(value = "mp_menu", autoResultMap = true) +@KeySequence("mp_menu_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MpMenuDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 微信公众号 ID + * + * 关联 {@link MpAccountDO#getId()} + */ + private Long accountId; + /** + * 微信公众号 appid + * + * 冗余 {@link MpAccountDO#getAppId()} + */ + private String appId; + + /** + * 按钮列表 + */ + @TableField(typeHandler = WxMenuButtonTypeHandler.class) + private List buttons; + /** + * 同步状态 + * + * true - 已同步 + * false - 未同步 + */ + private Boolean syncStatus; + + // TODO @芋艿:可以找一些新的思路 + public static class WxMenuButtonTypeHandler extends AbstractJsonTypeHandler> { + + @Override + protected List parse(String json) { + return JsonUtils.parseArray(json, WxMenuButton.class); + } + + @Override + protected String toJson(List obj) { + return JsonUtils.toJsonString(obj); + } + + } +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/menu/WxMenuDO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/menu/WxMenuDO.java deleted file mode 100644 index d5b0b9c3d..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/dataobject/menu/WxMenuDO.java +++ /dev/null @@ -1,71 +0,0 @@ -package cn.iocoder.yudao.module.mp.dal.dataobject.menu; - -import lombok.*; - -import java.util.*; - -import com.baomidou.mybatisplus.annotation.*; -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; - -/** - * 微信菜单 DO - * - * @author 芋道源码 - */ -@TableName("wx_menu") -@KeySequence("wx_menu_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class WxMenuDO extends BaseDO { - - /** - * 主键 - */ - @TableId - private Integer id; - /** - * 父ID - */ - private String parentId; - /** - * 菜单名称 - */ - private String menuName; - /** - * 菜单类型 1文本消息;2图文消息;3网址链接;4小程序 - */ - private String menuType; - /** - * 菜单等级 - */ - private String menuLevel; - /** - * 模板ID - */ - private String tplId; - /** - * 菜单URL - */ - private String menuUrl; - /** - * 排序 - */ - private String menuSort; - /** - * 微信账号ID - */ - private String wxAccountId; - /** - * 小程序appid - */ - private String miniprogramAppid; - /** - * 小程序页面路径 - */ - private String miniprogramPagepath; - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/menu/MpMenuMapper.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/menu/MpMenuMapper.java new file mode 100644 index 000000000..251aa8a53 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/menu/MpMenuMapper.java @@ -0,0 +1,10 @@ +package cn.iocoder.yudao.module.mp.dal.mysql.menu; + +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.mp.dal.dataobject.menu.MpMenuDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface MpMenuMapper extends BaseMapperX { + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/menu/WxMenuMapper.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/menu/WxMenuMapper.java deleted file mode 100644 index 2966bac6b..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/dal/mysql/menu/WxMenuMapper.java +++ /dev/null @@ -1,52 +0,0 @@ -package cn.iocoder.yudao.module.mp.dal.mysql.menu; - -import java.util.*; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.module.mp.dal.dataobject.menu.WxMenuDO; -import org.apache.ibatis.annotations.Mapper; -import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*; - -/** - * 微信菜单 Mapper - * - * @author 芋道源码 - */ -@Mapper -public interface WxMenuMapper extends BaseMapperX { - - default PageResult selectPage(WxMenuPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(WxMenuDO::getParentId, reqVO.getParentId()) - .likeIfPresent(WxMenuDO::getMenuName, reqVO.getMenuName()) - .eqIfPresent(WxMenuDO::getMenuType, reqVO.getMenuType()) - .eqIfPresent(WxMenuDO::getMenuLevel, reqVO.getMenuLevel()) - .eqIfPresent(WxMenuDO::getTplId, reqVO.getTplId()) - .eqIfPresent(WxMenuDO::getMenuUrl, reqVO.getMenuUrl()) - .eqIfPresent(WxMenuDO::getMenuSort, reqVO.getMenuSort()) - .eqIfPresent(WxMenuDO::getWxAccountId, reqVO.getWxAccountId()) - .eqIfPresent(WxMenuDO::getMiniprogramAppid, reqVO.getMiniprogramAppid()) - .eqIfPresent(WxMenuDO::getMiniprogramPagepath, reqVO.getMiniprogramPagepath()) - .betweenIfPresent(WxMenuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(WxMenuDO::getId)); - } - - default List selectList(WxMenuExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(WxMenuDO::getParentId, reqVO.getParentId()) - .likeIfPresent(WxMenuDO::getMenuName, reqVO.getMenuName()) - .eqIfPresent(WxMenuDO::getMenuType, reqVO.getMenuType()) - .eqIfPresent(WxMenuDO::getMenuLevel, reqVO.getMenuLevel()) - .eqIfPresent(WxMenuDO::getTplId, reqVO.getTplId()) - .eqIfPresent(WxMenuDO::getMenuUrl, reqVO.getMenuUrl()) - .eqIfPresent(WxMenuDO::getMenuSort, reqVO.getMenuSort()) - .eqIfPresent(WxMenuDO::getWxAccountId, reqVO.getWxAccountId()) - .eqIfPresent(WxMenuDO::getMiniprogramAppid, reqVO.getMiniprogramAppid()) - .eqIfPresent(WxMenuDO::getMiniprogramPagepath, reqVO.getMiniprogramPagepath()) - .betweenIfPresent(WxMenuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc(WxMenuDO::getId)); - } - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuService.java new file mode 100644 index 000000000..1bb45a381 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuService.java @@ -0,0 +1,38 @@ +package cn.iocoder.yudao.module.mp.service.menu; + +import javax.validation.*; + +import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*; +import cn.iocoder.yudao.module.mp.dal.dataobject.menu.MpMenuDO; + +/** + * 微信菜单 Service 接口 + * + * @author 芋道源码 + */ +public interface MpMenuService { + + /** + * 保存微信菜单 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long saveMenu(@Valid MpMenuSaveReqVO createReqVO); + + /** + * 删除微信菜单 + * + * @param id 编号 + */ + void deleteMenu(Long id); + + /** + * 获得微信菜单 + * + * @param id 编号 + * @return 微信菜单 + */ + MpMenuDO getMenu(Long id); + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuServiceImpl.java new file mode 100644 index 000000000..823a1dad7 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/MpMenuServiceImpl.java @@ -0,0 +1,80 @@ +package cn.iocoder.yudao.module.mp.service.menu; + +import cn.iocoder.yudao.module.mp.convert.menu.MpMenuConvert; +import cn.iocoder.yudao.module.mp.dal.dataobject.menu.MpMenuDO; +import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; +import me.chanjar.weixin.common.bean.menu.WxMenu; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.mp.api.WxMpService; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +import org.springframework.validation.annotation.Validated; + +import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*; + +import cn.iocoder.yudao.module.mp.dal.mysql.menu.MpMenuMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; + +/** + * 微信菜单 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class MpMenuServiceImpl implements MpMenuService { + + @Resource + @Lazy // 延迟加载,避免循环引用报错 + private MpServiceFactory mpServiceFactory; + + @Resource + private MpMenuMapper mpMenuMapper; + + @Override + public Long saveMenu(MpMenuSaveReqVO createReqVO) { + String appId = "wx5b23ba7a5589ecbb"; + // 插入 + MpMenuDO menu = MpMenuConvert.INSTANCE.convert(createReqVO); +// mpMenuMapper.insert(menu); + + // TODO 同步菜单 + WxMpService mpService = mpServiceFactory.getRequiredMpService(appId); + WxMenu wxMenu = new WxMenu(); + wxMenu.setButtons(createReqVO.getButtons()); + try { + mpService.getMenuService().menuCreate(wxMenu); + } catch (WxErrorException e) { + throw new RuntimeException(e); + } + + // 返回 + return menu.getId(); + } + + @Override + public void deleteMenu(Long id) { + // 校验存在 + validateMenuExists(id); + // 删除 + mpMenuMapper.deleteById(id); + } + + private void validateMenuExists(Long id) { + if (mpMenuMapper.selectById(id) == null) { + // TODO 芋艿:错误码不太对 + throw exception(COMMON_NOT_EXISTS); + } + } + + @Override + public MpMenuDO getMenu(Long id) { + return mpMenuMapper.selectById(id); + } + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/WxMenuService.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/WxMenuService.java deleted file mode 100644 index 0876db274..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/WxMenuService.java +++ /dev/null @@ -1,71 +0,0 @@ -package cn.iocoder.yudao.module.mp.service.menu; - -import java.util.*; -import javax.validation.*; - -import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.menu.WxMenuDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -/** - * 微信菜单 Service 接口 - * - * @author 芋道源码 - */ -public interface WxMenuService { - - /** - * 创建微信菜单 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Integer createWxMenu(@Valid WxMenuCreateReqVO createReqVO); - - /** - * 更新微信菜单 - * - * @param updateReqVO 更新信息 - */ - void updateWxMenu(@Valid WxMenuUpdateReqVO updateReqVO); - - /** - * 删除微信菜单 - * - * @param id 编号 - */ - void deleteWxMenu(Integer id); - - /** - * 获得微信菜单 - * - * @param id 编号 - * @return 微信菜单 - */ - WxMenuDO getWxMenu(Integer id); - - /** - * 获得微信菜单列表 - * - * @param ids 编号 - * @return 微信菜单列表 - */ - List getWxMenuList(Collection ids); - - /** - * 获得微信菜单分页 - * - * @param pageReqVO 分页查询 - * @return 微信菜单分页 - */ - PageResult getWxMenuPage(WxMenuPageReqVO pageReqVO); - - /** - * 获得微信菜单列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 微信菜单列表 - */ - List getWxMenuList(WxMenuExportReqVO exportReqVO); - -} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/WxMenuServiceImpl.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/WxMenuServiceImpl.java deleted file mode 100644 index 6f8fc377a..000000000 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/menu/WxMenuServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package cn.iocoder.yudao.module.mp.service.menu; - -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -import org.springframework.validation.annotation.Validated; - -import java.util.*; - -import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.*; -import cn.iocoder.yudao.module.mp.dal.dataobject.menu.WxMenuDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import cn.iocoder.yudao.module.mp.convert.menu.WxMenuConvert; -import cn.iocoder.yudao.module.mp.dal.mysql.menu.WxMenuMapper; - -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; - -/** - * 微信菜单 Service 实现类 - * - * @author 芋道源码 - */ -@Service -@Validated -public class WxMenuServiceImpl implements WxMenuService { - - @Resource - private WxMenuMapper wxMenuMapper; - - @Override - public Integer createWxMenu(WxMenuCreateReqVO createReqVO) { - // 插入 - WxMenuDO wxMenu = WxMenuConvert.INSTANCE.convert(createReqVO); - wxMenuMapper.insert(wxMenu); - // 返回 - return wxMenu.getId(); - } - - @Override - public void updateWxMenu(WxMenuUpdateReqVO updateReqVO) { - // 校验存在 - this.validateWxMenuExists(updateReqVO.getId()); - // 更新 - WxMenuDO updateObj = WxMenuConvert.INSTANCE.convert(updateReqVO); - wxMenuMapper.updateById(updateObj); - } - - @Override - public void deleteWxMenu(Integer id) { - // 校验存在 - this.validateWxMenuExists(id); - // 删除 - wxMenuMapper.deleteById(id); - } - - private void validateWxMenuExists(Integer id) { - if (wxMenuMapper.selectById(id) == null) { - throw exception(COMMON_NOT_EXISTS); - } - } - - @Override - public WxMenuDO getWxMenu(Integer id) { - return wxMenuMapper.selectById(id); - } - - @Override - public List getWxMenuList(Collection ids) { - return wxMenuMapper.selectBatchIds(ids); - } - - @Override - public PageResult getWxMenuPage(WxMenuPageReqVO pageReqVO) { - return wxMenuMapper.selectPage(pageReqVO); - } - - @Override - public List getWxMenuList(WxMenuExportReqVO exportReqVO) { - return wxMenuMapper.selectList(exportReqVO); - } - -}