Files
blog-server/internal/model/common/response.go

22 lines
646 B
Go

package common
// Response 通用响应结构体
type Response struct {
Message string `json:"msg,omitempty"` // 消息说明
Data interface{} `json:"data,omitempty"` // 业务数据
}
// PageResponse 分页查询通用相应结构体
type PageResponse struct {
Message string `json:"msg,omitempty"` // 消息说明
Page int32 `json:"page"` // 当前页码
PageSize int32 `json:"page_size"` // 每页数量
List interface{} `json:"list,omitempty"` // 业务数据
Total int64 `json:"total"` // 总记录数
}
type PageResult[T any] struct {
List []T
Total int64
}