104 lines
3.2 KiB
Plaintext
104 lines
3.2 KiB
Plaintext
|
|
syntax = "v1"
|
||
|
|
|
||
|
|
info (
|
||
|
|
title: "后台白名单管理服务"
|
||
|
|
desc: "后台用户模块白名单管理相关接口"
|
||
|
|
version: "v1"
|
||
|
|
)
|
||
|
|
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/admin/whitelist
|
||
|
|
group: admin_whitelist
|
||
|
|
middleware: AdminAuthInterceptor
|
||
|
|
)
|
||
|
|
service main {
|
||
|
|
// 获取白名单列表
|
||
|
|
@handler AdminGetWhitelistList
|
||
|
|
get /list (AdminGetWhitelistListReq) returns (AdminGetWhitelistListResp)
|
||
|
|
|
||
|
|
// 手动添加白名单
|
||
|
|
@handler AdminCreateWhitelist
|
||
|
|
post /create (AdminCreateWhitelistReq) returns (AdminCreateWhitelistResp)
|
||
|
|
|
||
|
|
// 批量添加白名单
|
||
|
|
@handler AdminBatchCreateWhitelist
|
||
|
|
post /batch-create (AdminBatchCreateWhitelistReq) returns (AdminBatchCreateWhitelistResp)
|
||
|
|
|
||
|
|
// 更新白名单(状态/备注金额)
|
||
|
|
@handler AdminUpdateWhitelist
|
||
|
|
put /update/:id (AdminUpdateWhitelistReq) returns (AdminUpdateWhitelistResp)
|
||
|
|
|
||
|
|
// 删除白名单(软删除)
|
||
|
|
@handler AdminDeleteWhitelist
|
||
|
|
delete /delete/:id (AdminDeleteWhitelistReq) returns (AdminDeleteWhitelistResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
type (
|
||
|
|
AdminGetWhitelistListReq {
|
||
|
|
Page int64 `form:"page"`
|
||
|
|
PageSize int64 `form:"pageSize"`
|
||
|
|
IdCard *string `form:"id_card,optional"`
|
||
|
|
FeatureApiId *string `form:"feature_api_id,optional"`
|
||
|
|
Status *int64 `form:"status,optional"`
|
||
|
|
}
|
||
|
|
AdminWhitelistListItem {
|
||
|
|
Id string `json:"id"`
|
||
|
|
IdCard string `json:"id_card"`
|
||
|
|
FeatureId string `json:"feature_id"`
|
||
|
|
FeatureApiId string `json:"feature_api_id"`
|
||
|
|
FeatureName string `json:"feature_name"`
|
||
|
|
UserId string `json:"user_id"`
|
||
|
|
Amount float64 `json:"amount"`
|
||
|
|
Status int64 `json:"status"`
|
||
|
|
StatusText string `json:"status_text"`
|
||
|
|
CreateTime string `json:"create_time"`
|
||
|
|
UpdateTime string `json:"update_time"`
|
||
|
|
}
|
||
|
|
AdminGetWhitelistListResp {
|
||
|
|
Total int64 `json:"total"`
|
||
|
|
Items []AdminWhitelistListItem `json:"items"`
|
||
|
|
}
|
||
|
|
AdminCreateWhitelistReq {
|
||
|
|
IdCard string `json:"id_card"`
|
||
|
|
FeatureId string `json:"feature_id"`
|
||
|
|
Amount *float64 `json:"amount,optional"`
|
||
|
|
Status *int64 `json:"status,optional"`
|
||
|
|
}
|
||
|
|
AdminCreateWhitelistResp {
|
||
|
|
Id string `json:"id"`
|
||
|
|
}
|
||
|
|
AdminBatchCreateWhitelistReq {
|
||
|
|
IdCard string `json:"id_card"`
|
||
|
|
FeatureIds []string `json:"feature_ids"`
|
||
|
|
Amount *float64 `json:"amount,optional"`
|
||
|
|
Status *int64 `json:"status,optional"`
|
||
|
|
}
|
||
|
|
AdminBatchCreateWhitelistResultItem {
|
||
|
|
FeatureId string `json:"feature_id"`
|
||
|
|
FeatureApiId string `json:"feature_api_id"`
|
||
|
|
FeatureName string `json:"feature_name"`
|
||
|
|
Action string `json:"action"`
|
||
|
|
Message string `json:"message,optional"`
|
||
|
|
}
|
||
|
|
AdminBatchCreateWhitelistResp {
|
||
|
|
SuccessCount int64 `json:"success_count"`
|
||
|
|
SkipCount int64 `json:"skip_count"`
|
||
|
|
FailCount int64 `json:"fail_count"`
|
||
|
|
Items []AdminBatchCreateWhitelistResultItem `json:"items"`
|
||
|
|
}
|
||
|
|
AdminUpdateWhitelistReq {
|
||
|
|
Id string `path:"id"`
|
||
|
|
Status *int64 `json:"status,optional"`
|
||
|
|
Amount *float64 `json:"amount,optional"`
|
||
|
|
}
|
||
|
|
AdminUpdateWhitelistResp {
|
||
|
|
Success bool `json:"success"`
|
||
|
|
}
|
||
|
|
AdminDeleteWhitelistReq {
|
||
|
|
Id string `path:"id"`
|
||
|
|
}
|
||
|
|
AdminDeleteWhitelistResp {
|
||
|
|
Success bool `json:"success"`
|
||
|
|
}
|
||
|
|
)
|