|
|
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
import com.alibaba.fastjson.parser.Feature;
|
|
|
import com.uas.account.support.Page;
|
|
|
+import com.uas.platform.b2b.core.util.ContextUtils;
|
|
|
import com.uas.platform.b2b.support.HttpUtils;
|
|
|
+import com.uas.platform.b2b.support.MessageConf;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.b2b.temporary.model.MessageModel;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
@@ -20,7 +22,9 @@ import java.util.HashMap;
|
|
|
*/
|
|
|
public class MessageUtils {
|
|
|
|
|
|
- private static final String MESSAGE_PUBLIC_SERVICE_DEV_URL = "";
|
|
|
+
|
|
|
+ //TODO 其他也修改为从properties取
|
|
|
+ private static final String MESSAGE_PUBLIC_SERVICE_URL = ContextUtils.getBean(MessageConf.class).getMessagePublicServiceDevUrl();
|
|
|
|
|
|
/**
|
|
|
* 获取公共消息的方法
|
|
|
@@ -38,7 +42,7 @@ public class MessageUtils {
|
|
|
params.put("consumerApp", "B2B");
|
|
|
params.put("page", page);
|
|
|
params.put("size", size);
|
|
|
- HttpUtils.Response res = HttpUtils.get(MESSAGE_PUBLIC_SERVICE_DEV_URL + "/message", params);
|
|
|
+ HttpUtils.Response res = HttpUtils.get(MESSAGE_PUBLIC_SERVICE_URL + "/message", params);
|
|
|
if (HttpStatus.OK.value() == res.getStatusCode()) {
|
|
|
if (null != res.getResponseText()) {
|
|
|
return (Page) JSONObject.parseObject(res.getResponseText(), new TypeReference<Page<MessageModel>>() {
|
|
|
@@ -63,7 +67,7 @@ public class MessageUtils {
|
|
|
HashMap<String, String> params = new HashMap<>();
|
|
|
params.put("messageId", String.valueOf(id));
|
|
|
params.put("consumerApp", "B2B");
|
|
|
- HttpUtils.Response res = HttpUtils.post(MESSAGE_PUBLIC_SERVICE_DEV_URL + "/message/read", params);
|
|
|
+ HttpUtils.Response res = HttpUtils.post(MESSAGE_PUBLIC_SERVICE_URL + "/message/read", params);
|
|
|
if (HttpStatus.OK.value() == res.getStatusCode()) {
|
|
|
map.put("success", "成功设为已读");
|
|
|
return map;
|