fix: int64 ID 字段序列化为 JSON string
This commit is contained in:
@@ -7,12 +7,12 @@ type (
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
Post {
|
||||
Id int64 `json:"id"`
|
||||
Id int64 `json:"id,string"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Images []string `json:"images"`
|
||||
Tags []string `json:"tags"`
|
||||
LinkedOrderId int64 `json:"linkedOrderId,optional"`
|
||||
LinkedOrderId int64 `json:"linkedOrderId,string,optional"`
|
||||
Pinned bool `json:"pinned"`
|
||||
LikeCount int64 `json:"likeCount"`
|
||||
CommentCount int64 `json:"commentCount"`
|
||||
@@ -37,7 +37,7 @@ type (
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
Comment {
|
||||
Id int64 `json:"id"`
|
||||
Id int64 `json:"id,string"`
|
||||
Content string `json:"content"`
|
||||
Author UserProfile `json:"author"`
|
||||
LikeCount int64 `json:"likeCount"`
|
||||
|
||||
@@ -7,11 +7,11 @@ type (
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
Dispute {
|
||||
Id int64 `json:"id"`
|
||||
OrderId int64 `json:"orderId"`
|
||||
InitiatorId int64 `json:"initiatorId"`
|
||||
Id int64 `json:"id,string"`
|
||||
OrderId int64 `json:"orderId,string"`
|
||||
InitiatorId int64 `json:"initiatorId,string"`
|
||||
InitiatorName string `json:"initiatorName"`
|
||||
RespondentId int64 `json:"respondentId"`
|
||||
RespondentId int64 `json:"respondentId,string"`
|
||||
Reason string `json:"reason"`
|
||||
Evidence []string `json:"evidence"`
|
||||
Status string `json:"status"`
|
||||
@@ -20,7 +20,7 @@ type (
|
||||
RespondentEvidence []string `json:"respondentEvidence"`
|
||||
AppealReason string `json:"appealReason,optional"`
|
||||
AppealedAt string `json:"appealedAt,optional"`
|
||||
ResolvedBy int64 `json:"resolvedBy,optional"`
|
||||
ResolvedBy int64 `json:"resolvedBy,string,optional"`
|
||||
ResolvedAt string `json:"resolvedAt,optional"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
@@ -74,3 +74,4 @@ service dispute-api {
|
||||
@handler AppealDispute
|
||||
post /disputes/:id/appeal (AppealReq) returns (EmptyResp)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import "common.api"
|
||||
|
||||
type (
|
||||
Game {
|
||||
Id int64 `json:"id,optional"`
|
||||
Id int64 `json:"id,string,optional"`
|
||||
Name string `json:"name"`
|
||||
Icon string `json:"icon"`
|
||||
Category string `json:"category"`
|
||||
|
||||
@@ -7,7 +7,7 @@ type (
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
Notification {
|
||||
Id int64 `json:"id"`
|
||||
Id int64 `json:"id,string"`
|
||||
Type string `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
@@ -38,3 +38,4 @@ service notifi-api {
|
||||
@handler ReadAllNotifications
|
||||
put /notifications/read-all (EmptyResp) returns (EmptyResp)
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -14,9 +14,9 @@ type (
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
PlayerService {
|
||||
Id int64 `json:"id"`
|
||||
PlayerId int64 `json:"playerId"`
|
||||
GameId int64 `json:"gameId"`
|
||||
Id int64 `json:"id,string"`
|
||||
PlayerId int64 `json:"playerId,string"`
|
||||
GameId int64 `json:"gameId,string"`
|
||||
GameName string `json:"gameName"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
@@ -26,10 +26,10 @@ type (
|
||||
Availability []string `json:"availability"`
|
||||
}
|
||||
Order {
|
||||
Id int64 `json:"id"`
|
||||
ConsumerId int64 `json:"consumerId"`
|
||||
Id int64 `json:"id,string"`
|
||||
ConsumerId int64 `json:"consumerId,string"`
|
||||
PlayerId string `json:"playerId"`
|
||||
ShopId int64 `json:"shopId,optional"`
|
||||
ShopId int64 `json:"shopId,string,optional"`
|
||||
Service PlayerService `json:"service"`
|
||||
Status string `json:"status"`
|
||||
TotalPrice float64 `json:"totalPrice"`
|
||||
@@ -48,9 +48,9 @@ type (
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
CreateOrderReq {
|
||||
PlayerId int64 `json:"playerId"`
|
||||
ShopId int64 `json:"shopId,optional"`
|
||||
ServiceId int64 `json:"serviceId"`
|
||||
PlayerId int64 `json:"playerId,string"`
|
||||
ShopId int64 `json:"shopId,string,optional"`
|
||||
ServiceId int64 `json:"serviceId,string"`
|
||||
Quantity int `json:"quantity"`
|
||||
Note string `json:"note,optional"`
|
||||
}
|
||||
|
||||
+6
-6
@@ -11,9 +11,9 @@ import "common.api"
|
||||
|
||||
type (
|
||||
PlayerService {
|
||||
Id int64 `json:"id,optional"`
|
||||
PlayerId int64 `json:"playerId"`
|
||||
GameId int64 `json:"gameId"`
|
||||
Id int64 `json:"id,string,optional"`
|
||||
PlayerId int64 `json:"playerId,string"`
|
||||
GameId int64 `json:"gameId,string"`
|
||||
GameName string `json:"gameName"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
@@ -27,7 +27,7 @@ type (
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
CreateServiceReq {
|
||||
GameId int64 `json:"gameId,optional"`
|
||||
GameId int64 `json:"gameId,string,optional"`
|
||||
Title string `json:"title,optional"`
|
||||
Description string `json:"description,optional"`
|
||||
Price float64 `json:"price"`
|
||||
@@ -37,7 +37,7 @@ type (
|
||||
}
|
||||
UpdateServiceReq {
|
||||
Id int64 `path:"id"`
|
||||
GameId *int64 `json:"gameId,optional"`
|
||||
GameId *int64 `json:"gameId,string,optional"`
|
||||
Title *string `json:"title,optional"`
|
||||
Description *string `json:"description,optional"`
|
||||
Price *float64 `json:"price,optional"`
|
||||
@@ -46,7 +46,7 @@ type (
|
||||
Availability []string `json:"availability"`
|
||||
}
|
||||
PlayerProfile {
|
||||
Id int64 `json:"id"`
|
||||
Id int64 `json:"id,string"`
|
||||
User UserProfile `json:"user"`
|
||||
Rating float64 `json:"rating"`
|
||||
TotalOrders int64 `json:"totalOrders"`
|
||||
|
||||
+4
-3
@@ -7,9 +7,9 @@ type (
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
Review {
|
||||
Id int64 `json:"id"`
|
||||
OrderId int64 `json:"orderId"`
|
||||
FromUserId int64 `json:"fromUserId"`
|
||||
Id int64 `json:"id,string"`
|
||||
OrderId int64 `json:"orderId,string"`
|
||||
FromUserId int64 `json:"fromUserId,string"`
|
||||
FromUserName string `json:"fromUserName"`
|
||||
Rating int `json:"rating"`
|
||||
Content string `json:"content"`
|
||||
@@ -61,3 +61,4 @@ service review-api {
|
||||
@handler ListUserReviews
|
||||
get /users/:id/reviews (ListUserReviewsReq) returns (ReviewListResp)
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -57,7 +57,7 @@ type (
|
||||
}
|
||||
InvitationReq {
|
||||
Id int64 `path:"id"`
|
||||
PlayerId int64 `json:"playerId"`
|
||||
PlayerId int64 `json:"playerId,string"`
|
||||
}
|
||||
)
|
||||
|
||||
@@ -101,11 +101,11 @@ type (
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
ShopInvitation {
|
||||
Id int64 `json:"id"`
|
||||
ShopId int64 `json:"shopId"`
|
||||
PlayerId int64 `json:"playerId"`
|
||||
Id int64 `json:"id,string"`
|
||||
ShopId int64 `json:"shopId,string"`
|
||||
PlayerId int64 `json:"playerId,string"`
|
||||
Status string `json:"status"`
|
||||
InvitedBy int64 `json:"invitedBy"`
|
||||
InvitedBy int64 `json:"invitedBy,string"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
RespondedAt int64 `json:"respondedAt,optional"`
|
||||
}
|
||||
|
||||
+3
-2
@@ -18,8 +18,8 @@ type (
|
||||
// 认证记录展示对象
|
||||
// 对应数据库 user_verifications 表
|
||||
VerificationItem {
|
||||
Id int64 `json:"id"` // 认证记录ID (主键,用于管理员操作)
|
||||
UserId int64 `json:"userId"` // 申请人ID (外键)
|
||||
Id int64 `json:"id,string"` // 认证记录ID (主键,用于管理员操作)
|
||||
UserId int64 `json:"userId,string"` // 申请人ID (外键)
|
||||
UserNickname string `json:"userNickname"` // 冗余显示,方便前端展示
|
||||
Role string `json:"role"` // 申请角色: player, owner
|
||||
Status string `json:"status"` // pending, approved, rejected
|
||||
@@ -260,3 +260,4 @@ service users-api {
|
||||
@handler RejectVerification
|
||||
post /verifications/:id/reject (RejectVerificationReq) returns (VerificationEmptyResp)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ type (
|
||||
FrozenBalance string `json:"frozenBalance"`
|
||||
}
|
||||
Transaction {
|
||||
Id int64 `json:"id"`
|
||||
Id int64 `json:"id,string"`
|
||||
Type string `json:"type"`
|
||||
Amount string `json:"amount"`
|
||||
Description string `json:"description"`
|
||||
|
||||
Reference in New Issue
Block a user