feat: 积分质押功能
This commit is contained in:
55
doc/api/stakepoint.api
Normal file
55
doc/api/stakepoint.api
Normal file
@@ -0,0 +1,55 @@
|
||||
syntax = "v1"
|
||||
|
||||
@server (
|
||||
prefix: /gapi/stakepoint/v1
|
||||
jwt: Auth
|
||||
group: stakepoint
|
||||
)
|
||||
service novatask {
|
||||
@doc "获取质押档位列表"
|
||||
@handler GetStakeLevelList
|
||||
get /level (GetStakeLevelListReq) returns (GetStakeLevelListResp)
|
||||
|
||||
@doc "质押积分操作"
|
||||
@handler StakePoint
|
||||
post /stake (StakePointReq)
|
||||
}
|
||||
|
||||
type GetStakeLevelListReq {
|
||||
RoleID int64 `form:"role_id"` // 角色id
|
||||
}
|
||||
|
||||
type PointStakeLevel {
|
||||
Id int `json:"id"` // 档位id
|
||||
Title string `json:"title"` // 档位标题
|
||||
Level int `json:"level"` // 精灵等级
|
||||
Points int `json:"points"` // 积分数量
|
||||
Days float64 `json:"days"` // 质押天数
|
||||
RenewDays float64 `json:"renew_days"` // 续期天数
|
||||
}
|
||||
|
||||
type StakeLevel {
|
||||
Id int `json:"id"`
|
||||
Title string `json:"title"` // 档位标题
|
||||
Level int `json:"level"` // 精灵等级
|
||||
Points int `json:"points"` // 积分数量
|
||||
Days float64 `json:"days"` // 质押天数
|
||||
RenewDays float64 `json:"renew_days"` // 续期天数
|
||||
StartTime string `json:"start_time"` // 开始时间
|
||||
EndTime string `json:"end_time"` // 结束时间
|
||||
CanRenew bool `json:"can_renew"` // 是否可续约
|
||||
}
|
||||
|
||||
type GetStakeLevelListResp {
|
||||
State int `json:"state"` // 状态:1表示已开启,可质押, 0表示不可质押
|
||||
Staking *StakeLevel `json:"staking,optional"` // 质押中的档位信息
|
||||
RenewLevel *StakeLevel `json:"renew_level,optional"` // 已续约的档位信息
|
||||
Levels []PointStakeLevel `json:"levels"` // 档位列表
|
||||
}
|
||||
|
||||
type StakePointReq {
|
||||
RoleID int64 `json:"role_id"` // 角色id
|
||||
LevelId int `json:"level_id"` // 档位id
|
||||
Action int `json:"action"` // 操作类型:1表示质押,2表示升级质押, 3表示续约
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user