-
Notifications
You must be signed in to change notification settings - Fork 3
/
get_pub_group_info.go
45 lines (39 loc) · 1.25 KB
/
get_pub_group_info.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package group
import (
"github.com/gin-gonic/gin"
logic "github.com/txchat/dtalk/gateway/api/v1/internal/logic/group"
"github.com/txchat/dtalk/gateway/api/v1/internal/svc"
"github.com/txchat/dtalk/gateway/api/v1/internal/types"
"github.com/txchat/dtalk/pkg/api"
xerror "github.com/txchat/dtalk/pkg/error"
"github.com/txchat/dtalk/pkg/util"
)
// GetGroupPubInfoHandler
// @Summary 查询群公开信息
// @Author chy@33.cn
// @Tags group 群信息
// @Param FZM-SIGNATURE header string true "MOCK"
// @Param data body types.GetGroupPubInfoReq false "body"
// @Success 200 {object} types.GeneralResp{data=types.GetGroupPubInfoResp}
// @Router /group/app/group-pub-info [post]
func GetGroupPubInfoHandler(ctx *svc.ServiceContext) gin.HandlerFunc {
return func(c *gin.Context) {
req := &types.GetGroupPubInfoReq{}
err := c.ShouldBind(req)
if err != nil {
c.Set(api.ReqError, xerror.NewError(xerror.ParamsError).SetExtMessage(err.Error()))
return
}
if req.Id == 0 && req.IdStr == "" {
c.Set(api.ReqError, xerror.NewError(xerror.ParamsError))
return
}
if req.IdStr != "" {
req.Id = util.ToInt64(req.IdStr)
}
l := logic.NewGroupLogic(c, ctx)
res, err := l.GetPubGroupInfo(req)
c.Set(api.ReqResult, res)
c.Set(api.ReqError, err)
}
}