first commit
This commit is contained in:
128
app/main/api/desc/admin/admin_feature.api
Normal file
128
app/main/api/desc/admin/admin_feature.api
Normal file
@@ -0,0 +1,128 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "后台功能管理服务"
|
||||
desc: "后台功能管理相关接口"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 功能管理接口
|
||||
@server (
|
||||
prefix: /api/v1/admin/feature
|
||||
group: admin_feature
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 创建功能
|
||||
@handler AdminCreateFeature
|
||||
post /create (AdminCreateFeatureReq) returns (AdminCreateFeatureResp)
|
||||
|
||||
// 更新功能
|
||||
@handler AdminUpdateFeature
|
||||
put /update/:id (AdminUpdateFeatureReq) returns (AdminUpdateFeatureResp)
|
||||
|
||||
// 删除功能
|
||||
@handler AdminDeleteFeature
|
||||
delete /delete/:id (AdminDeleteFeatureReq) returns (AdminDeleteFeatureResp)
|
||||
|
||||
// 获取功能列表
|
||||
@handler AdminGetFeatureList
|
||||
get /list (AdminGetFeatureListReq) returns (AdminGetFeatureListResp)
|
||||
|
||||
// 获取功能详情
|
||||
@handler AdminGetFeatureDetail
|
||||
get /detail/:id (AdminGetFeatureDetailReq) returns (AdminGetFeatureDetailResp)
|
||||
|
||||
// 配置功能示例数据
|
||||
@handler AdminConfigFeatureExample
|
||||
post /config-example (AdminConfigFeatureExampleReq) returns (AdminConfigFeatureExampleResp)
|
||||
|
||||
// 查看功能示例数据
|
||||
@handler AdminGetFeatureExample
|
||||
get /example/:feature_id (AdminGetFeatureExampleReq) returns (AdminGetFeatureExampleResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 创建功能请求
|
||||
AdminCreateFeatureReq {
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 描述
|
||||
}
|
||||
// 创建功能响应
|
||||
AdminCreateFeatureResp {
|
||||
Id int64 `json:"id"` // 功能ID
|
||||
}
|
||||
// 更新功能请求
|
||||
AdminUpdateFeatureReq {
|
||||
Id int64 `path:"id"` // 功能ID
|
||||
ApiId *string `json:"api_id,optional"` // API标识
|
||||
Name *string `json:"name,optional"` // 描述
|
||||
}
|
||||
// 更新功能响应
|
||||
AdminUpdateFeatureResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 删除功能请求
|
||||
AdminDeleteFeatureReq {
|
||||
Id int64 `path:"id"` // 功能ID
|
||||
}
|
||||
// 删除功能响应
|
||||
AdminDeleteFeatureResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 获取功能列表请求
|
||||
AdminGetFeatureListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
ApiId *string `form:"api_id,optional"` // API标识
|
||||
Name *string `form:"name,optional"` // 描述
|
||||
}
|
||||
// 功能列表项
|
||||
FeatureListItem {
|
||||
Id int64 `json:"id"` // 功能ID
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 描述
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
// 获取功能列表响应
|
||||
AdminGetFeatureListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []FeatureListItem `json:"items"` // 列表数据
|
||||
}
|
||||
// 获取功能详情请求
|
||||
AdminGetFeatureDetailReq {
|
||||
Id int64 `path:"id"` // 功能ID
|
||||
}
|
||||
// 获取功能详情响应
|
||||
AdminGetFeatureDetailResp {
|
||||
Id int64 `json:"id"` // 功能ID
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 描述
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
// 配置功能示例数据请求
|
||||
AdminConfigFeatureExampleReq {
|
||||
FeatureId int64 `json:"feature_id"` // 功能ID
|
||||
Data string `json:"data"` // 示例数据JSON
|
||||
}
|
||||
// 配置功能示例数据响应
|
||||
AdminConfigFeatureExampleResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 查看功能示例数据请求
|
||||
AdminGetFeatureExampleReq {
|
||||
FeatureId int64 `path:"feature_id"` // 功能ID
|
||||
}
|
||||
// 查看功能示例数据响应
|
||||
AdminGetFeatureExampleResp {
|
||||
Id int64 `json:"id"` // 示例数据ID
|
||||
FeatureId int64 `json:"feature_id"` // 功能ID
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Data string `json:"data"` // 示例数据JSON
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user