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,52 @@
package http
import (
"github.com/gin-gonic/gin"
"gitlab.33.cn/chat/dtalk/pkg/api"
xerror "gitlab.33.cn/chat/dtalk/pkg/error"
"gitlab.33.cn/chat/dtalk/pkg/util"
"gitlab.33.cn/chat/dtalk/service/call/model"
)
// replyBusy
// @Summary 返回忙碌
// @Author chy@33.cn
// @Tags call
// @Param FZM-SIGNATURE header string true "MOCK"
// @Param data body model.ReplyBusyRequest false "body"
// @Success 200 {object} model.GeneralResponse{data=model.ReplyBusyResponse}
// @Router /app/reply-busy [post]
func replyBusy(c *gin.Context) {
userId, ok := c.Get(api.Address)
if !ok {
c.Set(api.ReqError, xerror.NewError(xerror.SignatureInvalid))
return
}
req := &model.ReplyBusyRequest{}
err := c.ShouldBind(req)
if err != nil {
c.Set(api.ReqError, xerror.NewError(xerror.ParamsError).SetExtMessage(err.Error()))
return
}
if req.TraceId == 0 && req.TraceIdStr == "" {
c.Set(api.ReqError, xerror.NewError(xerror.ParamsError))
return
}
if req.TraceIdStr != "" {
traceId, err := util.ToInt64E(req.TraceIdStr)
if err != nil {
c.Set(api.ReqError, xerror.NewError(xerror.ParamsError).SetExtMessage(err.Error()))
return
}
req.TraceId = traceId
}
req.PersonId = userId.(string)
res, err := svc.ReplyBusy(req)
c.Set(api.ReqResult, res)
c.Set(api.ReqError, err)
}