|
@@ -10,6 +10,8 @@ import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
|
|
|
+import com.fs.config.im.IMSystemConfig;
|
|
|
|
|
+import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.gtPush.domain.PushReqBean;
|
|
import com.fs.gtPush.domain.PushReqBean;
|
|
|
import com.fs.gtPush.domain.PushResult;
|
|
import com.fs.gtPush.domain.PushResult;
|
|
|
import com.fs.gtPush.domain.UniPushLog;
|
|
import com.fs.gtPush.domain.UniPushLog;
|
|
@@ -17,6 +19,7 @@ import com.fs.gtPush.service.UniPushLogService;
|
|
|
import com.fs.gtPush.service.uniPush2Service;
|
|
import com.fs.gtPush.service.uniPush2Service;
|
|
|
import com.fs.im.config.IMConfig;
|
|
import com.fs.im.config.IMConfig;
|
|
|
import com.fs.im.service.OpenIMService;
|
|
import com.fs.im.service.OpenIMService;
|
|
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import com.fs.gtPush.utils.PushUtils;
|
|
import com.fs.gtPush.utils.PushUtils;
|
|
@@ -47,6 +50,9 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IMConfig imConfig;
|
|
private IMConfig imConfig;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysConfigService configService;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public PushResult pushMessage(PushReqBean push) {
|
|
public PushResult pushMessage(PushReqBean push) {
|
|
|
String result = HttpUtil.post(imConfig.getPushUrl(), JSON.toJSONString(push));
|
|
String result = HttpUtil.post(imConfig.getPushUrl(), JSON.toJSONString(push));
|
|
@@ -177,9 +183,13 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
Map<String, Object> options = new HashMap<>();
|
|
Map<String, Object> options = new HashMap<>();
|
|
|
Map<String, Object> android = new HashMap<>();
|
|
Map<String, Object> android = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String json = configService.selectConfigByKey("im.config");
|
|
|
|
|
+ IMSystemConfig config = JSONUtil.toBean(json, IMSystemConfig.class);
|
|
|
// 小米
|
|
// 小米
|
|
|
Map<String, Object> xm = new HashMap<>();
|
|
Map<String, Object> xm = new HashMap<>();
|
|
|
- xm.put("/extra.channel_id", "133892");
|
|
|
|
|
|
|
+ xm.put("/extra.channel_id", config.getXm_channel_id());
|
|
|
|
|
+
|
|
|
xm.put("/extra.notify_foreground", true);
|
|
xm.put("/extra.notify_foreground", true);
|
|
|
android.put("XM", xm);
|
|
android.put("XM", xm);
|
|
|
|
|
|
|
@@ -203,7 +213,7 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
hw.put("/message/android/category", "WORK");
|
|
hw.put("/message/android/category", "WORK");
|
|
|
hw.put("/message/android/notification/importance", "HIGH");
|
|
hw.put("/message/android/notification/importance", "HIGH");
|
|
|
hw.put("/message/android/notification/visibility", "PUBLIC");
|
|
hw.put("/message/android/notification/visibility", "PUBLIC");
|
|
|
- hw.put("/message/android/notification/channel_id", "133892");
|
|
|
|
|
|
|
+ hw.put("/message/android/notification/channel_id", config.getHw_channel_id());
|
|
|
android.put("HW", hw);
|
|
android.put("HW", hw);
|
|
|
|
|
|
|
|
// 鸿蒙
|
|
// 鸿蒙
|
|
@@ -338,9 +348,12 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
// options.android
|
|
// options.android
|
|
|
Map<String, Object> android = new HashMap<>();
|
|
Map<String, Object> android = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
+ String json = configService.selectConfigByKey("im.config");
|
|
|
|
|
+ IMSystemConfig config = JSONUtil.toBean(json, IMSystemConfig.class);
|
|
|
|
|
+
|
|
|
// 小米
|
|
// 小米
|
|
|
Map<String, Object> xm = new HashMap<>();
|
|
Map<String, Object> xm = new HashMap<>();
|
|
|
- xm.put("/extra.channel_id", "133892");
|
|
|
|
|
|
|
+ xm.put("/extra.channel_id", config.getXm_channel_id());
|
|
|
android.put("XM", xm);
|
|
android.put("XM", xm);
|
|
|
|
|
|
|
|
// OPPO
|
|
// OPPO
|