package com.yeejoin.equipmanage.remote;

import com.yeejoin.equipmanage.common.entity.publics.CommonResponse;
import com.yeejoin.equipmanage.common.utils.XJConstant;
import com.yeejoin.equipmanage.common.vo.PushMsgParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/***
 * 
 * 极光推送消息接口
 * 
 * **/
@Service
public class AppMessagePushService {

	@Autowired
	private PushFeign PushFeign;

	public static String buildJpushUserKey(String userId) {
		return XJConstant.JPUSH_USER_KEY + "_" + userId;
	}

	public void sendMessage(List<PushMsgParam> responses) {
		PushFeign.sendMessage(responses);

	}

	

	public boolean pushNoticeManyMethod(PushMsgParam response) {
		CommonResponse commonResponse = PushFeign.pushNoticeMany(response);
		if (commonResponse.getResult().equals("SUCCESS")) {
			return true;
		} else {
			return false;
		}
	}

	public void sendMessage(PushMsgParam response) {
		CommonResponse commonResponse = PushFeign.sendMessageone(response);

	}

	public void pushNoticeMany(PushMsgParam response) {
		CommonResponse commonResponse = PushFeign.pushNoticeMany(response);
	}
}
