| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class PushServiceImpl implements IPushService { |
| | | private static final String PUSH_CLIENT_ID = "push:client:id:"; |
| | | private static final String UNI_CLOUD_PUSH_URL = "https://fc-mp-ad1ed7e3-700e-4fca-abae-0d097cc222b5.next.bspapp.com/push"; |
| | | private static final String UNI_CLOUD_PUSH_URL = "https://fc-mp-ff11cc4d-ca8e-4b47-a57f-e26804379530.next.bspapp.com/push"; |
| | | |
| | | private BladeRedis bladeRedis; |
| | | private IMessageClient messageClient; |
| | |
| | | RestTemplate template = new RestTemplate(); |
| | | Map<String, Object> params = new LinkedHashMap<>(); |
| | | //用户cId,可数组,可字符串 |
| | | params.put("push_clientid", pushVO.getCIds()); |
| | | params.put("pushClientid", pushVO.getCIds()); |
| | | //标题 |
| | | params.put("title", pushVO.getTitle()); |
| | | //内容 |
| | | params.put("content", pushVO.getContent()); |
| | | |
| | | params.put("requestId", UUID.randomUUID()); |
| | | // UniCloudReturnRes uniCloudReturnRes = template.getForObject(UNI_CLOUD_PUSH_URL,UniCloudReturnRes.class,params); |
| | | UniCloudReturnRes uniCloudReturnRes = template.postForObject(UNI_CLOUD_PUSH_URL, params, UniCloudReturnRes.class); |
| | | return uniCloudReturnRes.getErrCode().equals("0") ? true : false; |