SysUser sysUser = sysUserService.getUserByUsername(assignee);
assignList.add(sysUser.getName());
- //TODO 公众号消息推送
}
//更新process流程信息
process.setDescription("等待" + StringUtils.join(assignList.toArray(), ",") + "审批");
diff --git a/service-oa/src/main/java/com/atguigu/wechat/config/WeChatMpConfig.java b/service-oa/src/main/java/com/atguigu/wechat/config/WeChatMpConfig.java
new file mode 100644
index 0000000..c3ea3f9
--- /dev/null
+++ b/service-oa/src/main/java/com/atguigu/wechat/config/WeChatMpConfig.java
@@ -0,0 +1,35 @@
+package com.atguigu.wechat.config;
+
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
+import me.chanjar.weixin.mp.config.WxMpConfigStorage;
+import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author YoVinchen
+ * @date 2023/6/25 下午 7:24
+ */
+@Component
+public class WeChatMpConfig {
+
+ @Autowired
+ private WechatAccountConfig wechatAccountConfig;
+
+ @Bean
+ public WxMpService wxMpService() {
+ WxMpService wxMpService = new WxMpServiceImpl();
+ wxMpService.setWxMpConfigStorage(wxMpConfigStorage());
+ return wxMpService;
+ }
+
+ @Bean
+ public WxMpConfigStorage wxMpConfigStorage() {
+ WxMpDefaultConfigImpl wxMpConfigStorage = new WxMpDefaultConfigImpl();
+ wxMpConfigStorage.setAppId(wechatAccountConfig.getMpAppId());
+ wxMpConfigStorage.setSecret(wechatAccountConfig.getMpAppSecret());
+ return wxMpConfigStorage;
+ }
+}
diff --git a/service-oa/src/main/java/com/atguigu/wechat/config/WechatAccountConfig.java b/service-oa/src/main/java/com/atguigu/wechat/config/WechatAccountConfig.java
new file mode 100644
index 0000000..be7f60b
--- /dev/null
+++ b/service-oa/src/main/java/com/atguigu/wechat/config/WechatAccountConfig.java
@@ -0,0 +1,20 @@
+package com.atguigu.wechat.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author YoVinchen
+ * @date 2023/6/25 下午 7:22
+ */
+@Data
+@Component
+@ConfigurationProperties(prefix = "wechat")
+public class WechatAccountConfig {
+
+ private String mpAppId;
+
+ private String mpAppSecret;
+
+}
diff --git a/service-oa/src/main/java/com/atguigu/wechat/controller/MenuController.java b/service-oa/src/main/java/com/atguigu/wechat/controller/MenuController.java
index 2f2a8a5..7884fbc 100644
--- a/service-oa/src/main/java/com/atguigu/wechat/controller/MenuController.java
+++ b/service-oa/src/main/java/com/atguigu/wechat/controller/MenuController.java
@@ -1,9 +1,15 @@
package com.atguigu.wechat.controller;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.atguigu.common.result.Result;
+import com.atguigu.vo.wechat.MenuVo;
+import com.atguigu.wechat.service.MenuService;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
-import org.springframework.web.bind.annotation.RestController;
+import java.util.List;
/**
*
@@ -14,8 +20,32 @@ import org.springframework.web.bind.annotation.RestController;
* @since 2023-06-25
*/
@RestController
-@RequestMapping("/wechat/menu")
+@RequestMapping("/admin/wechat/menu")
+@Slf4j
+@CrossOrigin
public class MenuController {
+ @Autowired
+ private MenuService menuService;
+ @ApiOperation(value = "删除菜单")
+ @DeleteMapping("removeMenu")
+ public Result removeMenu() {
+ menuService.removeMenu();
+ return Result.ok();
+ }
+
+ @ApiOperation(value = "同步菜单")
+ @GetMapping("syncMenu")
+ public Result createMenu() {
+ menuService.syncMenu();
+ return Result.ok();
+ }
+
+ @ApiOperation(value = "获取全部菜单")
+ @GetMapping("findMenuInfo")
+ public Result findMenuInfo() {
+ List menuList = menuService.findMenuInfo();
+ return Result.ok(menuList);
+ }
}
diff --git a/service-oa/src/main/java/com/atguigu/wechat/service/MenuService.java b/service-oa/src/main/java/com/atguigu/wechat/service/MenuService.java
index 97acb78..ec6b144 100644
--- a/service-oa/src/main/java/com/atguigu/wechat/service/MenuService.java
+++ b/service-oa/src/main/java/com/atguigu/wechat/service/MenuService.java
@@ -1,8 +1,11 @@
package com.atguigu.wechat.service;
import com.atguigu.model.wechat.Menu;
+import com.atguigu.vo.wechat.MenuVo;
import com.baomidou.mybatisplus.extension.service.IService;
+import java.util.List;
+
/**
*
* 菜单 服务类
@@ -13,4 +16,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface MenuService extends IService