蛋蛋星球 后台端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hdl_send_message.go 1.8 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package im
  2. import (
  3. "applet/app/e"
  4. md "applet/app/md/im"
  5. svc "applet/app/svc/im"
  6. "github.com/gin-gonic/gin"
  7. )
  8. // BatchSendGroupMessage
  9. // @Summary Im-群发发送群组消息
  10. // @Tags 群发发送群组消息
  11. // @Description 群发发送群组消息
  12. // @Accept json
  13. // @Produce json
  14. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  15. // @param req body md.BatchSendGroupMessageReq true "相关参数"
  16. // @Success 200 {string} "success"
  17. // @Failure 400 {object} md.Response "具体错误"
  18. // @Router /api/im/batchSendGroupMessage [POST]
  19. func BatchSendGroupMessage(c *gin.Context) {
  20. var req *md.BatchSendGroupMessageReq
  21. if err1 := c.ShouldBindJSON(&req); err1 != nil {
  22. e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
  23. return
  24. }
  25. err := svc.BatchSendGroupMessage(req)
  26. if err != nil {
  27. e.OutErr(c, e.ERR, err.Error())
  28. return
  29. }
  30. e.OutSuc(c, "success", nil)
  31. }
  32. // BatchSendUserMessage
  33. // @Summary Im-群发发送用户消息
  34. // @Tags 群发发送用户消息
  35. // @Description 群发发送用户消息
  36. // @Accept json
  37. // @Produce json
  38. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  39. // @param req body md.BatchSendUserMessageReq true "相关参数"
  40. // @Success 200 {string} "success"
  41. // @Failure 400 {object} md.Response "具体错误"
  42. // @Router /api/im/batchSendUserMessage [POST]
  43. func BatchSendUserMessage(c *gin.Context) {
  44. var req *md.BatchSendUserMessageReq
  45. if err1 := c.ShouldBindJSON(&req); err1 != nil {
  46. e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
  47. return
  48. }
  49. err := svc.BatchSendUserMessage(req)
  50. if err != nil {
  51. e.OutErr(c, e.ERR, err.Error())
  52. return
  53. }
  54. e.OutSuc(c, "success", nil)
  55. }