Skip to content

Commit

Permalink
feat: 调整列表 Data 类型为指针切片
Browse files Browse the repository at this point in the history
  • Loading branch information
WindowsSov8forUs committed Jun 18, 2024
1 parent 125a7b8 commit d99df3b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pkg/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ type Channel struct {

// Channel 分页列表
type ChannelList struct {
Data []Channel `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
Data []*Channel `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
}
4 changes: 2 additions & 2 deletions pkg/guild/guild.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ type Guild struct {

// Guild 分页列表
type GuildList struct {
Data []Guild `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
Data []*Guild `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
}
4 changes: 2 additions & 2 deletions pkg/guildmember/guildmember.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ type GuildMember struct {

// GuildMember 分页列表
type GuildMemberList struct {
Data []GuildMember `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
Data []*GuildMember `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
}
4 changes: 2 additions & 2 deletions pkg/guildrole/guildrole.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ type GuildRole struct {

// GuildRole 分页列表
type GuildRoleList struct {
Data []GuildRole `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
Data []*GuildRole `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
}
6 changes: 3 additions & 3 deletions pkg/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ type Message struct {

// Message 双向分页列表
type MessageBidiList struct {
Data []Message `json:"data"` // 数据
Prev string `json:"prev,omitempty"` // 上一页的令牌
Next string `json:"next,omitempty"` // 下一页的令牌
Data []*Message `json:"data"` // 数据
Prev string `json:"prev,omitempty"` // 上一页的令牌
Next string `json:"next,omitempty"` // 下一页的令牌
}

func (m *Message) Decode(elements []MessageElement) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ type User struct {

// User 分页列表
type UserList struct {
Data []User `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
Data []*User `json:"data"` // 数据
Next string `json:"next,omitempty"` // 下一页的令牌
}

0 comments on commit d99df3b

Please sign in to comment.