| | |
| | | import org.json.simple.parser.ParseException;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.xiaomi.xmpush.server.Constants;
|
| | | import com.xiaomi.xmpush.server.Message;
|
| | | import com.xiaomi.xmpush.server.Message.Builder;
|
| | | import com.xiaomi.xmpush.server.Result;
|
| | | import com.xiaomi.xmpush.server.Sender;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.entity.xinge.MessageInfo;
|
| | | import com.yeshi.fanli.entity.xinge.PushRecord;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.log.PushLogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.PropertiesUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | private static XiaoMiPushUtil xiaoMiPushUtil;
|
| | |
|
| | | @Autowired
|
| | | private SystemService systemService;
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @PostConstruct
|
| | | public void init() {
|
| | | xiaoMiPushUtil = this;
|
| | | xiaoMiPushUtil.systemService = this.systemService;
|
| | | xiaoMiPushUtil.businessSystemService = this.businessSystemService;
|
| | | }
|
| | |
|
| | | // AppKey
|
| | |
| | | * @return
|
| | | */
|
| | | public static String allPushAndroidForXM(MessageInfo info, Map<String, Object> map) {
|
| | | if (Constant.IS_TEST)
|
| | | return null;
|
| | |
|
| | | String name = info.getPackageName();
|
| | | if (!Constant.systemCommonConfig.getAndroidPackageName().equalsIgnoreCase(name)
|
| | | && !Constant.systemCommonConfig.getIosBundleId().equalsIgnoreCase(name)) {
|
| | |
| | | JSONObject jsonObject = new JSONObject();
|
| | | jsonObject.put("type", "cash");
|
| | | XiaoMiPushUtil.singlePushAndroidForXM(info, JsonUtil.parseData(jsonObject), system);
|
| | | }
|
| | |
|
| | | public static int allFanLiQuanDevice(MessageInfo info, JSONObject json, PushRecord pushRecord) {
|
| | | System b_android = xiaoMiPushUtil.systemService.getSystem("ANDROID",
|
| | | Constant.systemCommonConfig.getAndroidPackageName());
|
| | | return pushApp(info, json, pushRecord, b_android);
|
| | | }
|
| | |
|
| | | /**
|