package com.boman.wechat.controller; import com.boman.domain.dto.AjaxResult; import com.boman.domain.dto.WxMsgDto; import com.boman.domain.form.LoginBody; import com.boman.wechat.service.WechatService; import com.boman.wechat.service.WxPushService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Map; /** * 微信登录验证 * * @author zhong.h */ @RequestMapping("/wechat/p/c") @RestController public class WechatInfoController { @Autowired private WxPushService wxPushService; @Autowired private WechatService wechatService; @ApiOperation(value = "小程序相关信息获取") @RequestMapping(value = "/wechatInfo", method = RequestMethod.POST) public AjaxResult getWechatInfo(@RequestBody LoginBody loginBody) { return wechatService.getWechatInfo(loginBody); } @ApiOperation(value = "小程序模板id获取") @GetMapping("/tmpIds") public AjaxResult getTmpIds() { return wechatService.getTmpIds(); } /** * 发送消息 * * @param dto * @return */ @PostMapping("/pushMsg") public Map pushMsg(@RequestBody WxMsgDto dto) { return wxPushService.pushToUser(dto); } }