dcs 4 ماه پیش
والد
کامیت
cdc7b028e5

+ 5 - 4
virgo.api/src/main/java/com/bosshand/virgo/api/service/ManagerClient.java

@@ -1,14 +1,15 @@
 package com.bosshand.virgo.api.service;
-import com.bosshand.virgo.core.response.Response;
+
+import com.alibaba.fastjson.JSONArray;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
 @FeignClient("virgo-manager")
 public interface ManagerClient {
 
-    @RequestMapping(value = "/message/reminder/{data}", method = RequestMethod.GET)
-    public Response pushReminderMessage(@PathVariable String data);
+    @RequestMapping(value = "/message/reminder", method = RequestMethod.POST)
+    public void pushReminderMessage(@RequestBody JSONArray data);
 
 }

+ 1 - 1
virgo.api/src/main/java/com/bosshand/virgo/api/service/ReminderService.java

@@ -94,7 +94,7 @@ public class ReminderService {
             js.put("isCC", false);
             ja.add(js);
         }
-        managerClient.pushReminderMessage(ja.toString());
+        managerClient.pushReminderMessage(ja);
     }
 
     public int updateState(long id) {

+ 3 - 3
virgo.manager/src/main/java/com/bosshand/virgo/controller/MessageController.java

@@ -1,5 +1,6 @@
 package com.bosshand.virgo.controller;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.bosshand.virgo.core.response.Response;
 import com.bosshand.virgo.message.model.NotificationMessage;
@@ -63,10 +64,9 @@ public class MessageController {
     }
 
     @ApiOperation(value = "提醒消息发送", notes = "提醒消息发送")
-    @RequestMapping(value = "/reminder/{data}", method = RequestMethod.GET)
-    public Response pushReminderMessage(@PathVariable String data) {
+    @RequestMapping(value = "/reminder", method = RequestMethod.POST)
+    public void pushReminderMessage(@RequestBody JSONArray data) {
         messageService.pushReminderMessage(data);
-        return Response.ok();
     }
 
     @ApiOperation(value = "修改", notes = "修改")

+ 3 - 4
virgo.manager/src/main/java/com/bosshand/virgo/message/service/MessageService.java

@@ -169,10 +169,9 @@ public class MessageService {
 		}
 	}
 
-	public void pushReminderMessage(String data) {
-		JSONArray jsonArray = JSONArray.parseArray(data);
-		for (int i = 0; i < jsonArray.size(); i++) {
-			NotificationMessage message = JSONObject.parseObject(jsonArray.getJSONObject(i).toJSONString(), NotificationMessage.class);
+	public void pushReminderMessage(JSONArray data) {
+		for (int i = 0; i < data.size(); i++) {
+			NotificationMessage message = JSONObject.parseObject(data.getJSONObject(i).toJSONString(), NotificationMessage.class);
 			notificationMessageDao.insert(message);
 		}
 	}