Skip to content

Commit

Permalink
Typo: createAt to createdAt
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Oct 16, 2023
1 parent 4271162 commit 9b5c3bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion room/movies.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions room/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions server/handlers/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
})
}

Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion server/model/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9b5c3bd

Please sign in to comment.