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);
|
}
|
|
}
|