feat: 拉取积分质押操作记录的接口

This commit is contained in:
2025-04-08 20:25:23 +08:00
parent 8119bcefdc
commit 85daa4b093
12 changed files with 500 additions and 11 deletions

View File

@@ -13,6 +13,10 @@ service novatask {
@doc "质押积分操作"
@handler StakePoint
post /stake (StakePointReq)
@doc "积分质押日志列表"
@handler GetStakeLogList
get /log (GetStakeLogListReq) returns (GetStakeLogListResp)
}
type GetStakeLevelListReq {
@@ -53,3 +57,24 @@ type StakePointReq {
Action int `json:"action"` // 操作类型1表示质押2表示升级质押 3表示续约
}
type GetStakeLogListReq {
RoleID uint64 `form:"role_id,optional"` // 角色id
Page int `form:"page"` // 页码
Size int `form:"size"` // 每页数量
}
type StakeLog {
Id uint `json:"id"` // id
RoleID uint64 `json:"role_id"` // 角色id
LevelId uint `json:"level_id"` // 档位id
Level uint `json:"level"` // 精灵等级
Points int `json:"points"` // 积分数量
Action uint8 `json:"action"` // 操作类型1=质押2=升级3=续约4=解除
CreatedAt int64 `json:"created_at"` // 创建时间
}
type GetStakeLogListResp {
Total int `json:"total"` // 总数
List []StakeLog `json:"list"` // 列表
}

View File

@@ -121,4 +121,18 @@ CREATE TABLE `nh_stake_points`
`status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态1=质押中2=已升级3=已续约4=已过期',
PRIMARY KEY (`id`),
INDEX (`uid`, `role_id`, `level_id`, `status`)
) COMMENT ='积分质押表';
CREATE TABLE `nh_stake_points_log`
(
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`uid` int unsigned NOT NULL COMMENT '用户id',
`role_id` bigint unsigned NOT NULL COMMENT '角色id',
`level_id` int(11) unsigned NOT NULL COMMENT '档位id',
`level` int unsigned NOT NULL COMMENT '档位',
`points` int(11) NOT NULL DEFAULT 0 COMMENT '积分数量',
`action` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '操作类型1=质押2=升级3=续约4=解除',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
INDEX (`uid`, `role_id`)
) COMMENT ='积分质押表';

View File

@@ -499,6 +499,57 @@
]
}
},
"/gapi/stakepoint/v1/log": {
"get": {
"summary": "积分质押日志列表",
"operationId": "GetStakeLogList",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/GetStakeLogListResp"
}
}
},
"parameters": [
{
"name": "role_id",
"description": " 角色id",
"in": "query",
"required": false,
"type": "integer",
"format": "int64"
},
{
"name": "page",
"description": " 页码",
"in": "query",
"required": true,
"type": "integer",
"format": "int32"
},
{
"name": "size",
"description": " 每页数量",
"in": "query",
"required": true,
"type": "integer",
"format": "int32"
}
],
"tags": [
"stakepoint"
],
"consumes": [
"multipart/form-data"
],
"security": [
{
"apiKey": []
}
]
}
},
"/gapi/stakepoint/v1/stake": {
"post": {
"summary": "质押积分操作",
@@ -1148,6 +1199,53 @@
"levels"
]
},
"GetStakeLogListReq": {
"type": "object",
"properties": {
"role_id": {
"type": "integer",
"format": "int64",
"description": " 角色id"
},
"page": {
"type": "integer",
"format": "int32",
"description": " 页码"
},
"size": {
"type": "integer",
"format": "int32",
"description": " 每页数量"
}
},
"title": "GetStakeLogListReq",
"required": [
"page",
"size"
]
},
"GetStakeLogListResp": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"format": "int32",
"description": " 总数"
},
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/StakeLog"
},
"description": " 列表"
}
},
"title": "GetStakeLogListResp",
"required": [
"total",
"list"
]
},
"GetTaskListReq": {
"type": "object",
"properties": {
@@ -1444,6 +1542,56 @@
"can_renew"
]
},
"StakeLog": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "uint32",
"description": " id"
},
"role_id": {
"type": "integer",
"format": "int64",
"description": " 角色id"
},
"level_id": {
"type": "integer",
"format": "uint32",
"description": " 档位id"
},
"level": {
"type": "integer",
"format": "uint32",
"description": " 精灵等级"
},
"points": {
"type": "integer",
"format": "int32",
"description": " 积分数量"
},
"action": {
"type": "integer",
"format": "uint8",
"description": " 操作类型1=质押2=升级3=续约4=解除"
},
"created_at": {
"type": "integer",
"format": "int64",
"description": " 创建时间"
}
},
"title": "StakeLog",
"required": [
"id",
"role_id",
"level_id",
"level",
"points",
"action",
"created_at"
]
},
"StakeNftList": {
"type": "object",
"properties": {