33 lines
745 B
Go
33 lines
745 B
Go
// Code generated by hertz generator.
|
|
|
|
package audioAndVideoCalls
|
|
|
|
import (
|
|
"audioAndVideoCalls/biz/dal/redis"
|
|
"context"
|
|
|
|
audioAndVideoCalls "audioAndVideoCalls/biz/model/audioAndVideoCalls"
|
|
"github.com/cloudwego/hertz/pkg/app"
|
|
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
|
)
|
|
|
|
// VideoCall .
|
|
// @router /v1/video_call/ [POST]
|
|
func VideoCall(ctx context.Context, c *app.RequestContext) {
|
|
var err error
|
|
var req audioAndVideoCalls.VideoCallReq
|
|
err = c.BindAndValidate(&req)
|
|
if err != nil {
|
|
c.String(consts.StatusBadRequest, err.Error())
|
|
return
|
|
}
|
|
err = redis.VideoCall(req)
|
|
if err != nil {
|
|
c.JSON(consts.StatusBadRequest, err.Error())
|
|
return
|
|
}
|
|
resp := new(audioAndVideoCalls.VideoCallResp)
|
|
|
|
c.JSON(consts.StatusOK, resp)
|
|
}
|