xuekang
2024-05-11 bac0878349a1db23e7b420ea164e22fb9db73a99
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.nuvole.util;
 
import cn.hutool.http.HttpUtil;
import com.nuvole.constants.ServiceConstants;
import lombok.extern.slf4j.Slf4j;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
/**
 * @Description:
 * @Company: TOO (ps:公司名称)
 * @author: 唐
 * @date: 2020/5/16 下午8:47
 * @version: V1.0.0
 */
@Slf4j
public class GeTuiPushCall {
 
    /**
     * 单推(单个clientId/别名)
     *
     * @param title   标题
     * @param content 内容
     * @param type    类型【1.设备id(clientId) 2.别名】
     * @param val     类型值(clientId/别名)
     * @Author: lc
     * @Date: 2020/4/26 13:31
     */
    public static String pushMessageToSingle(String title, String content, int type, String val) {
        String url = ServiceConstants.SERVICE_GE_TUI_URL;
        Map<String, Object> map = new HashMap<>();
        map.put("title", title);
        map.put("content", content);
        map.put("type", type);
        map.put("val", val);
        return HttpUtil.post(url, map);
    }
 
 
    /**
     * 推送一个列表
     *
     * @param title   标题
     * @param content 内容
     * @parma type    类型【1.设备id(clientId) 2.别名】
     * @parma jsonArray    类型值(clientId/别名)
     * @Author: lc
     * @Date: 2020/4/26 13:37
     */
    public static String pushMessageToList(String title, String content, int type, List<String> list) {
        String url = ServiceConstants.SERVICE_GE_TUI_LIST_URL;
        Map<String, Object> map = new HashMap<>();
        map.put("title", title);
        map.put("content", content);
        map.put("type", type);
        map.put("list", list);
        return HttpUtil.post(url, map);
    }
 
}