diff --git a/room/movies.go b/room/movies.go index f8a4f2b1..29ac830d 100644 --- a/room/movies.go +++ b/room/movies.go @@ -31,7 +31,7 @@ type movies struct { type Movie struct { BaseMovieInfo PullKey string `json:"pullKey"` - CreatedAt int64 `json:"createAt"` + CreatedAt int64 `json:"createdAt"` id uint64 channel *rtmps.Channel diff --git a/room/room.go b/room/room.go index 39a3f662..f273725e 100644 --- a/room/room.go +++ b/room/room.go @@ -33,7 +33,7 @@ type Room struct { users rwmap.RWMap[string, *User] rootUser *User lastActive int64 - createAt int64 + createdAt int64 mid uint64 hub *hub *movies @@ -74,7 +74,7 @@ func NewRoom(RoomId string, Password string, rtmps *rtmps.Server, conf ...RoomCo id: RoomId, rtmps: rtmps, lastActive: now, - createAt: now, + createdAt: now, } for _, c := range conf { @@ -97,8 +97,8 @@ func (r *Room) Init() { }) } -func (r *Room) CreateAt() int64 { - return atomic.LoadInt64(&r.createAt) +func (r *Room) CreatedAt() int64 { + return atomic.LoadInt64(&r.createdAt) } func (r *Room) RootUser() *User { diff --git a/server/handlers/room.go b/server/handlers/room.go index 9226b950..cb57d76b 100644 --- a/server/handlers/room.go +++ b/server/handlers/room.go @@ -114,7 +114,7 @@ func RoomList(ctx *gin.Context) { PeopleNum: v.ClientNum(), NeedPassword: v.NeedPassword(), Creator: v.RootUser().Name(), - CreateAt: v.CreateAt(), + CreatedAt: v.CreatedAt(), }) } @@ -127,11 +127,11 @@ func RoomList(ctx *gin.Context) { }, func(t1, t2 *model.RoomListResp) bool { return t1.Creator == t2.Creator }) - case "createAt": + case "createdAt": resp.SortStableFunc(func(v1, v2 *model.RoomListResp) bool { - return v1.CreateAt < v2.CreateAt + return v1.CreatedAt < v2.CreatedAt }, func(t1, t2 *model.RoomListResp) bool { - return t1.CreateAt == t2.CreateAt + return t1.CreatedAt == t2.CreatedAt }) case "roomId": resp.SortStableFunc(func(v1, v2 *model.RoomListResp) bool { diff --git a/server/model/room.go b/server/model/room.go index 848889c0..0363e686 100644 --- a/server/model/room.go +++ b/server/model/room.go @@ -73,7 +73,7 @@ type RoomListResp struct { PeopleNum int64 `json:"peopleNum"` NeedPassword bool `json:"needPassword"` Creator string `json:"creator"` - CreateAt int64 `json:"createAt"` + CreatedAt int64 `json:"createdAt"` } type LoginRoomReq struct {