feat: 积分质押功能

This commit is contained in:
2025-04-03 16:17:20 +08:00
parent 229f1d181b
commit 8119bcefdc
40 changed files with 2552 additions and 108 deletions

View File

@@ -69,6 +69,33 @@
]
}
},
"/gapi/admin/game_action": {
"post": {
"summary": "GameAction",
"operationId": "GameAction",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/GameActionResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/GameActionReq"
}
}
],
"tags": [
"admin"
]
}
},
"/gapi/admin/nft_holder_update": {
"get": {
"summary": "NFT持有者更新",
@@ -437,6 +464,71 @@
]
}
},
"/gapi/stakepoint/v1/level": {
"get": {
"summary": "获取质押档位列表",
"operationId": "GetStakeLevelList",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/GetStakeLevelListResp"
}
}
},
"parameters": [
{
"name": "role_id",
"description": " 角色id",
"in": "query",
"required": true,
"type": "integer",
"format": "int64"
}
],
"tags": [
"stakepoint"
],
"consumes": [
"multipart/form-data"
],
"security": [
{
"apiKey": []
}
]
}
},
"/gapi/stakepoint/v1/stake": {
"post": {
"summary": "质押积分操作",
"operationId": "StakePoint",
"responses": {
"200": {
"description": "A successful response.",
"schema": {}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/StakePointReq"
}
}
],
"tags": [
"stakepoint"
],
"security": [
{
"apiKey": []
}
]
}
},
"/gapi/task/v1/bind_tribally": {
"get": {
"summary": "绑定Tribally账号",
@@ -946,6 +1038,44 @@
"type"
]
},
"GameActionReq": {
"type": "object",
"properties": {
"role_id": {
"type": "integer",
"format": "int64"
},
"action": {
"type": "string"
}
},
"title": "GameActionReq",
"required": [
"role_id",
"action"
]
},
"GameActionResp": {
"type": "object",
"properties": {
"ret": {
"type": "integer",
"format": "int32"
},
"msg": {
"type": "string"
},
"data": {
"type": "object"
}
},
"title": "GameActionResp",
"required": [
"ret",
"msg",
"data"
]
},
"GetCommunityListResp": {
"type": "object",
"properties": {
@@ -974,6 +1104,50 @@
"wallet_address"
]
},
"GetStakeLevelListReq": {
"type": "object",
"properties": {
"role_id": {
"type": "integer",
"format": "int64",
"description": " 角色id"
}
},
"title": "GetStakeLevelListReq",
"required": [
"role_id"
]
},
"GetStakeLevelListResp": {
"type": "object",
"properties": {
"state": {
"type": "integer",
"format": "int32",
"description": " 状态1表示已开启可质押 0表示不可质押"
},
"staking": {
"$ref": "#/definitions/StakeLevel",
"description": " 质押中的档位信息"
},
"renew_level": {
"$ref": "#/definitions/StakeLevel",
"description": " 已续约的档位信息"
},
"levels": {
"type": "array",
"items": {
"$ref": "#/definitions/PointStakeLevel"
},
"description": " 档位列表"
}
},
"title": "GetStakeLevelListResp",
"required": [
"state",
"levels"
]
},
"GetTaskListReq": {
"type": "object",
"properties": {
@@ -1141,6 +1315,49 @@
"total"
]
},
"PointStakeLevel": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32",
"description": " 档位id"
},
"title": {
"type": "string",
"description": " 档位标题"
},
"level": {
"type": "integer",
"format": "int32",
"description": " 精灵等级"
},
"points": {
"type": "integer",
"format": "int32",
"description": " 积分数量"
},
"days": {
"type": "number",
"format": "double",
"description": " 质押天数"
},
"renew_days": {
"type": "number",
"format": "double",
"description": " 续期天数"
}
},
"title": "PointStakeLevel",
"required": [
"id",
"title",
"level",
"points",
"days",
"renew_days"
]
},
"Result": {
"type": "object",
"properties": {
@@ -1169,6 +1386,64 @@
"address"
]
},
"StakeLevel": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"title": {
"type": "string",
"description": " 档位标题"
},
"level": {
"type": "integer",
"format": "int32",
"description": " 精灵等级"
},
"points": {
"type": "integer",
"format": "int32",
"description": " 积分数量"
},
"days": {
"type": "number",
"format": "double",
"description": " 质押天数"
},
"renew_days": {
"type": "number",
"format": "double",
"description": " 续期天数"
},
"start_time": {
"type": "string",
"description": " 开始时间"
},
"end_time": {
"type": "string",
"description": " 结束时间"
},
"can_renew": {
"type": "boolean",
"format": "boolean",
"description": " 是否可续约"
}
},
"title": "StakeLevel",
"required": [
"id",
"title",
"level",
"points",
"days",
"renew_days",
"start_time",
"end_time",
"can_renew"
]
},
"StakeNftList": {
"type": "object",
"properties": {
@@ -1190,6 +1465,32 @@
"token_ids"
]
},
"StakePointReq": {
"type": "object",
"properties": {
"role_id": {
"type": "integer",
"format": "int64",
"description": " 角色id"
},
"level_id": {
"type": "integer",
"format": "int32",
"description": " 档位id"
},
"action": {
"type": "integer",
"format": "int32",
"description": " 操作类型1表示质押2表示升级质押 3表示续约"
}
},
"title": "StakePointReq",
"required": [
"role_id",
"level_id",
"action"
]
},
"StakeReward": {
"type": "object",
"properties": {