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