guoshilong
2023-07-18 288ded5874ea9327d0b8fdfd6a7960425600727f
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
32
33
34
35
36
37
38
39
40
41
42
package cn.gistack.alerts.push.utils;
 
import cn.gistack.alerts.push.vo.PushVO;
import org.springframework.web.client.RestTemplate;
 
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
 
public class PushUtil {
 
    private String UNI_CLOUD_PUSH_URL = "https://fc-mp-ad1ed7e3-700e-4fca-abae-0d097cc222b5.next.bspapp.com/push";
 
//    public static void main(String[] args) throws IOException {
//
//
//    }
 
    /**
     * 消息推送
     * @param pushVO
     */
    public void pushMessage(PushVO pushVO){
        RestTemplate template = new RestTemplate();
        Map<String, Object> params = new LinkedHashMap<>();
 
        params.put("push_clientid",pushVO.getCIds());
        params.put("title",pushVO.getTitle());
        params.put("content",pushVO.getContent());
 
        String result = template.postForObject(UNI_CLOUD_PUSH_URL, params, String.class);
    }
 
    /**
     * 根据电话获取cIds
     * @param phoneIds
     */
    public void getCIdsByPhone(List<String> phoneIds){
 
    }
}