first commit

This commit is contained in:
2022-03-17 15:59:24 +08:00
commit 2b0debb847
592 changed files with 73946 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
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"
)
// GroupDisbandHandler
// @Summary 解散群
// @Author chy@33.cn
// @Tags group 群动作
// @Param FZM-SIGNATURE header string true "MOCK"
// @Param data body types.GroupDisbandReq false "body"
// @Success 200 {object} types.GeneralResp{data=types.GroupDisbandResp}
// @Router /group/app/group-disband [post]
func GroupDisbandHandler(ctx *svc.ServiceContext) gin.HandlerFunc {
return func(c *gin.Context) {
req := &types.GroupDisbandReq{}
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.GroupDisband(req)
c.Set(api.ReqResult, res)
c.Set(api.ReqError, err)
}
}