lau572
1 month ago
1 changed files with 48 additions and 0 deletions
@ -0,0 +1,48 @@ |
|||||
|
package com.zc.business.controller; |
||||
|
|
||||
|
import com.ruoyi.common.core.domain.AjaxResult; |
||||
|
import com.zc.business.domain.DcBoardPublish; |
||||
|
import com.zc.business.service.IDcBoardService; |
||||
|
import com.zc.business.utils.QYWXUtil; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Description 企业微信推送Controller |
||||
|
* |
||||
|
* @author liuwenge |
||||
|
* @date 2024/10/21 11:38 |
||||
|
*/ |
||||
|
@Api(tags = "企业微信推送") |
||||
|
@RestController |
||||
|
@RequestMapping("/business/weChat") |
||||
|
public class DcWeChatController { |
||||
|
|
||||
|
@Autowired |
||||
|
private QYWXUtil qywxUtil; |
||||
|
|
||||
|
|
||||
|
@ApiOperation("发送消息") |
||||
|
@PostMapping("/qywxSendMessage") |
||||
|
public AjaxResult qywxSendMessage(@RequestBody Map<String,String> params){ |
||||
|
|
||||
|
List<String> userIdList = Arrays.asList(params.get("userId").split(",")); |
||||
|
String content = params.get("content"); |
||||
|
return AjaxResult.success(qywxUtil.sendMessageByWxUserId(userIdList,content)); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("根据手机号获取userId") |
||||
|
@PostMapping("/getQywxUserId") |
||||
|
public AjaxResult getQywxUserId(@RequestBody Map<String,String> params){ |
||||
|
String mobile = params.get("mobile"); |
||||
|
return AjaxResult.success(qywxUtil.getUserIdByMobile(mobile)); |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue