diff --git a/acquaintances/acquaintances b/acquaintances/acquaintances index 16e87a2..0428b98 100644 Binary files a/acquaintances/acquaintances and b/acquaintances/acquaintances differ diff --git a/acquaintances/biz/handler/user/user_service.go b/acquaintances/biz/handler/user/user_service.go index 9eebab8..eefcf4e 100644 --- a/acquaintances/biz/handler/user/user_service.go +++ b/acquaintances/biz/handler/user/user_service.go @@ -97,7 +97,7 @@ func InfoUser(ctx context.Context, c *app.RequestContext) { } // CreateUser . -// @router /v1/user/create/ [POST] +// @router /v1/user/ [POST] func CreateUser(ctx context.Context, c *app.RequestContext) { var err error var req user.CreateUserRequest @@ -113,13 +113,14 @@ func CreateUser(ctx context.Context, c *app.RequestContext) { } if err = mysql.CreateUser([]*model.User{ { - UserID: strconv.FormatInt(userId, 10), - UserName: req.Name, - Gender: req.Gender, - Age: uint8(req.Age), - Mobile: req.Mobile, - Area: uint8(req.Area), - UserPassword: req.UserPassword, + UserID: strconv.FormatInt(userId, 10), + UserName: req.Name, + Gender: req.Gender, + Age: uint8(req.Age), + Mobile: req.Mobile, + Area: uint8(req.Area), + UserPassword: req.UserPassword, + AvatarImageURL: req.AvatarImageURL, }, }); err != nil { c.JSON(consts.StatusInternalServerError, &user.CreateUserResponse{Code: user.Code_DBErr, Msg: err.Error()}) diff --git a/acquaintances/biz/model/user/user.go b/acquaintances/biz/model/user/user.go index 81608e0..9d6d5dd 100644 --- a/acquaintances/biz/model/user/user.go +++ b/acquaintances/biz/model/user/user.go @@ -1822,12 +1822,13 @@ func (p *UserInfoReq) String() string { } type CreateUserRequest struct { - Name string `thrift:"name,1" form:"name" form:"name" json:"name" vd:"(len($) > 0 && len($) < 100)"` - Gender Gender `thrift:"gender,2" form:"gender" json:"gender" vd:"($ == 1||$ == 2)"` - Age int64 `thrift:"age,3" form:"age" json:"age" vd:"$>0"` - Mobile string `thrift:"mobile,4" form:"mobile" json:"mobile" vd:"(len($) > 0 && len($) < 12)"` - Area int64 `thrift:"area,5" form:"area" form:"area" json:"area" vd:"$>0"` - UserPassword string `thrift:"user_password,6" form:"user_password" form:"user_password" json:"user_password" vd:"(len($) > 0 && len($) < 15)"` + Name string `thrift:"name,1" form:"name" json:"name" vd:"(len($) > 0 && len($) < 100)"` + Gender Gender `thrift:"gender,2" form:"gender" json:"gender" vd:"($ == 1||$ == 2)"` + Age int64 `thrift:"age,3" form:"age" json:"age"` + Mobile string `thrift:"mobile,4" form:"mobile" form:"mobile" json:"mobile" vd:"(len($) > 0 && len($) < 12)"` + Area int64 `thrift:"area,5" form:"area" json:"area" vd:"$>0"` + UserPassword string `thrift:"user_password,6" form:"user_password" json:"user_password" vd:"(len($) > 0 && len($) < 15)"` + AvatarImageURL string `thrift:"avatar_image_url,7" form:"avatar_image_url" json:"avatar_image_url"` } func NewCreateUserRequest() *CreateUserRequest { @@ -1861,6 +1862,10 @@ func (p *CreateUserRequest) GetUserPassword() (v string) { return p.UserPassword } +func (p *CreateUserRequest) GetAvatarImageURL() (v string) { + return p.AvatarImageURL +} + var fieldIDToName_CreateUserRequest = map[int16]string{ 1: "name", 2: "gender", @@ -1868,6 +1873,7 @@ var fieldIDToName_CreateUserRequest = map[int16]string{ 4: "mobile", 5: "area", 6: "user_password", + 7: "avatar_image_url", } func (p *CreateUserRequest) Read(iprot thrift.TProtocol) (err error) { @@ -1936,6 +1942,14 @@ func (p *CreateUserRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -2031,6 +2045,17 @@ func (p *CreateUserRequest) ReadField6(iprot thrift.TProtocol) error { p.UserPassword = _field return nil } +func (p *CreateUserRequest) ReadField7(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.AvatarImageURL = _field + return nil +} func (p *CreateUserRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -2062,6 +2087,10 @@ func (p *CreateUserRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 6 goto WriteFieldError } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -2176,6 +2205,22 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } +func (p *CreateUserRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("avatar_image_url", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.AvatarImageURL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} func (p *CreateUserRequest) String() string { if p == nil { diff --git a/acquaintances/idl/user.thrift b/acquaintances/idl/user.thrift index c323a7b..d3e70c9 100644 --- a/acquaintances/idl/user.thrift +++ b/acquaintances/idl/user.thrift @@ -62,10 +62,11 @@ struct UserInfoReq { struct CreateUserRequest{ 1: string name (api.body="name", api.form="name",api.vd="(len($) > 0 && len($) < 100)") 2: Gender gender (api.body="gender", api.form="gender",api.vd="($ == 1||$ == 2)") - 3: i64 age (api.body="age", api.form="age",api.vd="$>0") + 3: i64 age (api.body="age", api.form="age") 4: string mobile (api.body="mobile", api.form="mobile",api.vd="(len($) > 0 && len($) < 12)") - 5: i64 area (api.body="area", api.form="area",api.vd="$>0") + 5: i64 area (api.body="area", api.form="area",api.vd="$>0") 6: string user_password (api.body="user_password", api.form="user_password",api.vd="(len($) > 0 && len($) < 15)") + 7: string avatar_image_url (api.body="avatar_image_url", api.form="avatar_image_url") } struct CreateUserResponse{ diff --git a/livekitManage/audioAndVideoCalls b/livekitManage/audioAndVideoCalls new file mode 100644 index 0000000..4935979 Binary files /dev/null and b/livekitManage/audioAndVideoCalls differ diff --git a/livekitManage/biz/handler/audioAndVideoCalls/audio_call_service.go b/livekitManage/biz/handler/audioAndVideoCalls/audio_call_service.go index f1c4e41..5fe31d0 100644 --- a/livekitManage/biz/handler/audioAndVideoCalls/audio_call_service.go +++ b/livekitManage/biz/handler/audioAndVideoCalls/audio_call_service.go @@ -11,7 +11,7 @@ import ( ) // AudioCall . -// @router /audioCall [POST] +// @router /v1/audio_call/ [POST] func AudioCall(ctx context.Context, c *app.RequestContext) { var err error var req audioAndVideoCalls.AudioCallReq diff --git a/livekitManage/biz/handler/audioAndVideoCalls/room_service.go b/livekitManage/biz/handler/audioAndVideoCalls/room_service.go index aaa5f0b..8a4d958 100644 --- a/livekitManage/biz/handler/audioAndVideoCalls/room_service.go +++ b/livekitManage/biz/handler/audioAndVideoCalls/room_service.go @@ -11,7 +11,7 @@ import ( ) // RoomList . -// @router /roomlist [GET] +// @router /v1/roomlist/ [GET] func RoomList(ctx context.Context, c *app.RequestContext) { var err error var req audioAndVideoCalls.RoomListReq @@ -31,7 +31,7 @@ func RoomList(ctx context.Context, c *app.RequestContext) { } // RoomRemove . -// @router /room [DELETE] +// @router /v1/room/ [DELETE] func RoomRemove(ctx context.Context, c *app.RequestContext) { var err error var req audioAndVideoCalls.RemoveRoomReq diff --git a/livekitManage/biz/handler/audioAndVideoCalls/video_call_service.go b/livekitManage/biz/handler/audioAndVideoCalls/video_call_service.go index 2dc8360..96523aa 100644 --- a/livekitManage/biz/handler/audioAndVideoCalls/video_call_service.go +++ b/livekitManage/biz/handler/audioAndVideoCalls/video_call_service.go @@ -12,7 +12,7 @@ import ( ) // VideoCall . -// @router /videoCall [POST] +// @router /v1/video_call/ [POST] func VideoCall(ctx context.Context, c *app.RequestContext) { var err error var req audioAndVideoCalls.VideoCallReq diff --git a/livekitManage/biz/router/audioAndVideoCalls/audioAndVideoCalls.go b/livekitManage/biz/router/audioAndVideoCalls/audioAndVideoCalls.go index 7ef64b8..42d6fb0 100644 --- a/livekitManage/biz/router/audioAndVideoCalls/audioAndVideoCalls.go +++ b/livekitManage/biz/router/audioAndVideoCalls/audioAndVideoCalls.go @@ -17,8 +17,23 @@ import ( func Register(r *server.Hertz) { root := r.Group("/", rootMw()...) - root.POST("/audioCall", append(_audiocallMw(), audioAndVideoCalls.AudioCall)...) - root.DELETE("/room", append(_roomremoveMw(), audioAndVideoCalls.RoomRemove)...) - root.GET("/roomlist", append(_roomlistMw(), audioAndVideoCalls.RoomList)...) - root.POST("/videoCall", append(_videocallMw(), audioAndVideoCalls.VideoCall)...) + { + _v1 := root.Group("/v1", _v1Mw()...) + { + _audio_call := _v1.Group("/audio_call", _audio_callMw()...) + _audio_call.POST("/", append(_audiocallMw(), audioAndVideoCalls.AudioCall)...) + } + { + _room := _v1.Group("/room", _roomMw()...) + _room.DELETE("/", append(_roomremoveMw(), audioAndVideoCalls.RoomRemove)...) + } + { + _roomlist := _v1.Group("/roomlist", _roomlistMw()...) + _roomlist.GET("/", append(_roomlist0Mw(), audioAndVideoCalls.RoomList)...) + } + { + _video_call := _v1.Group("/video_call", _video_callMw()...) + _video_call.POST("/", append(_videocallMw(), audioAndVideoCalls.VideoCall)...) + } + } } diff --git a/livekitManage/biz/router/audioAndVideoCalls/middleware.go b/livekitManage/biz/router/audioAndVideoCalls/middleware.go index 1aa484f..1e13c04 100644 --- a/livekitManage/biz/router/audioAndVideoCalls/middleware.go +++ b/livekitManage/biz/router/audioAndVideoCalls/middleware.go @@ -45,3 +45,28 @@ func _roomremoveMw() []app.HandlerFunc { // your code... return nil } + +func _v1Mw() []app.HandlerFunc { + // your code... + return nil +} + +func _audio_callMw() []app.HandlerFunc { + // your code... + return nil +} + +func _video_callMw() []app.HandlerFunc { + // your code... + return nil +} + +func _roomMw() []app.HandlerFunc { + // your code... + return nil +} + +func _roomlist0Mw() []app.HandlerFunc { + // your code... + return nil +} diff --git a/livekitManage/idl/audioAndVideoCalls.thrift b/livekitManage/idl/audioAndVideoCalls.thrift index a81f534..ccc3b70 100644 --- a/livekitManage/idl/audioAndVideoCalls.thrift +++ b/livekitManage/idl/audioAndVideoCalls.thrift @@ -20,7 +20,7 @@ struct audioCallResp { service AudioCallService { - audioCallResp audioCall(1: audioCallReq request) (api.post="/audioCall"); + audioCallResp audioCall(1: audioCallReq request) (api.post="/v1/audio_call/"); } struct videoCallReq { @@ -34,7 +34,7 @@ struct videoCallResp { } service VideoCallService { - videoCallResp videoCall(1: videoCallReq request) (api.post="/videoCall"); + videoCallResp videoCall(1: videoCallReq request) (api.post="/v1/video_call/"); } @@ -56,6 +56,6 @@ struct RemoveRoomResp { } service RoomService { - roomListResp RoomList(1: roomListReq request) (api.get="/roomlist"); - RemoveRoomResp RoomRemove(1: RemoveRoomReq request) (api.delete="/room"); + roomListResp RoomList(1: roomListReq request) (api.get="/v1/roomlist/"); + RemoveRoomResp RoomRemove(1: RemoveRoomReq request) (api.delete="/v1/room/"); } \ No newline at end of file diff --git a/userAuthCenter.zip b/userAuthCenter.zip deleted file mode 100644 index 3a1551d..0000000 Binary files a/userAuthCenter.zip and /dev/null differ