|
@@ -6,10 +6,9 @@ import com.dragon.tj.portal.auth.model.LoginUser;
|
|
|
import com.dragon.tj.portal.auth.util.SecurityUtils;
|
|
|
import com.dragon.tj.portal.common.base.R;
|
|
|
import com.dragon.tj.portal.common.dto.message.MessageInfoReq;
|
|
|
-import com.dragon.tj.portal.common.dto.message.MessageInfoSend;
|
|
|
-import com.dragon.tj.portal.component.message.KafkaInitialConfiguration;
|
|
|
import com.dragon.tj.portal.component.message.MessageProducer;
|
|
|
import com.dragon.tj.portal.service.MessageInfoService;
|
|
|
+import com.dragon.tj.portal.service.NoticeInfoService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -34,6 +33,9 @@ public class MessageCenterController {
|
|
|
@Autowired
|
|
|
private MessageInfoService messageInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private NoticeInfoService noticeInfoService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private MessageProducer producer;
|
|
|
|
|
@@ -45,7 +47,7 @@ public class MessageCenterController {
|
|
|
@PostMapping("/publish")
|
|
|
public R publish(@Validated @RequestBody MessageInfoReq messageInfoReq) {
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
- log.info("api/message/publish-req-is {}-{}",JSON.toJSONString(loginUser), JSON.toJSONString(messageInfoReq));
|
|
|
+ log.info("api/message/publish-req-is {}-{}", JSON.toJSONString(loginUser), JSON.toJSONString(messageInfoReq));
|
|
|
return messageInfoService.push(messageInfoReq, loginUser);
|
|
|
}
|
|
|
|
|
@@ -55,11 +57,13 @@ public class MessageCenterController {
|
|
|
* @Date Created in 2023/7/11 16:12
|
|
|
*/
|
|
|
@PostMapping("/send")
|
|
|
- public R publish(@Validated @RequestBody MessageInfoSend messageInfoSend) {
|
|
|
- producer.send(KafkaInitialConfiguration.sseTopic + "-a1", JSON.toJSONString(messageInfoSend));
|
|
|
- return R.ok();
|
|
|
+ public R send(@Validated @RequestBody MessageInfoReq messageInfoReq) {
|
|
|
+ log.info("api/message/publish-req-is {}", JSON.toJSONString(messageInfoReq));
|
|
|
+ return noticeInfoService.send(messageInfoReq);
|
|
|
}
|
|
|
|
|
|
+ //topic 颁发 appcode 及
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|