2024-10-02 00:57:17 +08:00
|
|
|
syntax = "console"
|
|
|
|
|
|
|
|
//---------------------------- Base ------------------------
|
|
|
|
type (
|
|
|
|
healthResp {
|
|
|
|
time string `json:"time"`
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
@server (
|
|
|
|
group: base
|
|
|
|
prefix: /api/console/base
|
|
|
|
)
|
|
|
|
service gateway-api {
|
|
|
|
@handler health
|
|
|
|
get /health returns (healthResp)
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------- Auth ------------------------
|
|
|
|
type (
|
|
|
|
LoginReq {
|
|
|
|
username string `json:"username"`
|
|
|
|
password string `json:"password"`
|
|
|
|
}
|
|
|
|
phoneLoginReq {
|
|
|
|
phone string `json:"phone"`
|
|
|
|
code string `json:"code"`
|
|
|
|
}
|
|
|
|
RegisterReq {
|
|
|
|
username string `json:"username"`
|
|
|
|
password string `json:"password"`
|
|
|
|
confirmPassword string `json:"confirmPassword"`
|
|
|
|
phone string `json:"phone"`
|
|
|
|
code string `json:"code"`
|
|
|
|
}
|
|
|
|
GetVerifyCodeReq {
|
|
|
|
phone string `json:"phone"`
|
|
|
|
actionType string `json:"actionType"`
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
@server (
|
|
|
|
group: auth
|
|
|
|
prefix: /api/console/auth
|
|
|
|
)
|
|
|
|
service gateway-api {
|
|
|
|
@handler registerUser
|
|
|
|
post /register (RegisterReq)
|
|
|
|
|
|
|
|
@handler loginUser
|
|
|
|
post /login (LoginReq)
|
|
|
|
|
|
|
|
@handler phoneLoginUser
|
|
|
|
post /phoneLogin (phoneLoginReq)
|
|
|
|
|
|
|
|
@handler getVerifyCode
|
|
|
|
post /getVerifyCode (GetVerifyCodeReq)
|
|
|
|
|
|
|
|
@handler Logout
|
|
|
|
post /logout
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------ User -----------------------------
|
|
|
|
type (
|
|
|
|
enterpriseAuthReq {
|
|
|
|
enterpriseName string `json:"enterpriseName"`
|
|
|
|
creditCode string `json:"creditCode"`
|
|
|
|
legalPerson string `json:"legalPerson"`
|
|
|
|
businessLicense string `json:"businessLicense"`
|
|
|
|
enterpriseContact string `json:"enterpriseContact"`
|
|
|
|
}
|
|
|
|
UserInfoResp {
|
2024-10-15 23:58:36 +08:00
|
|
|
username string `json:"username"`
|
|
|
|
phone string `json:"phone"`
|
|
|
|
enterpriseAuthStatus string `json:"enterpriseAuthStatus"`
|
|
|
|
enterpriseName string `json:"enterpriseName"`
|
|
|
|
creditCode string `json:"creditCode"`
|
|
|
|
legalPerson string `json:"legalPerson"`
|
|
|
|
balance float64 `json:"balance"`
|
2024-10-02 00:57:17 +08:00
|
|
|
}
|
|
|
|
UploadBusinessLicenseResp {
|
|
|
|
url string `json:"url"`
|
|
|
|
enterpriseName string `json:"enterpriseName"`
|
|
|
|
creditCode string `json:"creditCode"`
|
|
|
|
legalPerson string `json:"legalPerson"`
|
|
|
|
}
|
|
|
|
secretInfoResp {
|
|
|
|
AccessId string `json:"accessId"`
|
|
|
|
AccessKey string `json:"accessKey"`
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
@server (
|
|
|
|
group: user
|
|
|
|
prefix: /api/console/user
|
|
|
|
middleware: AuthInterceptor
|
|
|
|
)
|
|
|
|
service gateway-api {
|
|
|
|
@handler getUserInfo
|
|
|
|
get /info returns (UserInfoResp)
|
|
|
|
|
|
|
|
@handler enterpriseAuth
|
|
|
|
post /enterpriseAuth (enterpriseAuthReq)
|
|
|
|
|
|
|
|
@handler UploadBusinessLicense
|
|
|
|
post /businessLicenseUpload returns (UploadBusinessLicenseResp)
|
|
|
|
|
|
|
|
@handler GetSecretInfo
|
|
|
|
post /getSecretInfo returns (secretInfoResp)
|
|
|
|
}
|
|
|
|
|
|
|
|
type (
|
|
|
|
GetProductByIdReq {
|
|
|
|
ProductId int64 `path:"productId"`
|
|
|
|
}
|
|
|
|
GetProductByIdResp {
|
|
|
|
ProductItem
|
|
|
|
}
|
|
|
|
GetProductListReq {
|
|
|
|
Page int64 `form:"page"`
|
|
|
|
PageSize int64 `form:"pageSize"`
|
|
|
|
}
|
|
|
|
GetProductListResp {
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
List []ProductItem `json:"list"`
|
|
|
|
}
|
|
|
|
ProductItem {
|
|
|
|
ProductId int64 `json:"productId"`
|
|
|
|
ProductName string `json:"productName"`
|
|
|
|
ProductCode string `json:"productCode"`
|
|
|
|
ProductDescription string `json:"productDescription"`
|
|
|
|
ProductContent string `json:"productContent"`
|
|
|
|
ProductGroup string `json:"productGroup"`
|
|
|
|
ProductPrice float64 `json:"productPrice"`
|
|
|
|
CreatedAt string `json:"createdAt"`
|
|
|
|
UpdatedAt string `json:"updatedAt"`
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
@server (
|
|
|
|
group: product
|
|
|
|
prefix: /api/console/product
|
|
|
|
middleware: AuthInterceptor
|
|
|
|
)
|
|
|
|
service gateway-api {
|
|
|
|
@handler getProductById
|
|
|
|
get /:productId (GetProductByIdReq) returns (GetProductByIdResp)
|
|
|
|
|
|
|
|
@handler getProductList
|
|
|
|
get /list (GetProductListReq) returns (GetProductListResp)
|
|
|
|
}
|
|
|
|
|
|
|
|
type (
|
|
|
|
// 添加用户产品请求
|
|
|
|
AddUserProductReq {
|
|
|
|
ProductId int64 `json:"productId"`
|
|
|
|
}
|
|
|
|
// 删除用户产品请求
|
|
|
|
DeleteUserProductReq {
|
|
|
|
Id int64 `json:"id"`
|
|
|
|
}
|
|
|
|
// 分页查询用户产品列表请求
|
|
|
|
GetUserProductListReq {
|
|
|
|
Page int64 `form:"page"`
|
|
|
|
PageSize int64 `form:"pageSize"`
|
|
|
|
}
|
|
|
|
// 分页查询用户产品列表响应
|
|
|
|
GetUserProductListResp {
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
List []UserProductItem `json:"list"`
|
|
|
|
}
|
|
|
|
// 用户产品条目
|
|
|
|
UserProductItem {
|
|
|
|
Id int64 `json:"id"` // 用户产品ID
|
|
|
|
ProductId int64 `json:"productId"` // 产品ID
|
|
|
|
ProductName string `json:"productName"` // 产品名称
|
|
|
|
ProductCode string `json:"productCode"` // 产品编号
|
|
|
|
ProductDescription string `json:"productDescription"` // 产品简介
|
|
|
|
ProductGroup string `json:"productGroup"` // 产品分类
|
|
|
|
ProductPrice float64 `json:"productPrice"` // 产品价格
|
|
|
|
CreatedAt string `json:"createdAt"` // 创建时间
|
|
|
|
UpdatedAt string `json:"updatedAt"` // 更新时间
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
@server (
|
|
|
|
group: userProduct
|
|
|
|
prefix: /api/console/user-product
|
|
|
|
middleware: AuthInterceptor
|
|
|
|
)
|
|
|
|
service gateway-api {
|
|
|
|
@handler getUserProductList
|
|
|
|
get /userProductList (GetUserProductListReq) returns (GetUserProductListResp)
|
|
|
|
}
|
2024-10-15 00:23:07 +08:00
|
|
|
|
2024-10-02 00:57:17 +08:00
|
|
|
@server (
|
|
|
|
group: userProduct
|
|
|
|
prefix: /api/console/user-product
|
|
|
|
middleware: AuthInterceptor,EntAuthInterceptor
|
|
|
|
)
|
|
|
|
service gateway-api {
|
|
|
|
@handler addUserProduct
|
|
|
|
post /userProductAdd (AddUserProductReq)
|
|
|
|
|
|
|
|
@handler deleteUserProduct
|
|
|
|
delete /userProductDel/:id (DeleteUserProductReq)
|
|
|
|
}
|
2024-10-15 00:23:07 +08:00
|
|
|
|
2024-10-02 00:57:17 +08:00
|
|
|
type (
|
|
|
|
AddWhitelistReq {
|
|
|
|
Ip string `json:"ip"`
|
|
|
|
}
|
|
|
|
DeleteWhitelistReq {
|
|
|
|
Id int64 `json:"id"`
|
|
|
|
}
|
|
|
|
GetWhitelistListReq {
|
|
|
|
Page int64 `form:"page"`
|
|
|
|
PageSize int64 `form:"pageSize"`
|
|
|
|
}
|
|
|
|
GetWhitelistListResp {
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
List []WhitelistItem `json:"list"`
|
|
|
|
}
|
|
|
|
WhitelistItem {
|
|
|
|
Id int64 `json:"id"` // 用户产品ID
|
|
|
|
WhitelistIp string `json:"whiteIp"` // 产品名称
|
|
|
|
CreatedAt string `json:"createdAt"` // 创建时间
|
|
|
|
UpdatedAt string `json:"updatedAt"` // 更新时间
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
@server (
|
|
|
|
group: whitelistr
|
|
|
|
prefix: /api/console/whitelist
|
|
|
|
middleware: AuthInterceptor
|
|
|
|
)
|
|
|
|
service gateway-api {
|
|
|
|
@handler getWhitelistList
|
|
|
|
get /getWhitelistList (GetWhitelistListReq) returns (GetUserProductListResp)
|
|
|
|
}
|
|
|
|
|
|
|
|
@server (
|
|
|
|
group: whitelistr
|
|
|
|
prefix: /api/console/whitelist
|
|
|
|
middleware: AuthInterceptor,EntAuthInterceptor
|
|
|
|
)
|
|
|
|
service gateway-api {
|
|
|
|
@handler addWhitelist
|
|
|
|
post /addWhitelist (AddWhitelistReq)
|
|
|
|
|
|
|
|
@handler deleteWhitelist
|
|
|
|
delete /delWhitelist (DeleteWhitelistReq)
|
|
|
|
}
|
|
|
|
|
2024-10-15 00:23:07 +08:00
|
|
|
type (
|
|
|
|
AliTopUpRequest {
|
|
|
|
amount int64 `json:"amount"`
|
|
|
|
}
|
|
|
|
AliTopUpResponse {
|
|
|
|
payUrl string `json:"payUrl"`
|
|
|
|
}
|
2024-10-15 17:19:23 +08:00
|
|
|
GetTopUpListReq {
|
|
|
|
Page int64 `form:"page"`
|
|
|
|
PageSize int64 `form:"pageSize"`
|
|
|
|
}
|
|
|
|
GetTopUpListResp {
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
List []TopUpItem `json:"list"`
|
|
|
|
}
|
|
|
|
TopUpItem {
|
|
|
|
Id int64 `json:"id"` // 主键ID
|
|
|
|
UserId int64 `json:"user_id"` // 用户ID
|
|
|
|
TransactionId string `json:"transaction_id"` // 交易ID
|
|
|
|
OutTradeNo string `json:"out_trade_no"` // 外部订单号
|
|
|
|
Amount float64 `json:"amount"` // 充值金额
|
|
|
|
PaymentMethod int64 `json:"payment_method"` // 支付方式
|
|
|
|
CreatedAt string `json:"created_at"` // 创建时间
|
|
|
|
UpdatedAt string `json:"updated_at"` // 更新时间
|
|
|
|
}
|
2024-10-15 00:23:07 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
@server (
|
|
|
|
group: topup
|
2024-10-15 17:19:23 +08:00
|
|
|
prefix: /api/console/topup
|
2024-10-15 00:23:07 +08:00
|
|
|
middleware: AuthInterceptor,EntAuthInterceptor
|
|
|
|
)
|
|
|
|
service gateway-api {
|
|
|
|
@handler aliTopUp
|
|
|
|
post /aliTopUp (AliTopUpRequest) returns (AliTopUpResponse)
|
|
|
|
|
2024-10-15 17:19:23 +08:00
|
|
|
@handler topList
|
|
|
|
get /topUpList (GetTopUpListReq) returns (GetTopUpListResp)
|
|
|
|
}
|
|
|
|
|
|
|
|
@server (
|
|
|
|
group: topup
|
|
|
|
prefix: /api/console/topup
|
|
|
|
)
|
|
|
|
service gateway-api {
|
2024-10-15 00:23:07 +08:00
|
|
|
@handler aliTopUpCallback
|
|
|
|
post /aliTopUpCallback
|
|
|
|
}
|
|
|
|
|