first commit
This commit is contained in:
45
gateway/api/v1/internal/handler/group/update_group_name.go
Normal file
45
gateway/api/v1/internal/handler/group/update_group_name.go
Normal 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"
|
||||
)
|
||||
|
||||
// UpdateGroupNameHandler
|
||||
// @Summary 更新群名称
|
||||
// @Author chy@33.cn
|
||||
// @Tags group 群信息
|
||||
// @Param FZM-SIGNATURE header string true "MOCK"
|
||||
// @Param data body types.UpdateGroupNameReq false "body"
|
||||
// @Success 200 {object} types.GeneralResp{data=types.UpdateGroupNameResp}
|
||||
// @Router /group/app/name [post]
|
||||
func UpdateGroupNameHandler(ctx *svc.ServiceContext) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
req := &types.UpdateGroupNameReq{}
|
||||
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 = convert.ToInt64(req.IdStr)
|
||||
}
|
||||
|
||||
l := logic.NewGroupLogic(c, ctx)
|
||||
res, err := l.UpdateGroupName(req)
|
||||
|
||||
c.Set(api.ReqResult, res)
|
||||
c.Set(api.ReqError, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user