蛋蛋星球 后台端
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.7 KiB

4 days 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.GroupListReq true "相关参数"
  16. // @Success 200 {object} md.GroupListResp ""
  17. // @Failure 400 {object} md.Response "具体错误"
  18. // @Router /api/im/batchSendGroupMessage [POST]
  19. func BatchSendGroupMessage(c *gin.Context) {
  20. var req *md.GroupListReq
  21. if err1 := c.ShouldBindJSON(&req); err1 != nil {
  22. e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
  23. return
  24. }
  25. err, resp := svc.GroupList(*req)
  26. if err != nil {
  27. e.OutErr(c, e.ERR, err.Error())
  28. return
  29. }
  30. e.OutSuc(c, resp, 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.GroupListReq true "相关参数"
  40. // @Success 200 {object} md.GroupListResp ""
  41. // @Failure 400 {object} md.Response "具体错误"
  42. // @Router /api/im/batchSendUserMessage [POST]
  43. func BatchSendUserMessage(c *gin.Context) {
  44. var req *md.GroupListReq
  45. if err1 := c.ShouldBindJSON(&req); err1 != nil {
  46. e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
  47. return
  48. }
  49. err, resp := svc.GroupList(*req)
  50. if err != nil {
  51. e.OutErr(c, e.ERR, err.Error())
  52. return
  53. }
  54. e.OutSuc(c, resp, nil)
  55. }