公众号
This commit is contained in:
parent
d506a9619a
commit
065c5c065c
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.mdd.admin.controller.channel.oa;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号默认回复
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/channel/oa/defaultReply")
|
||||||
|
public class OaDefaultReplyController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.mdd.admin.controller.channel.oa;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号关注回复
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/channel/oa/followReply")
|
||||||
|
public class OaFollowReplyController {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.mdd.admin.controller.channel.oa;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号关键词回复
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/channel/oa/keywordReply")
|
||||||
|
public class OaKeywordReplyController {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.mdd.admin.controller.channel.oa;
|
||||||
|
|
||||||
|
import com.mdd.admin.service.channel.IChannelOaMenuService;
|
||||||
|
import com.mdd.common.core.AjaxResult;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号菜单
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/channel/oa/menu")
|
||||||
|
public class OaMenuController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
IChannelOaMenuService iChannelOaMenuService;
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Object list() {
|
||||||
|
iChannelOaMenuService.list();
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
public Object add() {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/del")
|
||||||
|
public Object del() {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.mdd.admin.service.channel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号菜单服务接口类
|
||||||
|
*/
|
||||||
|
public interface IChannelOaMenuService {
|
||||||
|
|
||||||
|
Object list();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.mdd.admin.service.channel.impl;
|
||||||
|
|
||||||
|
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.mdd.admin.service.channel.IChannelOaMenuService;
|
||||||
|
import me.chanjar.weixin.common.bean.menu.WxMenu;
|
||||||
|
import me.chanjar.weixin.common.error.WxErrorException;
|
||||||
|
import me.chanjar.weixin.common.service.WxService;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpMenuService;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
|
import me.chanjar.weixin.mp.api.impl.WxMpMenuServiceImpl;
|
||||||
|
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
|
||||||
|
import me.chanjar.weixin.mp.bean.menu.WxMpGetSelfMenuInfoResult;
|
||||||
|
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
|
||||||
|
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ChannelOaMenuServiceImpl implements IChannelOaMenuService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object list() {
|
||||||
|
|
||||||
|
WxMpDefaultConfigImpl wxMpDefaultConfig = new WxMpDefaultConfigImpl();
|
||||||
|
wxMpDefaultConfig.setAppId("");
|
||||||
|
wxMpDefaultConfig.setSecret("");
|
||||||
|
wxMpDefaultConfig.setToken("");
|
||||||
|
wxMpDefaultConfig.setAesKey("");
|
||||||
|
|
||||||
|
WxMpService service = new WxMpServiceImpl();
|
||||||
|
service.setWxMpConfigStorage(wxMpDefaultConfig);
|
||||||
|
|
||||||
|
try {
|
||||||
|
WxMpMenuService wxMpMenuService = new WxMpMenuServiceImpl(service);
|
||||||
|
|
||||||
|
WxMpGetSelfMenuInfoResult result = wxMpMenuService.getSelfMenuInfo();
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (WxErrorException e) {
|
||||||
|
System.out.println("哈哈哈哈哈");
|
||||||
|
System.out.println(e.getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -163,6 +163,12 @@
|
||||||
<artifactId>weixin-java-miniapp</artifactId>
|
<artifactId>weixin-java-miniapp</artifactId>
|
||||||
<version>4.4.0</version>
|
<version>4.4.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 微信公众号 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-java-mp</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
Loading…
Reference in New Issue