|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package im
-
- import (
- "applet/app/e"
- md "applet/app/md/im"
- svc "applet/app/svc/im"
- "github.com/gin-gonic/gin"
- )
-
- // GroupList
- // @Summary Im-群组(列表)
- // @Tags 群组
- // @Description 群组(列表)
- // @Accept json
- // @Produce json
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @param req body md.GroupListReq true "相关参数"
- // @Success 200 {object} md.GroupListResp ""
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/im/groupList [POST]
- func GroupList(c *gin.Context) {
- var req *md.GroupListReq
- if err1 := c.ShouldBindJSON(&req); err1 != nil {
- e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
- return
- }
- err, resp := svc.GroupList(*req)
- if err != nil {
- e.OutErr(c, e.ERR, err.Error())
- return
- }
- e.OutSuc(c, resp, nil)
- }
-
- // GroupUserList
- // @Summary Im-群组用户(列表)
- // @Tags 群组用户
- // @Description 群组用户(列表)
- // @Accept json
- // @Produce json
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @param req body md.GroupListReq true "相关参数"
- // @Success 200 {object} md.GroupListResp ""
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/im/groupList [POST]
- func GroupUserList(c *gin.Context) {
- var req *md.GroupUserListReq
- if err1 := c.ShouldBindJSON(&req); err1 != nil {
- e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
- return
- }
- err, resp := svc.GroupUserList(*req)
- if err != nil {
- e.OutErr(c, e.ERR, err.Error())
- return
- }
- e.OutSuc(c, resp, nil)
- }
|