refactor(dto, repository): standardize pagination field names and update moderation status handling
- Changed JSON field names from "items" to "list" in various cursor pagination response DTOs for consistency. - Updated moderation status update methods in CommentRepository and PostRepository to use UpdateColumn for better clarity and to ensure that moderation actions do not affect content update timestamps.
This commit is contained in:
@@ -530,7 +530,7 @@ type SystemUnreadCountResponse struct {
|
||||
|
||||
// SystemMessageCursorPageResponse 系统消息游标分页响应
|
||||
type SystemMessageCursorPageResponse struct {
|
||||
Items []*SystemMessageResponse `json:"items"`
|
||||
Items []*SystemMessageResponse `json:"list"`
|
||||
NextCursor string `json:"next_cursor"`
|
||||
PrevCursor string `json:"prev_cursor"`
|
||||
HasMore bool `json:"has_more"`
|
||||
@@ -1201,7 +1201,7 @@ type CursorPageRequest struct {
|
||||
// 注意:由于 Go 的限制,这里使用 interface{} 作为 Items 类型
|
||||
// 实际使用时可以创建特定类型的响应结构体
|
||||
type CursorPageResponse struct {
|
||||
Items interface{} `json:"items"`
|
||||
Items interface{} `json:"list"`
|
||||
NextCursor string `json:"next_cursor,omitempty"` // 下一页游标
|
||||
PrevCursor string `json:"prev_cursor,omitempty"` // 上一页游标(可选)
|
||||
HasMore bool `json:"has_more"` // 是否有更多数据
|
||||
@@ -1215,7 +1215,7 @@ type CursorPageMeta struct {
|
||||
|
||||
// PostCursorPageResponse 帖子游标分页响应
|
||||
type PostCursorPageResponse struct {
|
||||
Items []*PostResponse `json:"items"`
|
||||
Items []*PostResponse `json:"list"`
|
||||
NextCursor string `json:"next_cursor,omitempty"`
|
||||
PrevCursor string `json:"prev_cursor,omitempty"`
|
||||
HasMore bool `json:"has_more"`
|
||||
@@ -1223,7 +1223,7 @@ type PostCursorPageResponse struct {
|
||||
|
||||
// CommentCursorPageResponse 评论游标分页响应
|
||||
type CommentCursorPageResponse struct {
|
||||
Items []*CommentResponse `json:"items"`
|
||||
Items []*CommentResponse `json:"list"`
|
||||
NextCursor string `json:"next_cursor,omitempty"`
|
||||
PrevCursor string `json:"prev_cursor,omitempty"`
|
||||
HasMore bool `json:"has_more"`
|
||||
@@ -1231,7 +1231,7 @@ type CommentCursorPageResponse struct {
|
||||
|
||||
// MessageCursorPageResponse 消息游标分页响应
|
||||
type MessageCursorPageResponse struct {
|
||||
Items []*MessageResponse `json:"items"`
|
||||
Items []*MessageResponse `json:"list"`
|
||||
NextCursor string `json:"next_cursor,omitempty"`
|
||||
PrevCursor string `json:"prev_cursor,omitempty"`
|
||||
HasMore bool `json:"has_more"`
|
||||
@@ -1239,7 +1239,7 @@ type MessageCursorPageResponse struct {
|
||||
|
||||
// ConversationCursorPageResponse 会话游标分页响应
|
||||
type ConversationCursorPageResponse struct {
|
||||
Items []*ConversationResponse `json:"items"`
|
||||
Items []*ConversationResponse `json:"list"`
|
||||
NextCursor string `json:"next_cursor,omitempty"`
|
||||
PrevCursor string `json:"prev_cursor,omitempty"`
|
||||
HasMore bool `json:"has_more"`
|
||||
@@ -1247,7 +1247,7 @@ type ConversationCursorPageResponse struct {
|
||||
|
||||
// GroupCursorPageResponse 群组游标分页响应
|
||||
type GroupCursorPageResponse struct {
|
||||
Items []*GroupResponse `json:"items"`
|
||||
Items []*GroupResponse `json:"list"`
|
||||
NextCursor string `json:"next_cursor,omitempty"`
|
||||
PrevCursor string `json:"prev_cursor,omitempty"`
|
||||
HasMore bool `json:"has_more"`
|
||||
@@ -1255,7 +1255,7 @@ type GroupCursorPageResponse struct {
|
||||
|
||||
// NotificationCursorPageResponse 通知游标分页响应
|
||||
type NotificationCursorPageResponse struct {
|
||||
Items []*NotificationResponse `json:"items"`
|
||||
Items []*NotificationResponse `json:"list"`
|
||||
NextCursor string `json:"next_cursor,omitempty"`
|
||||
PrevCursor string `json:"prev_cursor,omitempty"`
|
||||
HasMore bool `json:"has_more"`
|
||||
@@ -1263,7 +1263,7 @@ type NotificationCursorPageResponse struct {
|
||||
|
||||
// GroupMemberCursorPageResponse 群成员游标分页响应
|
||||
type GroupMemberCursorPageResponse struct {
|
||||
Items []*GroupMemberResponse `json:"items"`
|
||||
Items []*GroupMemberResponse `json:"list"`
|
||||
NextCursor string `json:"next_cursor,omitempty"`
|
||||
PrevCursor string `json:"prev_cursor,omitempty"`
|
||||
HasMore bool `json:"has_more"`
|
||||
@@ -1271,7 +1271,7 @@ type GroupMemberCursorPageResponse struct {
|
||||
|
||||
// GroupAnnouncementCursorPageResponse 群公告游标分页响应
|
||||
type GroupAnnouncementCursorPageResponse struct {
|
||||
Items []*GroupAnnouncementResponse `json:"items"`
|
||||
Items []*GroupAnnouncementResponse `json:"list"`
|
||||
NextCursor string `json:"next_cursor,omitempty"`
|
||||
PrevCursor string `json:"prev_cursor,omitempty"`
|
||||
HasMore bool `json:"has_more"`
|
||||
|
||||
Reference in New Issue
Block a user