增加提取castile到游戏的数据库表,定义API接口等;

This commit is contained in:
yuming88
2025-04-28 14:12:44 +08:00
parent 109d76cd2e
commit e50137a90e
14 changed files with 692 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import "admin.api"
import "game7.api"
import "kgen.api"
import "stakepoint.api"
import "transfercastile.api"
info (
desc: "nova api"

View File

@@ -0,0 +1,42 @@
syntax = "v1"
@server (
prefix: /gapi/transfercastile/v1
jwt: Auth
group: transfercastile
)
service novatask {
@doc "提取castile到游戏"
@handler TransferCastileToGame
post /save (TransferCastileToGameReq) returns (TransferCastileToGameResp)
@doc "获取提取castile到游戏的记录"
@handler TransferCastileToGameList
post /list (TransferCastileToGameListReq) returns (TransferCastileToGameResp)
}
type TransferCastileToGameReq {
RoleID int64 `json:"role_id"` // 角色id
Amount int64 `json:"amount"` // 数量
}
type TransferCastileToGameResp {
TransferToGameLog
}
type TransferCastileToGameListReq {
RoleID int64 `json:"role_id,optional"` // 角色id
}
type TransferToGameLog {
Id int `json:"id"` // id
RoleID int64 `json:"role_id"` // 角色id
Amount int64 `json:"amount"` // 数量
Status string `json:"elf_name"` // 状态
}
type TransferCastileToGameListResp {
Total int `json:"total"` // 总数
List []TransferToGameLog `json:"list"` // 列表
}

View File

@@ -135,4 +135,38 @@ CREATE TABLE `nh_stake_points_log`
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
INDEX (`uid`, `role_id`)
) COMMENT ='积分质押表';
) COMMENT ='积分质押表';
CREATE TABLE `nh_castile_token`
(
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`uid` int unsigned NOT NULL default 0 COMMENT '用户id',
`email` varchar(80) NOT NULL default '' COMMENT '账号',
`amount1` int(11) unsigned NOT NULL default 0 COMMENT '一测奖励',
`amount2` int(11) unsigned NOT NULL default 0 COMMENT '二测奖励',
`amount3` int(11) unsigned NOT NULL default 0 COMMENT '三测奖励',
`total` int(11) unsigned NOT NULL default 0 COMMENT '总奖励',
`transfer` int(11) unsigned NOT NULL default 0 COMMENT '已提取到游戏内',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uid` (`uid`) USING BTREE,
UNIQUE KEY `email` (`email`) USING BTREE
) COMMENT ='CASTILE代币表';
CREATE TABLE `nh_castile_token_log`
(
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`uid` int unsigned NOT NULL COMMENT '用户id',
`role_id` bigint unsigned NOT NULL COMMENT '角色id',
`amount` int(11) unsigned NOT NULL COMMENT '提取的数量',
`callback_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '下发通知状态:0未通知,1已通知,2通知异常',
`action` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '操作类型1=提取到游戏',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
KEY `uid` (`uid`) USING BTREE,
KEY `role_id` (`role_id`) USING BTREE
) COMMENT ='CASTILE代币提取记录表';

View File

@@ -894,6 +894,70 @@
"multipart/form-data"
]
}
},
"/gapi/transfercastile/v1/list": {
"post": {
"summary": "获取提取castile到游戏的记录",
"operationId": "TransferCastileToGameList",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/TransferCastileToGameResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TransferCastileToGameListReq"
}
}
],
"tags": [
"transfercastile"
],
"security": [
{
"apiKey": []
}
]
}
},
"/gapi/transfercastile/v1/save": {
"post": {
"summary": "提取castile到游戏",
"operationId": "TransferCastileToGame",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/TransferCastileToGameResp"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/TransferCastileToGameReq"
}
}
],
"tags": [
"transfercastile"
],
"security": [
{
"apiKey": []
}
]
}
}
},
"definitions": {
@@ -1859,6 +1923,115 @@
"finish_state"
]
},
"TransferCastileToGameListReq": {
"type": "object",
"properties": {
"role_id": {
"type": "integer",
"format": "int64",
"description": " 角色id"
}
},
"title": "TransferCastileToGameListReq"
},
"TransferCastileToGameListResp": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"format": "int32",
"description": " 总数"
},
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/TransferToGameLog"
},
"description": " 列表"
}
},
"title": "TransferCastileToGameListResp",
"required": [
"total",
"list"
]
},
"TransferCastileToGameReq": {
"type": "object",
"properties": {
"role_id": {
"type": "integer",
"format": "int64",
"description": " 角色id"
},
"amount": {
"type": "integer",
"format": "int64",
"description": " 数量"
}
},
"title": "TransferCastileToGameReq",
"required": [
"role_id",
"amount"
]
},
"TransferCastileToGameResp": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32",
"description": " id"
},
"role_id": {
"type": "integer",
"format": "int64",
"description": " 角色id"
},
"amount": {
"type": "integer",
"format": "int64",
"description": " 数量"
},
"elf_name": {
"type": "string",
"description": " 状态"
}
},
"title": "TransferCastileToGameResp"
},
"TransferToGameLog": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32",
"description": " id"
},
"role_id": {
"type": "integer",
"format": "int64",
"description": " 角色id"
},
"amount": {
"type": "integer",
"format": "int64",
"description": " 数量"
},
"elf_name": {
"type": "string",
"description": " 状态"
}
},
"title": "TransferToGameLog",
"required": [
"id",
"role_id",
"amount",
"elf_name"
]
},
"UnStakeNftReq": {
"type": "object",
"properties": {