RocketmqApi.java 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package com.fjhx.rocketmq.feign;
  2. import com.fjhx.myapp.application.feign.IRocketmqApi;
  3. import com.fjhx.rocketmq.service.RocketMqService;
  4. import org.springblade.core.tenant.annotation.NonDS;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.RequestParam;
  8. import org.springframework.web.bind.annotation.RestController;
  9. import java.util.List;
  10. /**
  11. * 节日、生日模板 feign api
  12. */
  13. @NonDS
  14. @RestController
  15. public class RocketmqApi implements IRocketmqApi {
  16. @Autowired
  17. private RocketMqService rocketMqService;
  18. /**
  19. * 发送消息
  20. * @param topic
  21. * @param tag
  22. * @param key
  23. * @param busiId
  24. * @param userIds
  25. * @param content
  26. * @param msgType
  27. */
  28. @PostMapping(sendMessage)
  29. @Override
  30. public void sendMessage(@RequestParam("topic") String topic,
  31. @RequestParam("tag") String tag,
  32. @RequestParam("key") String key,
  33. @RequestParam("busiId") String busiId,
  34. @RequestParam("userIds") List<String> userIds,
  35. @RequestParam("content") String content,
  36. @RequestParam("msgType") Integer msgType) {
  37. rocketMqService.send(topic,tag,key,busiId,userIds,content,msgType);
  38. }
  39. }