package group import ( "github.com/gin-gonic/gin" logic "gitlab.33.cn/chat/dtalk/gateway/api/v1/internal/logic/group" "gitlab.33.cn/chat/dtalk/gateway/api/v1/internal/svc" "gitlab.33.cn/chat/dtalk/gateway/api/v1/internal/types" "gitlab.33.cn/chat/dtalk/pkg/api" xerror "gitlab.33.cn/chat/dtalk/pkg/error" "gitlab.33.cn/utils/go-kit/convert" ) // GroupRemoveHandler // @Summary 踢人 // @Author chy@33.cn // @Tags group 群动作 // @Param FZM-SIGNATURE header string true "MOCK" // @Param data body types.GroupRemoveReq false "body" // @Success 200 {object} types.GeneralResp{data=types.GroupRemoveResp} // @Router /group/app/group-remove [post] func GroupRemoveHandler(ctx *svc.ServiceContext) gin.HandlerFunc { return func(c *gin.Context) { req := &types.GroupRemoveReq{} err := c.ShouldBind(req) if err != nil { c.Set(api.ReqError, xerror.NewError(xerror.ParamsError)) return } if req.Id == 0 && req.IdStr == "" { c.Set(api.ReqError, xerror.NewError(xerror.ParamsError)) return } if req.IdStr != "" { req.Id = convert.ToInt64(req.IdStr) } l := logic.NewGroupLogic(c, ctx) res, err := l.GroupRemove(req) c.Set(api.ReqResult, res) c.Set(api.ReqError, err) } }