This commit is contained in:
2026-03-02 12:57:38 +08:00
parent e8da86f1a6
commit a8b4887571
2 changed files with 40 additions and 41 deletions

View File

@@ -8,8 +8,8 @@ info (
// 功能管理接口 // 功能管理接口
@server ( @server (
prefix: /api/v1/admin/feature prefix: /api/v1/admin/feature
group: admin_feature group: admin_feature
middleware: AdminAuthInterceptor middleware: AdminAuthInterceptor
) )
service main { service main {
@@ -51,25 +51,25 @@ type (
CostPrice *float64 `json:"cost_price,optional"` // 天远API调用成本价单位 CostPrice *float64 `json:"cost_price,optional"` // 天远API调用成本价单位
} }
// 创建功能响应 // 创建功能响应
AdminCreateFeatureResp { AdminCreateFeatureResp {
Id string `json:"id"` // 功能ID Id string `json:"id"` // 功能ID
} }
// 更新功能请求 // 更新功能请求
AdminUpdateFeatureReq { AdminUpdateFeatureReq {
Id string `path:"id"` // 功能ID Id string `path:"id"` // 功能ID
ApiId *string `json:"api_id,optional"` // API标识 ApiId *string `json:"api_id,optional"` // API标识
Name *string `json:"name,optional"` // 描述 Name *string `json:"name,optional"` // 描述
WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元) WhitelistPrice *float64 `json:"whitelist_price,optional"` // 白名单屏蔽价格(单位:元)
CostPrice *float64 `json:"cost_price,optional"` // 天远API调用成本价单位 CostPrice *float64 `json:"cost_price,optional"` // 天远API调用成本价单位
} }
// 更新功能响应 // 更新功能响应
AdminUpdateFeatureResp { AdminUpdateFeatureResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
} }
// 删除功能请求 // 删除功能请求
AdminDeleteFeatureReq { AdminDeleteFeatureReq {
Id string `path:"id"` // 功能ID Id string `path:"id"` // 功能ID
} }
// 删除功能响应 // 删除功能响应
AdminDeleteFeatureResp { AdminDeleteFeatureResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
@@ -82,9 +82,9 @@ type (
Name *string `form:"name,optional"` // 描述 Name *string `form:"name,optional"` // 描述
} }
// 功能列表项 // 功能列表项
FeatureListItem { FeatureListItem {
Id string `json:"id"` // 功能ID Id string `json:"id"` // 功能ID
ApiId string `json:"api_id"` // API标识 ApiId string `json:"api_id"` // API标识
Name string `json:"name"` // 描述 Name string `json:"name"` // 描述
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元) WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
CostPrice float64 `json:"cost_price"` // 天远API调用成本价单位 CostPrice float64 `json:"cost_price"` // 天远API调用成本价单位
@@ -97,13 +97,13 @@ type (
Items []FeatureListItem `json:"items"` // 列表数据 Items []FeatureListItem `json:"items"` // 列表数据
} }
// 获取功能详情请求 // 获取功能详情请求
AdminGetFeatureDetailReq { AdminGetFeatureDetailReq {
Id string `path:"id"` // 功能ID Id string `path:"id"` // 功能ID
} }
// 获取功能详情响应 // 获取功能详情响应
AdminGetFeatureDetailResp { AdminGetFeatureDetailResp {
Id string `json:"id"` // 功能ID Id string `json:"id"` // 功能ID
ApiId string `json:"api_id"` // API标识 ApiId string `json:"api_id"` // API标识
Name string `json:"name"` // 描述 Name string `json:"name"` // 描述
WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元) WhitelistPrice float64 `json:"whitelist_price"` // 白名单屏蔽价格(单位:元)
CostPrice float64 `json:"cost_price"` // 天远API调用成本价单位 CostPrice float64 `json:"cost_price"` // 天远API调用成本价单位
@@ -111,26 +111,26 @@ type (
UpdateTime string `json:"update_time"` // 更新时间 UpdateTime string `json:"update_time"` // 更新时间
} }
// 配置功能示例数据请求 // 配置功能示例数据请求
AdminConfigFeatureExampleReq { AdminConfigFeatureExampleReq {
FeatureId string `json:"feature_id"` // 功能ID FeatureId string `json:"feature_id"` // 功能ID
Data string `json:"data"` // 示例数据JSON Data string `json:"data"` // 示例数据JSON
} }
// 配置功能示例数据响应 // 配置功能示例数据响应
AdminConfigFeatureExampleResp { AdminConfigFeatureExampleResp {
Success bool `json:"success"` // 是否成功 Success bool `json:"success"` // 是否成功
} }
// 查看功能示例数据请求 // 查看功能示例数据请求
AdminGetFeatureExampleReq { AdminGetFeatureExampleReq {
FeatureId string `path:"feature_id"` // 功能ID FeatureId string `path:"feature_id"` // 功能ID
} }
// 查看功能示例数据响应 // 查看功能示例数据响应
AdminGetFeatureExampleResp { AdminGetFeatureExampleResp {
Id string `json:"id"` // 示例数据ID Id string `json:"id"` // 示例数据ID
FeatureId string `json:"feature_id"` // 功能ID FeatureId string `json:"feature_id"` // 功能ID
ApiId string `json:"api_id"` // API标识 ApiId string `json:"api_id"` // API标识
Data string `json:"data"` // 示例数据JSON Data string `json:"data"` // 示例数据JSON
CreateTime string `json:"create_time"` // 创建时间 CreateTime string `json:"create_time"` // 创建时间
UpdateTime string `json:"update_time"` // 更新时间 UpdateTime string `json:"update_time"` // 更新时间
} }
) )

View File

@@ -3,12 +3,11 @@ package agent
import ( import (
"context" "context"
"github.com/zeromicro/go-zero/core/logx"
"qnc-server/app/main/api/internal/svc" "qnc-server/app/main/api/internal/svc"
"qnc-server/app/main/api/internal/types" "qnc-server/app/main/api/internal/types"
"qnc-server/common/xerr" "qnc-server/common/xerr"
"github.com/zeromicro/go-zero/core/logx"
"github.com/pkg/errors" "github.com/pkg/errors"
) )