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

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. // GroupList
  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/groupList [POST]
  19. func GroupList(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. // GroupUserList
  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/groupList [POST]
  43. func GroupUserList(c *gin.Context) {
  44. var req *md.GroupUserListReq
  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.GroupUserList(*req)
  50. if err != nil {
  51. e.OutErr(c, e.ERR, err.Error())
  52. return
  53. }
  54. e.OutSuc(c, resp, nil)
  55. }