Skip to content

Commit 10295f1

Browse files
committed
fix(sdks): demo 示例契约对齐——lastLoginAt 键名、直接返回业务 payload 与列表分页
- last_login_at → lastLoginAt(lowerCamelCase 契约键) - 响应去掉 {status,action} 包裹,直接返回业务对象,符合 API 响应契约 - 列表类 handler 增加 page/pageSize 分页,返回 {items,total} 信封
1 parent c5b1777 commit 10295f1

3 files changed

Lines changed: 174 additions & 83 deletions

File tree

sdks/go/examples/demo/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ type demoFunctionDefinition struct {
10011001
}
10021002

10031003
const (
1004-
playerSchema = `{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"level":{"type":"integer"},"vip":{"type":"integer"},"gold":{"type":"integer"},"status":{"type":"string"},"server":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"last_login_at":{"type":"string","format":"date-time"},"profile":{"type":"object"}}}`
1004+
playerSchema = `{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"level":{"type":"integer"},"vip":{"type":"integer"},"gold":{"type":"integer"},"status":{"type":"string"},"server":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastLoginAt":{"type":"string","format":"date-time"},"profile":{"type":"object"}}}`
10051005
orderSchema = `{"type":"object","properties":{"id":{"type":"string"},"playerId":{"type":"string"},"productId":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string"},"channel":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"attributes":{"type":"object"}}}`
10061006
leaderboardSchema = `{"type":"object","properties":{"id":{"type":"string"},"playerId":{"type":"string"},"playerName":{"type":"string"},"score":{"type":"integer"},"rank":{"type":"integer"},"updatedAt":{"type":"string","format":"date-time"}}}`
10071007
inventorySchema = `{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer"},"rarity":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}}}`

0 commit comments

Comments
 (0)