wlzboy
8 天以前 09faa36132c8cbada5327649875534ef01c1a3b1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.ruoyi.web.controller.sms;
 
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.system.service.IWechatTaskNotifyService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
@Anonymous
@RestController
@RequestMapping("/system/notify")
public class NotifyController {
 
    @Autowired
    private IWechatTaskNotifyService wechatTaskNotifyService;
    @Anonymous
    @PostMapping("/sendWeiXin")
    public String notify(@RequestBody @Validated SendTaskReq req) {
        List<Long> userIds = new java.util.ArrayList<>();
        userIds.add(req.getUserId());
        Integer result=wechatTaskNotifyService.sendTaskNotifyMessage(req.getTaskId(), userIds,null);
        System.out.println(result);
        return "success";
    }
}