first commit
This commit is contained in:
441
app/main/api/desc/admin/admin_agent.api
Normal file
441
app/main/api/desc/admin/admin_agent.api
Normal file
@@ -0,0 +1,441 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "后台代理管理服务(简化版)"
|
||||
desc: "新代理系统后台管理接口 - 系统简化后移除团队、返佣、升级、提现、实名、邀请码功能"
|
||||
author: "team"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// ============================================
|
||||
// 代理管理接口(简化版)
|
||||
// ============================================
|
||||
@server (
|
||||
prefix: /api/v1/admin/agent
|
||||
group: admin_agent
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 代理分页查询(简化:移除level, team_leader_id筛选)
|
||||
@handler AdminGetAgentList
|
||||
get /list (AdminGetAgentListReq) returns (AdminGetAgentListResp)
|
||||
|
||||
// 代理审核
|
||||
@handler AdminAuditAgent
|
||||
post /audit (AdminAuditAgentReq) returns (AdminAuditAgentResp)
|
||||
|
||||
// 代理推广链接分页查询
|
||||
@handler AdminGetAgentLinkList
|
||||
get /link/list (AdminGetAgentLinkListReq) returns (AdminGetAgentLinkListResp)
|
||||
|
||||
// 代理订单分页查询
|
||||
@handler AdminGetAgentOrderList
|
||||
get /order/list (AdminGetAgentOrderListReq) returns (AdminGetAgentOrderListResp)
|
||||
|
||||
// 代理佣金分页查询
|
||||
@handler AdminGetAgentCommissionList
|
||||
get /commission/list (AdminGetAgentCommissionListReq) returns (AdminGetAgentCommissionListResp)
|
||||
|
||||
// 代理订单列表(整合订单、佣金、代理信息)
|
||||
@handler AdminGetAgentOrdersList
|
||||
get /orders/list (AdminGetAgentOrdersListReq) returns (AdminGetAgentOrdersListResp)
|
||||
|
||||
// 代理订单退款
|
||||
@handler AdminRefundAgentOrder
|
||||
post /orders/refund (AdminRefundAgentOrderReq) returns (AdminRefundAgentOrderResp)
|
||||
|
||||
// 系统配置查询(简化:移除等级、升级、返佣配置)
|
||||
@handler AdminGetAgentConfig
|
||||
get /config returns (AdminGetAgentConfigResp)
|
||||
|
||||
// 系统配置更新(简化:移除等级、升级、返佣配置)
|
||||
@handler AdminUpdateAgentConfig
|
||||
post /config/update (AdminUpdateAgentConfigReq) returns (AdminUpdateAgentConfigResp)
|
||||
|
||||
// 产品配置分页查询
|
||||
@handler AdminGetAgentProductConfigList
|
||||
get /product_config/list (AdminGetAgentProductConfigListReq) returns (AdminGetAgentProductConfigListResp)
|
||||
|
||||
// 产品配置更新
|
||||
@handler AdminUpdateAgentProductConfig
|
||||
post /product_config/update (AdminUpdateAgentProductConfigReq) returns (AdminUpdateAgentProductConfigResp)
|
||||
|
||||
// 代理提现记录分页查询
|
||||
@handler AdminGetAgentWithdrawList
|
||||
get /withdraw/list (AdminGetAgentWithdrawListReq) returns (AdminGetAgentWithdrawListResp)
|
||||
|
||||
// 代理提现审核
|
||||
@handler AdminAuditAgentWithdraw
|
||||
post /withdraw/audit (AdminAuditAgentWithdrawReq) returns (AdminAuditAgentWithdrawResp)
|
||||
|
||||
// 发送代理投诉通知短信
|
||||
@handler AdminSendAgentComplaintNotify
|
||||
post /complaint/notify (AdminSendAgentComplaintNotifyReq) returns (AdminSendAgentComplaintNotifyResp)
|
||||
|
||||
// 获取统计概览数据
|
||||
@handler AdminGetStatisticsOverview
|
||||
get /statistics/overview returns (AdminGetStatisticsOverviewResp)
|
||||
|
||||
// 获取订单趋势数据
|
||||
@handler AdminGetOrderTrends
|
||||
get /statistics/order/trends (AdminGetOrderTrendsReq) returns (AdminGetOrderTrendsResp)
|
||||
|
||||
// 获取代理注册趋势
|
||||
@handler AdminGetAgentTrends
|
||||
get /statistics/agent/trends (AdminGetAgentTrendsReq) returns (AdminGetAgentTrendsResp)
|
||||
|
||||
// 获取产品订单分布
|
||||
@handler AdminGetProductDistribution
|
||||
get /statistics/product/distribution returns (AdminGetProductDistributionResp)
|
||||
|
||||
// 获取区域代理分布
|
||||
@handler AdminGetRegionDistribution
|
||||
get /statistics/region/distribution returns (AdminGetRegionDistributionResp)
|
||||
|
||||
// 获取代理排行榜
|
||||
@handler AdminGetAgentRanking
|
||||
get /statistics/agent/ranking (AdminGetAgentRankingReq) returns (AdminGetAgentRankingResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 代理分页查询(简化)
|
||||
AdminGetAgentListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
Mobile *string `form:"mobile,optional"` // 手机号(可选)
|
||||
Region *string `form:"region,optional"` // 区域(可选)
|
||||
}
|
||||
AgentListItem {
|
||||
Id string `json:"id"` // 主键
|
||||
UserId string `json:"user_id"` // 用户ID
|
||||
Region string `json:"region"` // 区域
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
WechatId string `json:"wechat_id"` // 微信号
|
||||
AgentCode int64 `json:"agent_code"` // 代理编码
|
||||
Balance float64 `json:"balance"` // 钱包余额
|
||||
FrozenAmount float64 `json:"frozen_amount"` // 冻结余额
|
||||
TotalEarnings float64 `json:"total_earnings"` // 累计收益
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
AdminGetAgentListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentListItem `json:"items"` // 列表数据
|
||||
}
|
||||
// 代理审核
|
||||
AdminAuditAgentReq {
|
||||
AuditId int64 `json:"audit_id"` // 审核记录ID
|
||||
Status int64 `json:"status"` // 审核状态:1=通过,2=拒绝
|
||||
AuditReason string `json:"audit_reason"` // 审核原因(拒绝时必填)
|
||||
}
|
||||
AdminAuditAgentResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
// 推广链接分页查询
|
||||
AdminGetAgentLinkListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *string `form:"agent_id,optional"` // 代理ID(可选)
|
||||
ProductId *string `form:"product_id,optional"` // 产品ID(可选)
|
||||
LinkIdentifier *string `form:"link_identifier,optional"` // 推广码(可选)
|
||||
}
|
||||
AgentLinkListItem {
|
||||
Id string `json:"id"` // 主键
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
ProductId string `json:"product_id"` // 产品ID
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
SetPrice float64 `json:"set_price"` // 设定价格
|
||||
ShortLink string `json:"short_link"` // 短链链接
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
AdminGetAgentLinkListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentLinkListItem `json:"items"` // 列表数据
|
||||
}
|
||||
// 代理订单分页查询
|
||||
AdminGetAgentOrderListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *string `form:"agent_id,optional"` // 代理ID(可选)
|
||||
OrderId *string `form:"order_id,optional"` // 订单ID(可选)
|
||||
ProcessStatus *int64 `form:"process_status,optional"` // 处理状态(可选)
|
||||
}
|
||||
AgentOrderListItem {
|
||||
Id string `json:"id"` // 主键
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
OrderId string `json:"order_id"` // 订单ID
|
||||
ProductId string `json:"product_id"` // 产品ID
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
OrderAmount float64 `json:"order_amount"` // 订单金额
|
||||
SetPrice float64 `json:"set_price"` // 设定价格
|
||||
ActualBasePrice float64 `json:"actual_base_price"` // 实际底价
|
||||
PriceCost float64 `json:"price_cost"` // 提价成本
|
||||
AgentProfit float64 `json:"agent_profit"` // 代理收益
|
||||
ProcessStatus int64 `json:"process_status"` // 处理状态
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
AdminGetAgentOrderListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentOrderListItem `json:"items"` // 列表数据
|
||||
}
|
||||
// 代理佣金分页查询
|
||||
AdminGetAgentCommissionListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *string `form:"agent_id,optional"` // 代理ID(可选)
|
||||
OrderId *string `form:"order_id,optional"` // 订单ID(可选)
|
||||
Status *int64 `form:"status,optional"` // 状态(可选)
|
||||
}
|
||||
AgentCommissionListItem {
|
||||
Id string `json:"id"` // 主键
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
OrderId string `json:"order_id"` // 订单ID
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
Status int64 `json:"status"` // 状态
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
AdminGetAgentCommissionListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentCommissionListItem `json:"items"` // 列表数据
|
||||
}
|
||||
// 代理订单列表(整合订单、佣金、代理信息)
|
||||
AdminGetAgentOrdersListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
// 代理筛选
|
||||
AgentId *string `form:"agent_id,optional"` // 代理ID(可选)
|
||||
AgentMobile *string `form:"agent_mobile,optional"` // 代理手机号(可选)
|
||||
// 用户筛选
|
||||
UserMobile *string `form:"user_mobile,optional"` // 用户手机号(可选)
|
||||
// 订单筛选
|
||||
OrderNo *string `form:"order_no,optional"` // 商户订单号(可选)
|
||||
PlatformOrderId *string `form:"platform_order_id,optional"` // 支付订单号(可选)
|
||||
ProductName *string `form:"product_name,optional"` // 产品名称(可选)
|
||||
// 支付筛选
|
||||
PaymentPlatform *string `form:"payment_platform,optional"` // 支付方式(可选)
|
||||
PaymentScene *string `form:"payment_scene,optional"` // 支付平台(可选)
|
||||
// 状态筛选
|
||||
OrderStatus *string `form:"order_status,optional"` // 订单状态(可选)
|
||||
CommissionStatus *int64 `form:"commission_status,optional"` // 佣金状态(可选)
|
||||
// 时间筛选
|
||||
CreateTimeStart *string `form:"create_time_start,optional"` // 创建时间开始(可选)
|
||||
CreateTimeEnd *string `form:"create_time_end,optional"` // 创建时间结束(可选)
|
||||
PayTimeStart *string `form:"pay_time_start,optional"` // 支付时间开始(可选)
|
||||
PayTimeEnd *string `form:"pay_time_end,optional"` // 支付时间结束(可选)
|
||||
// 排序
|
||||
OrderBy *string `form:"order_by,optional"` // 排序字段(可选)
|
||||
OrderType *string `form:"order_type,optional"` // 排序方式(可选)
|
||||
}
|
||||
AgentOrdersListItem {
|
||||
Id string `json:"id"` // 主键
|
||||
OrderNo string `json:"order_no"` // 商户订单号
|
||||
PlatformOrderId string `json:"platform_order_id"` // 支付订单号
|
||||
// 代理信息
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
AgentMobile string `json:"agent_mobile"` // 代理手机号
|
||||
// 用户信息
|
||||
UserId string `json:"user_id"` // 用户ID
|
||||
UserMobile *string `json:"user_mobile"` // 用户手机号
|
||||
// 产品信息
|
||||
ProductId string `json:"product_id"` // 产品ID
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
// 金额信息
|
||||
OrderAmount float64 `json:"order_amount"` // 订单金额
|
||||
CommissionAmount float64 `json:"commission_amount"` // 佣金金额
|
||||
// 支付信息
|
||||
PaymentPlatform string `json:"payment_platform"` // 支付方式
|
||||
PaymentScene string `json:"payment_scene"` // 支付平台
|
||||
// 状态
|
||||
OrderStatus string `json:"order_status"` // 订单状态
|
||||
CommissionStatus int64 `json:"commission_status"` // 佣金状态
|
||||
// 时间
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
PayTime *string `json:"pay_time"` // 支付时间
|
||||
QueryId *string `json:"query_id"` // 查询记录ID(用于报告结果跳转)
|
||||
}
|
||||
AdminGetAgentOrdersListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentOrdersListItem `json:"items"` // 列表数据
|
||||
}
|
||||
// 代理订单退款
|
||||
AdminRefundAgentOrderReq {
|
||||
OrderId string `json:"order_id"` // 订单ID
|
||||
RefundAmount float64 `json:"refund_amount"` // 退款金额
|
||||
RefundReason string `json:"refund_reason"` // 退款原因
|
||||
}
|
||||
AdminRefundAgentOrderResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
Message string `json:"message"` // 消息
|
||||
RefundNo *string `json:"refund_no"` // 退款单号
|
||||
}
|
||||
// 系统配置查询(简化:只保留佣金冻结配置)
|
||||
AdminGetAgentConfigResp {
|
||||
CommissionFreeze CommissionFreezeConfig `json:"commission_freeze"` // 佣金冻结配置
|
||||
TaxRate float64 `json:"tax_rate"` // 税率
|
||||
}
|
||||
CommissionFreezeConfig {
|
||||
Ratio float64 `json:"ratio"` // 佣金冻结比例(例如:0.1表示10%)
|
||||
Threshold float64 `json:"threshold"` // 佣金冻结阈值(订单单价达到此金额才触发冻结,单位:元)
|
||||
Days int64 `json:"days"` // 佣金冻结解冻天数(单位:天,例如:30表示30天后解冻)
|
||||
}
|
||||
// 系统配置更新(简化)
|
||||
AdminUpdateAgentConfigReq {
|
||||
CommissionFreeze *CommissionFreezeConfig `json:"commission_freeze,optional"` // 佣金冻结配置
|
||||
TaxRate *float64 `json:"tax_rate,optional"` // 税率
|
||||
}
|
||||
AdminUpdateAgentConfigResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
// 产品配置分页查询
|
||||
AdminGetAgentProductConfigListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
ProductId *string `form:"product_id,optional"` // 产品ID(可选)
|
||||
ProductName *string `form:"product_name,optional"` // 产品名称(可选,用于搜索)
|
||||
}
|
||||
AgentProductConfigItem {
|
||||
Id string `json:"id"` // 主键
|
||||
ProductId string `json:"product_id"` // 产品ID
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
BasePrice float64 `json:"base_price"` // 基础底价
|
||||
PriceRangeMin float64 `json:"price_range_min"` // 最低定价
|
||||
PriceRangeMax float64 `json:"price_range_max"` // 最高定价
|
||||
PriceThreshold float64 `json:"price_threshold"` // 提价标准阈值
|
||||
PriceFeeRate float64 `json:"price_fee_rate"` // 提价手续费比例
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
AdminGetAgentProductConfigListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentProductConfigItem `json:"items"` // 列表数据
|
||||
}
|
||||
// 产品配置更新
|
||||
AdminUpdateAgentProductConfigReq {
|
||||
Id string `json:"id"` // 主键
|
||||
BasePrice float64 `json:"base_price"` // 基础底价
|
||||
PriceRangeMax float64 `json:"price_range_max"` // 最高定价
|
||||
PriceThreshold *float64 `json:"price_threshold,optional"` // 提价标准阈值(可选)
|
||||
PriceFeeRate *float64 `json:"price_fee_rate,optional"` // 提价手续费比例(可选)
|
||||
}
|
||||
AdminUpdateAgentProductConfigResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
// ============================================
|
||||
// 代理提现相关
|
||||
// ============================================
|
||||
// 代理提现记录分页查询
|
||||
AdminGetAgentWithdrawListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *string `form:"agent_id,optional"` // 代理ID(可选)
|
||||
Status *int64 `form:"status,optional"` // 状态(可选):0=待审核,1=已通过,2=已拒绝
|
||||
}
|
||||
AgentWithdrawListItem {
|
||||
Id string `json:"id"` // 主键
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
AgentMobile string `json:"agent_mobile"` // 代理手机号
|
||||
AgentCode int64 `json:"agent_code"` // 代理编码
|
||||
WithdrawAmount float64 `json:"withdraw_amount"` // 提现金额
|
||||
TaxAmount float64 `json:"tax_amount"` // 税费金额
|
||||
ActualAmount float64 `json:"actual_amount"` // 实际到账金额(税后)
|
||||
FrozenAmount float64 `json:"frozen_amount"` // 冻结金额
|
||||
AccountName string `json:"account_name"` // 收款人姓名
|
||||
BankCardNumber string `json:"bank_card_number"` // 银行卡号(脱敏)
|
||||
BankCardNumberFull string `json:"bank_card_number_full"` // 银行卡号(完整,用于审核)
|
||||
BankBranch string `json:"bank_branch"` // 开户支行
|
||||
Status int64 `json:"status"` // 状态:0=待审核,1=已通过,2=已拒绝
|
||||
AuditUserId string `json:"audit_user_id"` // 审核人ID
|
||||
AuditTime string `json:"audit_time"` // 审核时间
|
||||
AuditRemark string `json:"audit_remark"` // 审核备注
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
AdminGetAgentWithdrawListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentWithdrawListItem `json:"items"` // 列表数据
|
||||
}
|
||||
// 代理提现审核
|
||||
AdminAuditAgentWithdrawReq {
|
||||
WithdrawId string `json:"withdraw_id"` // 提现记录ID
|
||||
Status int64 `json:"status"` // 审核状态:1=通过,2=拒绝
|
||||
AuditRemark string `json:"audit_reason,optional"` // 审核原因(拒绝时必填)
|
||||
}
|
||||
AdminAuditAgentWithdrawResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
Message string `json:"message"` // 消息
|
||||
}
|
||||
// 发送代理投诉通知短信请求
|
||||
AdminSendAgentComplaintNotifyReq {
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
UserName string `json:"user_name"` // 投诉用户姓名
|
||||
}
|
||||
// 发送代理投诉通知短信响应
|
||||
AdminSendAgentComplaintNotifyResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
Message string `json:"message"` // 消息
|
||||
}
|
||||
// ============================================
|
||||
// 统计分析相关类型
|
||||
// ============================================
|
||||
// 统计概览响应
|
||||
AdminGetStatisticsOverviewResp {
|
||||
TotalAgents int64 `json:"total_agents"` // 代理总数
|
||||
TodayNewAgents int64 `json:"today_new_agents"` // 今日新增代理
|
||||
TotalOrders int64 `json:"total_orders"` // 总订单数
|
||||
TodayOrders int64 `json:"today_orders"` // 今日订单数
|
||||
TotalOrderAmount float64 `json:"total_order_amount"` // 总订单金额
|
||||
TodayOrderAmount float64 `json:"today_order_amount"` // 今日订单金额
|
||||
TotalCommission float64 `json:"total_commission"` // 总佣金支出
|
||||
TodayCommission float64 `json:"today_commission"` // 今日佣金支出
|
||||
PendingWithdraw float64 `json:"pending_withdraw"` // 待审核提现金额
|
||||
MonthOrderAmount float64 `json:"month_order_amount"` // 本月订单金额
|
||||
MonthCommission float64 `json:"month_commission"` // 本月佣金支出
|
||||
}
|
||||
// 订单趋势请求
|
||||
AdminGetOrderTrendsReq {
|
||||
StartDate string `form:"start_date,optional"` // 开始日期 YYYY-MM-DD
|
||||
EndDate string `form:"end_date,optional"` // 结束日期 YYYY-MM-DD
|
||||
}
|
||||
// 订单趋势响应
|
||||
AdminGetOrderTrendsResp {
|
||||
Dates []string `json:"dates"` // 日期列表
|
||||
Amounts []float64 `json:"amounts"` // 金额列表
|
||||
Counts []int64 `json:"counts"` // 订单数列表
|
||||
}
|
||||
// 代理注册趋势请求
|
||||
AdminGetAgentTrendsReq {
|
||||
StartDate string `form:"start_date,optional"` // 开始日期 YYYY-MM-DD
|
||||
EndDate string `form:"end_date,optional"` // 结束日期 YYYY-MM-DD
|
||||
}
|
||||
// 代理注册趋势响应
|
||||
AdminGetAgentTrendsResp {
|
||||
Dates []string `json:"dates"` // 日期列表
|
||||
Counts []int64 `json:"counts"` // 新增代理数列表
|
||||
}
|
||||
// 产品订单分布响应
|
||||
AdminGetProductDistributionResp {
|
||||
Products []string `json:"products"` // 产品名称列表
|
||||
Counts []int64 `json:"counts"` // 订单数量列表
|
||||
Amounts []float64 `json:"amounts"` // 订单金额列表
|
||||
}
|
||||
// 区域代理分布响应
|
||||
AdminGetRegionDistributionResp {
|
||||
Regions []string `json:"regions"` // 区域名称列表
|
||||
Counts []int64 `json:"counts"` // 代理数量列表
|
||||
}
|
||||
// 代理排行榜请求
|
||||
AdminGetAgentRankingReq {
|
||||
Type string `form:"type"` // 排行类型: commission=佣金排行, orders=订单量排行
|
||||
Limit int64 `form:"limit,optional"` // 返回数量,默认10
|
||||
}
|
||||
// 代理排行榜响应
|
||||
AdminGetAgentRankingResp {
|
||||
Items []AgentRankingItem `json:"items"` // 排行榜列表
|
||||
}
|
||||
// 代理排行榜项
|
||||
AgentRankingItem {
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
AgentMobile string `json:"agent_mobile"` // 代理手机号
|
||||
Region string `json:"region"` // 区域
|
||||
Value float64 `json:"value"` // 值(佣金或订单数)
|
||||
}
|
||||
)
|
||||
|
||||
131
app/main/api/desc/admin/admin_api.api
Normal file
131
app/main/api/desc/admin/admin_api.api
Normal file
@@ -0,0 +1,131 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Admin API管理"
|
||||
desc: "管理员API管理接口"
|
||||
author: "team"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
type (
|
||||
// API列表请求
|
||||
AdminGetApiListReq {
|
||||
Page int64 `form:"page,default=1"`
|
||||
PageSize int64 `form:"page_size,default=20"`
|
||||
ApiName string `form:"api_name,optional"`
|
||||
Method string `form:"method,optional"`
|
||||
Status int64 `form:"status,optional"`
|
||||
}
|
||||
|
||||
// API列表响应
|
||||
AdminGetApiListResp {
|
||||
Items []AdminApiInfo `json:"items"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
// API信息
|
||||
AdminApiInfo {
|
||||
Id string `json:"id"`
|
||||
ApiName string `json:"api_name"`
|
||||
ApiCode string `json:"api_code"`
|
||||
Method string `json:"method"`
|
||||
Url string `json:"url"`
|
||||
Status int64 `json:"status"`
|
||||
Description string `json:"description"`
|
||||
CreateTime string `json:"create_time"`
|
||||
UpdateTime string `json:"update_time"`
|
||||
}
|
||||
|
||||
// API详情请求
|
||||
AdminGetApiDetailReq {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
|
||||
// API详情响应
|
||||
AdminGetApiDetailResp {
|
||||
AdminApiInfo
|
||||
}
|
||||
|
||||
// 创建API请求
|
||||
AdminCreateApiReq {
|
||||
ApiName string `json:"api_name"`
|
||||
ApiCode string `json:"api_code"`
|
||||
Method string `json:"method"`
|
||||
Url string `json:"url"`
|
||||
Status int64 `json:"status,default=1"`
|
||||
Description string `json:"description,optional"`
|
||||
}
|
||||
|
||||
// 创建API响应
|
||||
AdminCreateApiResp {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
// 更新API请求
|
||||
AdminUpdateApiReq {
|
||||
Id string `path:"id"`
|
||||
ApiName string `json:"api_name"`
|
||||
ApiCode string `json:"api_code"`
|
||||
Method string `json:"method"`
|
||||
Url string `json:"url"`
|
||||
Status int64 `json:"status"`
|
||||
Description string `json:"description,optional"`
|
||||
}
|
||||
|
||||
// 更新API响应
|
||||
AdminUpdateApiResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 删除API请求
|
||||
AdminDeleteApiReq {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
|
||||
// 删除API响应
|
||||
AdminDeleteApiResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 批量更新API状态请求
|
||||
AdminBatchUpdateApiStatusReq {
|
||||
Ids []string `json:"ids"`
|
||||
Status int64 `json:"status"`
|
||||
}
|
||||
|
||||
// 批量更新API状态响应
|
||||
AdminBatchUpdateApiStatusResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: admin_api
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 获取API列表
|
||||
@handler AdminGetApiList
|
||||
get /admin/api/list (AdminGetApiListReq) returns (AdminGetApiListResp)
|
||||
|
||||
// 获取API详情
|
||||
@handler AdminGetApiDetail
|
||||
get /admin/api/detail/:id (AdminGetApiDetailReq) returns (AdminGetApiDetailResp)
|
||||
|
||||
// 创建API
|
||||
@handler AdminCreateApi
|
||||
post /admin/api/create (AdminCreateApiReq) returns (AdminCreateApiResp)
|
||||
|
||||
// 更新API
|
||||
@handler AdminUpdateApi
|
||||
put /admin/api/update/:id (AdminUpdateApiReq) returns (AdminUpdateApiResp)
|
||||
|
||||
// 删除API
|
||||
@handler AdminDeleteApi
|
||||
delete /admin/api/delete/:id (AdminDeleteApiReq) returns (AdminDeleteApiResp)
|
||||
|
||||
// 批量更新API状态
|
||||
@handler AdminBatchUpdateApiStatus
|
||||
put /admin/api/batch-update-status (AdminBatchUpdateApiStatusReq) returns (AdminBatchUpdateApiStatusResp)
|
||||
}
|
||||
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 string `json:"id"` // 功能ID
|
||||
}
|
||||
// 更新功能请求
|
||||
AdminUpdateFeatureReq {
|
||||
Id string `path:"id"` // 功能ID
|
||||
ApiId *string `json:"api_id,optional"` // API标识
|
||||
Name *string `json:"name,optional"` // 描述
|
||||
}
|
||||
// 更新功能响应
|
||||
AdminUpdateFeatureResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 删除功能请求
|
||||
AdminDeleteFeatureReq {
|
||||
Id string `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 string `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 string `path:"id"` // 功能ID
|
||||
}
|
||||
// 获取功能详情响应
|
||||
AdminGetFeatureDetailResp {
|
||||
Id string `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 string `json:"feature_id"` // 功能ID
|
||||
Data string `json:"data"` // 示例数据JSON
|
||||
}
|
||||
// 配置功能示例数据响应
|
||||
AdminConfigFeatureExampleResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 查看功能示例数据请求
|
||||
AdminGetFeatureExampleReq {
|
||||
FeatureId string `path:"feature_id"` // 功能ID
|
||||
}
|
||||
// 查看功能示例数据响应
|
||||
AdminGetFeatureExampleResp {
|
||||
Id string `json:"id"` // 示例数据ID
|
||||
FeatureId string `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"` // 更新时间
|
||||
}
|
||||
)
|
||||
|
||||
174
app/main/api/desc/admin/admin_product.api
Normal file
174
app/main/api/desc/admin/admin_product.api
Normal file
@@ -0,0 +1,174 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "后台产品管理服务"
|
||||
desc: "后台产品管理相关接口"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 产品管理接口
|
||||
@server(
|
||||
prefix: /api/v1/admin/product
|
||||
group: admin_product
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 创建产品
|
||||
@handler AdminCreateProduct
|
||||
post /create (AdminCreateProductReq) returns (AdminCreateProductResp)
|
||||
|
||||
// 更新产品
|
||||
@handler AdminUpdateProduct
|
||||
put /update/:id (AdminUpdateProductReq) returns (AdminUpdateProductResp)
|
||||
|
||||
// 删除产品
|
||||
@handler AdminDeleteProduct
|
||||
delete /delete/:id (AdminDeleteProductReq) returns (AdminDeleteProductResp)
|
||||
|
||||
// 获取产品列表
|
||||
@handler AdminGetProductList
|
||||
get /list (AdminGetProductListReq) returns (AdminGetProductListResp)
|
||||
|
||||
// 获取产品详情
|
||||
@handler AdminGetProductDetail
|
||||
get /detail/:id (AdminGetProductDetailReq) returns (AdminGetProductDetailResp)
|
||||
|
||||
// 获取产品功能列表
|
||||
@handler AdminGetProductFeatureList
|
||||
get /feature/list/:product_id (AdminGetProductFeatureListReq) returns ([]AdminGetProductFeatureListResp)
|
||||
|
||||
// 更新产品功能关联(批量)
|
||||
@handler AdminUpdateProductFeatures
|
||||
put /feature/update/:product_id (AdminUpdateProductFeaturesReq) returns (AdminUpdateProductFeaturesResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 创建产品请求
|
||||
AdminCreateProductReq {
|
||||
ProductName string `json:"product_name"` // 服务名
|
||||
ProductEn string `json:"product_en"` // 英文名
|
||||
Description string `json:"description"` // 描述
|
||||
Notes string `json:"notes,optional"` // 备注
|
||||
CostPrice float64 `json:"cost_price"` // 成本
|
||||
SellPrice float64 `json:"sell_price"` // 售价
|
||||
}
|
||||
|
||||
// 创建产品响应
|
||||
AdminCreateProductResp {
|
||||
Id string `json:"id"` // 产品ID
|
||||
}
|
||||
|
||||
// 更新产品请求
|
||||
AdminUpdateProductReq {
|
||||
Id string `path:"id"` // 产品ID
|
||||
ProductName *string `json:"product_name,optional"` // 服务名
|
||||
ProductEn *string `json:"product_en,optional"` // 英文名
|
||||
Description *string `json:"description,optional"` // 描述
|
||||
Notes *string `json:"notes,optional"` // 备注
|
||||
CostPrice *float64 `json:"cost_price,optional"` // 成本
|
||||
SellPrice *float64 `json:"sell_price,optional"` // 售价
|
||||
}
|
||||
|
||||
// 更新产品响应
|
||||
AdminUpdateProductResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除产品请求
|
||||
AdminDeleteProductReq {
|
||||
Id string `path:"id"` // 产品ID
|
||||
}
|
||||
|
||||
// 删除产品响应
|
||||
AdminDeleteProductResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 获取产品列表请求
|
||||
AdminGetProductListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
ProductName *string `form:"product_name,optional"` // 服务名
|
||||
ProductEn *string `form:"product_en,optional"` // 英文名
|
||||
}
|
||||
|
||||
// 产品列表项
|
||||
ProductListItem {
|
||||
Id string `json:"id"` // 产品ID
|
||||
ProductName string `json:"product_name"` // 服务名
|
||||
ProductEn string `json:"product_en"` // 英文名
|
||||
Description string `json:"description"` // 描述
|
||||
Notes string `json:"notes"` // 备注
|
||||
CostPrice float64 `json:"cost_price"` // 成本
|
||||
SellPrice float64 `json:"sell_price"` // 售价
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
// 获取产品列表响应
|
||||
AdminGetProductListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []ProductListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 获取产品详情请求
|
||||
AdminGetProductDetailReq {
|
||||
Id string `path:"id"` // 产品ID
|
||||
}
|
||||
|
||||
// 获取产品详情响应
|
||||
AdminGetProductDetailResp {
|
||||
Id string `json:"id"` // 产品ID
|
||||
ProductName string `json:"product_name"` // 服务名
|
||||
ProductEn string `json:"product_en"` // 英文名
|
||||
Description string `json:"description"` // 描述
|
||||
Notes string `json:"notes"` // 备注
|
||||
CostPrice float64 `json:"cost_price"` // 成本
|
||||
SellPrice float64 `json:"sell_price"` // 售价
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
// 获取产品功能列表请求
|
||||
AdminGetProductFeatureListReq {
|
||||
ProductId string `path:"product_id"` // 产品ID
|
||||
}
|
||||
|
||||
// 获取产品功能列表响应Item
|
||||
AdminGetProductFeatureListResp {
|
||||
Id string `json:"id"` // 关联ID
|
||||
ProductId string `json:"product_id"` // 产品ID
|
||||
FeatureId string `json:"feature_id"` // 功能ID
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 功能描述
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
Enable int64 `json:"enable"` // 是否启用
|
||||
IsImportant int64 `json:"is_important"` // 是否重要
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
// // 获取产品功能列表响应
|
||||
// AdminGetProductFeatureListResp {
|
||||
// Items []ProductFeatureListItem `json:"items"` // 列表数据
|
||||
// }
|
||||
|
||||
// 产品功能关联项
|
||||
ProductFeatureItem {
|
||||
FeatureId string `json:"feature_id"` // 功能ID
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
Enable int64 `json:"enable"` // 是否启用
|
||||
IsImportant int64 `json:"is_important"` // 是否重要
|
||||
}
|
||||
|
||||
// 更新产品功能关联请求(批量)
|
||||
AdminUpdateProductFeaturesReq {
|
||||
ProductId string `path:"product_id"` // 产品ID
|
||||
Features []ProductFeatureItem `json:"features"` // 功能列表
|
||||
}
|
||||
|
||||
// 更新产品功能关联响应
|
||||
AdminUpdateProductFeaturesResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
133
app/main/api/desc/admin/admin_query.api
Normal file
133
app/main/api/desc/admin/admin_query.api
Normal file
@@ -0,0 +1,133 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "查询服务"
|
||||
desc: "查询服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/query
|
||||
group: admin_query
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取查询详情"
|
||||
@handler AdminGetQueryDetailByOrderId
|
||||
get /detail/:order_id (AdminGetQueryDetailByOrderIdReq) returns (AdminGetQueryDetailByOrderIdResp)
|
||||
|
||||
@doc "获取清理日志列表"
|
||||
@handler AdminGetQueryCleanupLogList
|
||||
get /cleanup/logs (AdminGetQueryCleanupLogListReq) returns (AdminGetQueryCleanupLogListResp)
|
||||
|
||||
@doc "获取清理详情列表"
|
||||
@handler AdminGetQueryCleanupDetailList
|
||||
get /cleanup/details/:log_id (AdminGetQueryCleanupDetailListReq) returns (AdminGetQueryCleanupDetailListResp)
|
||||
|
||||
@doc "获取清理配置列表"
|
||||
@handler AdminGetQueryCleanupConfigList
|
||||
get /cleanup/configs (AdminGetQueryCleanupConfigListReq) returns (AdminGetQueryCleanupConfigListResp)
|
||||
|
||||
@doc "更新清理配置"
|
||||
@handler AdminUpdateQueryCleanupConfig
|
||||
put /cleanup/config (AdminUpdateQueryCleanupConfigReq) returns (AdminUpdateQueryCleanupConfigResp)
|
||||
}
|
||||
|
||||
type AdminGetQueryDetailByOrderIdReq {
|
||||
OrderId string `path:"order_id"`
|
||||
}
|
||||
|
||||
type AdminGetQueryDetailByOrderIdResp {
|
||||
Id string `json:"id"` // 主键ID
|
||||
OrderId string `json:"order_id"` // 订单ID
|
||||
UserId string `json:"user_id"` // 用户ID
|
||||
ProductName string `json:"product_name"` // 产品ID
|
||||
QueryParams map[string]interface{} `json:"query_params"`
|
||||
QueryData []AdminQueryItem `json:"query_data"`
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
QueryState string `json:"query_state"` // 查询状态
|
||||
}
|
||||
|
||||
type AdminQueryItem {
|
||||
Feature interface{} `json:"feature"`
|
||||
Data interface{} `json:"data"` // 这里可以是 map 或 具体的 struct
|
||||
}
|
||||
|
||||
// 清理日志相关请求响应定义
|
||||
type AdminGetQueryCleanupLogListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"page_size,default=20"` // 每页数量
|
||||
Status int64 `form:"status,optional"` // 状态:1-成功,2-失败
|
||||
StartTime string `form:"start_time,optional"` // 开始时间
|
||||
EndTime string `form:"end_time,optional"` // 结束时间
|
||||
}
|
||||
|
||||
type AdminGetQueryCleanupLogListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []QueryCleanupLogItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
type QueryCleanupLogItem {
|
||||
Id string `json:"id"` // 主键ID
|
||||
CleanupTime string `json:"cleanup_time"` // 清理时间
|
||||
CleanupBefore string `json:"cleanup_before"` // 清理截止时间
|
||||
Status int64 `json:"status"` // 状态:1-成功,2-失败
|
||||
AffectedRows int64 `json:"affected_rows"` // 影响行数
|
||||
ErrorMsg string `json:"error_msg"` // 错误信息
|
||||
Remark string `json:"remark"` // 备注
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 清理详情相关请求响应定义
|
||||
type AdminGetQueryCleanupDetailListReq {
|
||||
LogId string `path:"log_id"` // 清理日志ID
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"page_size,default=20"` // 每页数量
|
||||
}
|
||||
|
||||
type AdminGetQueryCleanupDetailListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []QueryCleanupDetailItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
type QueryCleanupDetailItem {
|
||||
Id string `json:"id"` // 主键ID
|
||||
CleanupLogId string `json:"cleanup_log_id"` // 清理日志ID
|
||||
QueryId string `json:"query_id"` // 查询ID
|
||||
OrderId string `json:"order_id"` // 订单ID
|
||||
UserId string `json:"user_id"` // 用户ID
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
QueryState string `json:"query_state"` // 查询状态
|
||||
CreateTimeOld string `json:"create_time_old"` // 原创建时间
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 清理配置相关请求响应定义
|
||||
type AdminGetQueryCleanupConfigListReq {
|
||||
Status int64 `form:"status,optional"` // 状态:1-启用,0-禁用
|
||||
}
|
||||
|
||||
type AdminGetQueryCleanupConfigListResp {
|
||||
Items []QueryCleanupConfigItem `json:"items"` // 配置列表
|
||||
}
|
||||
|
||||
type QueryCleanupConfigItem {
|
||||
Id string `json:"id"` // 主键ID
|
||||
ConfigKey string `json:"config_key"` // 配置键
|
||||
ConfigValue string `json:"config_value"` // 配置值
|
||||
ConfigDesc string `json:"config_desc"` // 配置描述
|
||||
Status int64 `json:"status"` // 状态:1-启用,0-禁用
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
type AdminUpdateQueryCleanupConfigReq {
|
||||
Id string `json:"id"` // 主键ID
|
||||
ConfigValue string `json:"config_value"` // 配置值
|
||||
Status int64 `json:"status"` // 状态:1-启用,0-禁用
|
||||
}
|
||||
|
||||
type AdminUpdateQueryCleanupConfigResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
103
app/main/api/desc/admin/admin_role_api.api
Normal file
103
app/main/api/desc/admin/admin_role_api.api
Normal file
@@ -0,0 +1,103 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Admin 角色API权限管理"
|
||||
desc: "管理员角色API权限管理接口"
|
||||
author: "team"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
type (
|
||||
// 获取角色API权限列表请求
|
||||
AdminGetRoleApiListReq {
|
||||
RoleId string `path:"role_id"`
|
||||
}
|
||||
|
||||
// 获取角色API权限列表响应
|
||||
AdminGetRoleApiListResp {
|
||||
Items []AdminRoleApiInfo `json:"items"`
|
||||
}
|
||||
|
||||
// 角色API权限信息
|
||||
AdminRoleApiInfo {
|
||||
Id string `json:"id"`
|
||||
RoleId string `json:"role_id"`
|
||||
ApiId string `json:"api_id"`
|
||||
ApiName string `json:"api_name"`
|
||||
ApiCode string `json:"api_code"`
|
||||
Method string `json:"method"`
|
||||
Url string `json:"url"`
|
||||
Status int64 `json:"status"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
// 分配角色API权限请求
|
||||
AdminAssignRoleApiReq {
|
||||
RoleId string `json:"role_id"`
|
||||
ApiIds []string `json:"api_ids"`
|
||||
}
|
||||
|
||||
// 分配角色API权限响应
|
||||
AdminAssignRoleApiResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 移除角色API权限请求
|
||||
AdminRemoveRoleApiReq {
|
||||
RoleId string `json:"role_id"`
|
||||
ApiIds []string `json:"api_ids"`
|
||||
}
|
||||
|
||||
// 移除角色API权限响应
|
||||
AdminRemoveRoleApiResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 更新角色API权限请求
|
||||
AdminUpdateRoleApiReq {
|
||||
RoleId string `json:"role_id"`
|
||||
ApiIds []string `json:"api_ids"`
|
||||
}
|
||||
|
||||
// 更新角色API权限响应
|
||||
AdminUpdateRoleApiResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 获取所有API列表(用于权限分配)
|
||||
AdminGetAllApiListReq {
|
||||
Status int64 `form:"status,optional,default=1"`
|
||||
}
|
||||
|
||||
// 获取所有API列表响应
|
||||
AdminGetAllApiListResp {
|
||||
Items []AdminRoleApiInfo `json:"items"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: admin_role_api
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 获取角色API权限列表
|
||||
@handler AdminGetRoleApiList
|
||||
get /admin/role/:role_id/api/list (AdminGetRoleApiListReq) returns (AdminGetRoleApiListResp)
|
||||
|
||||
// 分配角色API权限
|
||||
@handler AdminAssignRoleApi
|
||||
post /admin/role/api/assign (AdminAssignRoleApiReq) returns (AdminAssignRoleApiResp)
|
||||
|
||||
// 移除角色API权限
|
||||
@handler AdminRemoveRoleApi
|
||||
post /admin/role/api/remove (AdminRemoveRoleApiReq) returns (AdminRemoveRoleApiResp)
|
||||
|
||||
// 更新角色API权限
|
||||
@handler AdminUpdateRoleApi
|
||||
put /admin/role/api/update (AdminUpdateRoleApiReq) returns (AdminUpdateRoleApiResp)
|
||||
|
||||
// 获取所有API列表(用于权限分配)
|
||||
@handler AdminGetAllApiList
|
||||
get /admin/api/all (AdminGetAllApiListReq) returns (AdminGetAllApiListResp)
|
||||
}
|
||||
144
app/main/api/desc/admin/admin_user.api
Normal file
144
app/main/api/desc/admin/admin_user.api
Normal file
@@ -0,0 +1,144 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "后台用户中心服务"
|
||||
desc: "后台用户中心服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/user
|
||||
group: admin_user
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取用户列表"
|
||||
@handler AdminGetUserList
|
||||
get /list (AdminGetUserListReq) returns (AdminGetUserListResp)
|
||||
|
||||
@doc "获取用户详情"
|
||||
@handler AdminGetUserDetail
|
||||
get /detail/:id (AdminGetUserDetailReq) returns (AdminGetUserDetailResp)
|
||||
|
||||
@doc "创建用户"
|
||||
@handler AdminCreateUser
|
||||
post /create (AdminCreateUserReq) returns (AdminCreateUserResp)
|
||||
|
||||
@doc "更新用户"
|
||||
@handler AdminUpdateUser
|
||||
put /update/:id (AdminUpdateUserReq) returns (AdminUpdateUserResp)
|
||||
|
||||
@doc "删除用户"
|
||||
@handler AdminDeleteUser
|
||||
delete /delete/:id (AdminDeleteUserReq) returns (AdminDeleteUserResp)
|
||||
|
||||
@doc "用户信息"
|
||||
@handler AdminUserInfo
|
||||
get /info (AdminUserInfoReq) returns (AdminUserInfoResp)
|
||||
|
||||
@doc "重置管理员密码"
|
||||
@handler AdminResetPassword
|
||||
put /reset-password/:id (AdminResetPasswordReq) returns (AdminResetPasswordResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
AdminGetUserListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
Username string `form:"username,optional"` // 用户名
|
||||
RealName string `form:"real_name,optional"` // 真实姓名
|
||||
Status int64 `form:"status,optional,default=-1"` // 状态:0-禁用,1-启用
|
||||
}
|
||||
|
||||
// 列表响应
|
||||
AdminGetUserListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AdminUserListItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
// 列表项
|
||||
AdminUserListItem {
|
||||
Id string `json:"id"` // 用户ID
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
RoleIds []string `json:"role_ids"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
AdminGetUserDetailReq {
|
||||
Id string `path:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
AdminGetUserDetailResp {
|
||||
Id string `json:"id"` // 用户ID
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
RoleIds []string `json:"role_ids"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
AdminCreateUserReq {
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Status int64 `json:"status,default=1"` // 状态:0-禁用,1-启用
|
||||
RoleIds []string `json:"role_ids"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
AdminCreateUserResp {
|
||||
Id string `json:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
AdminUpdateUserReq {
|
||||
Id string `path:"id"` // 用户ID
|
||||
Username *string `json:"username,optional"` // 用户名
|
||||
RealName *string `json:"real_name,optional"` // 真实姓名
|
||||
Status *int64 `json:"status,optional"` // 状态:0-禁用,1-启用
|
||||
RoleIds []string `json:"role_ids,optional"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
AdminUpdateUserResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
AdminDeleteUserReq {
|
||||
Id string `path:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
AdminDeleteUserResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 用户信息请求
|
||||
AdminUserInfoReq {
|
||||
}
|
||||
|
||||
// 用户信息响应
|
||||
AdminUserInfoResp {
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Roles []string `json:"roles"` // 角色编码列表
|
||||
}
|
||||
|
||||
// 重置密码请求
|
||||
AdminResetPasswordReq {
|
||||
Id string `path:"id"` // 用户ID
|
||||
Password string `json:"password"` // 新密码
|
||||
}
|
||||
|
||||
// 重置密码响应
|
||||
AdminResetPasswordResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
32
app/main/api/desc/admin/auth.api
Normal file
32
app/main/api/desc/admin/auth.api
Normal file
@@ -0,0 +1,32 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "认证中心服务"
|
||||
desc: "认证中心服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/auth
|
||||
group: admin_auth
|
||||
)
|
||||
service main {
|
||||
@doc "登录"
|
||||
@handler AdminLogin
|
||||
post /login (AdminLoginReq) returns (AdminLoginResp)
|
||||
|
||||
}
|
||||
|
||||
type (
|
||||
AdminLoginReq {
|
||||
Username string `json:"username" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Captcha bool `json:"captcha" validate:"required"`
|
||||
}
|
||||
AdminLoginResp {
|
||||
AccessToken string `json:"access_token"`
|
||||
AccessExpire int64 `json:"access_expire"`
|
||||
RefreshAfter int64 `json:"refresh_after"`
|
||||
Roles []string `json:"roles"`
|
||||
}
|
||||
)
|
||||
136
app/main/api/desc/admin/menu.api
Normal file
136
app/main/api/desc/admin/menu.api
Normal file
@@ -0,0 +1,136 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "菜单中心服务"
|
||||
desc: "菜单中心服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/menu
|
||||
group: admin_menu
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取菜单列表"
|
||||
@handler GetMenuList
|
||||
get /list (GetMenuListReq) returns ([]MenuListItem)
|
||||
|
||||
@doc "获取菜单详情"
|
||||
@handler GetMenuDetail
|
||||
get /detail/:id (GetMenuDetailReq) returns (GetMenuDetailResp)
|
||||
|
||||
@doc "创建菜单"
|
||||
@handler CreateMenu
|
||||
post /create (CreateMenuReq) returns (CreateMenuResp)
|
||||
|
||||
@doc "更新菜单"
|
||||
@handler UpdateMenu
|
||||
put /update/:id (UpdateMenuReq) returns (UpdateMenuResp)
|
||||
|
||||
@doc "删除菜单"
|
||||
@handler DeleteMenu
|
||||
delete /delete/:id (DeleteMenuReq) returns (DeleteMenuResp)
|
||||
|
||||
@doc "获取所有菜单(树形结构)"
|
||||
@handler GetMenuAll
|
||||
get /all (GetMenuAllReq) returns ([]GetMenuAllResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
GetMenuListReq {
|
||||
Name string `form:"name,optional"` // 菜单名称
|
||||
Path string `form:"path,optional"` // 路由路径
|
||||
Status int64 `form:"status,optional,default=-1"` // 状态:0-禁用,1-启用
|
||||
Type string `form:"type,optional"` // 类型
|
||||
}
|
||||
// 列表项
|
||||
MenuListItem {
|
||||
Id string `json:"id"` // 菜单ID
|
||||
Pid string `json:"pid"` // 父菜单ID
|
||||
Name string `json:"name"` // 路由名称
|
||||
Path string `json:"path"` // 路由路径
|
||||
Component string `json:"component"` // 组件路径
|
||||
Redirect string `json:"redirect"` // 重定向路径
|
||||
Meta map[string]interface{} `json:"meta"` // 路由元数据
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
Type string `json:"type"` // 类型
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
CreateTime string `json:"createTime"` // 创建时间
|
||||
Children []MenuListItem `json:"children"` // 子菜单
|
||||
}
|
||||
// 详情请求
|
||||
GetMenuDetailReq {
|
||||
Id string `path:"id"` // 菜单ID
|
||||
}
|
||||
// 详情响应
|
||||
GetMenuDetailResp {
|
||||
Id string `json:"id"` // 菜单ID
|
||||
Pid string `json:"pid"` // 父菜单ID
|
||||
Name string `json:"name"` // 路由名称
|
||||
Path string `json:"path"` // 路由路径
|
||||
Component string `json:"component"` // 组件路径
|
||||
Redirect string `json:"redirect"` // 重定向路径
|
||||
Meta map[string]interface{} `json:"meta"` // 路由元数据
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
Type string `json:"type"` // 类型
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
CreateTime string `json:"createTime"` // 创建时间
|
||||
UpdateTime string `json:"updateTime"` // 更新时间
|
||||
}
|
||||
// 创建请求
|
||||
CreateMenuReq {
|
||||
Pid string `json:"pid,optional"` // 父菜单ID
|
||||
Name string `json:"name"` // 路由名称
|
||||
Path string `json:"path,optional"` // 路由路径
|
||||
Component string `json:"component,optional"` // 组件路径
|
||||
Redirect string `json:"redirect,optional"` // 重定向路径
|
||||
Meta map[string]interface{} `json:"meta"` // 路由元数据
|
||||
Status int64 `json:"status,optional,default=1"` // 状态:0-禁用,1-启用
|
||||
Type string `json:"type"` // 类型
|
||||
Sort int64 `json:"sort,optional"` // 排序
|
||||
}
|
||||
// 创建响应
|
||||
CreateMenuResp {
|
||||
Id string `json:"id"` // 菜单ID
|
||||
}
|
||||
// 更新请求
|
||||
UpdateMenuReq {
|
||||
Id string `path:"id"` // 菜单ID
|
||||
Pid *string `json:"pid,optional"` // 父菜单ID
|
||||
Name string `json:"name"` // 路由名称
|
||||
Path string `json:"path,optional"` // 路由路径
|
||||
Component string `json:"component,optional"` // 组件路径
|
||||
Redirect string `json:"redirect,optional"` // 重定向路径
|
||||
Meta map[string]interface{} `json:"meta"` // 路由元数据
|
||||
Status int64 `json:"status,optional"` // 状态:0-禁用,1-启用
|
||||
Type string `json:"type"` // 类型
|
||||
Sort int64 `json:"sort,optional"` // 排序
|
||||
}
|
||||
// 更新响应
|
||||
UpdateMenuResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 删除请求
|
||||
DeleteMenuReq {
|
||||
Id string `path:"id"` // 菜单ID
|
||||
}
|
||||
// 删除响应
|
||||
DeleteMenuResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 获取所有菜单请求
|
||||
GetMenuAllReq {}
|
||||
// 获取所有菜单响应
|
||||
GetMenuAllResp {
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
Redirect string `json:"redirect,omitempty"`
|
||||
Component string `json:"component,omitempty"`
|
||||
Sort int64 `json:"sort"`
|
||||
Meta map[string]interface{} `json:"meta"`
|
||||
Children []GetMenuAllResp `json:"children"`
|
||||
}
|
||||
)
|
||||
|
||||
128
app/main/api/desc/admin/notification.api
Normal file
128
app/main/api/desc/admin/notification.api
Normal file
@@ -0,0 +1,128 @@
|
||||
syntax = "v1"
|
||||
|
||||
type (
|
||||
// 创建通知请求
|
||||
AdminCreateNotificationReq {
|
||||
Title string `json:"title"` // 通知标题
|
||||
NotificationPage string `json:"notification_page"` // 通知页面
|
||||
Content string `json:"content"` // 通知内容
|
||||
StartDate string `json:"start_date"` // 生效开始日期(yyyy-MM-dd)
|
||||
StartTime string `json:"start_time"` // 生效开始时间(HH:mm:ss)
|
||||
EndDate string `json:"end_date"` // 生效结束日期(yyyy-MM-dd)
|
||||
EndTime string `json:"end_time"` // 生效结束时间(HH:mm:ss)
|
||||
Status int64 `json:"status"` // 状态:1-启用,0-禁用
|
||||
}
|
||||
|
||||
// 创建通知响应
|
||||
AdminCreateNotificationResp {
|
||||
Id string `json:"id"` // 通知ID
|
||||
}
|
||||
|
||||
// 更新通知请求
|
||||
AdminUpdateNotificationReq {
|
||||
Id string `path:"id"` // 通知ID
|
||||
Title *string `json:"title,optional"` // 通知标题
|
||||
Content *string `json:"content,optional"` // 通知内容
|
||||
NotificationPage *string `json:"notification_page,optional"` // 通知页面
|
||||
StartDate *string `json:"start_date,optional"` // 生效开始日期
|
||||
StartTime *string `json:"start_time,optional"` // 生效开始时间
|
||||
EndDate *string `json:"end_date,optional"` // 生效结束日期
|
||||
EndTime *string `json:"end_time,optional"` // 生效结束时间
|
||||
Status *int64 `json:"status,optional"` // 状态
|
||||
}
|
||||
|
||||
// 更新通知响应
|
||||
AdminUpdateNotificationResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除通知请求
|
||||
AdminDeleteNotificationReq {
|
||||
Id string `path:"id"` // 通知ID
|
||||
}
|
||||
|
||||
// 删除通知响应
|
||||
AdminDeleteNotificationResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 获取通知详情请求
|
||||
AdminGetNotificationDetailReq {
|
||||
Id string `path:"id"` // 通知ID
|
||||
}
|
||||
|
||||
// 获取通知详情响应
|
||||
AdminGetNotificationDetailResp {
|
||||
Id string `json:"id"` // 通知ID
|
||||
Title string `json:"title"` // 通知标题
|
||||
Content string `json:"content"` // 通知内容
|
||||
NotificationPage string `json:"notification_page"` // 通知页面
|
||||
StartDate string `json:"start_date"` // 生效开始日期
|
||||
StartTime string `json:"start_time"` // 生效开始时间
|
||||
EndDate string `json:"end_date"` // 生效结束日期
|
||||
EndTime string `json:"end_time"` // 生效结束时间
|
||||
Status int64 `json:"status"` // 状态
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
// 获取通知列表请求
|
||||
AdminGetNotificationListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
Title *string `form:"title,optional"` // 通知标题(可选)
|
||||
NotificationPage *string `form:"notification_page,optional"` // 通知页面(可选)
|
||||
Status *int64 `form:"status,optional"` // 状态(可选)
|
||||
StartDate *string `form:"start_date,optional"` // 开始日期范围(可选)
|
||||
EndDate *string `form:"end_date,optional"` // 结束日期范围(可选)
|
||||
}
|
||||
|
||||
// 通知列表项
|
||||
NotificationListItem {
|
||||
Id string `json:"id"` // 通知ID
|
||||
Title string `json:"title"` // 通知标题
|
||||
NotificationPage string `json:"notification_page"` // 通知页面
|
||||
Content string `json:"content"` // 通知内容
|
||||
StartDate string `json:"start_date"` // 生效开始日期
|
||||
StartTime string `json:"start_time"` // 生效开始时间
|
||||
EndDate string `json:"end_date"` // 生效结束日期
|
||||
EndTime string `json:"end_time"` // 生效结束时间
|
||||
Status int64 `json:"status"` // 状态
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
// 获取通知列表响应
|
||||
AdminGetNotificationListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []NotificationListItem `json:"items"` // 列表数据
|
||||
}
|
||||
)
|
||||
|
||||
// 通知管理接口
|
||||
@server(
|
||||
prefix: /api/v1/admin/notification
|
||||
group: admin_notification
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 创建通知
|
||||
@handler AdminCreateNotification
|
||||
post /create (AdminCreateNotificationReq) returns (AdminCreateNotificationResp)
|
||||
|
||||
// 更新通知
|
||||
@handler AdminUpdateNotification
|
||||
put /update/:id (AdminUpdateNotificationReq) returns (AdminUpdateNotificationResp)
|
||||
|
||||
// 删除通知
|
||||
@handler AdminDeleteNotification
|
||||
delete /delete/:id (AdminDeleteNotificationReq) returns (AdminDeleteNotificationResp)
|
||||
|
||||
// 获取通知详情
|
||||
@handler AdminGetNotificationDetail
|
||||
get /detail/:id (AdminGetNotificationDetailReq) returns (AdminGetNotificationDetailResp)
|
||||
|
||||
// 获取通知列表
|
||||
@handler AdminGetNotificationList
|
||||
get /list (AdminGetNotificationListReq) returns (AdminGetNotificationListResp)
|
||||
}
|
||||
168
app/main/api/desc/admin/order.api
Normal file
168
app/main/api/desc/admin/order.api
Normal file
@@ -0,0 +1,168 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "订单服务"
|
||||
desc: "订单服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/order
|
||||
group: admin_order
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取订单列表"
|
||||
@handler AdminGetOrderList
|
||||
get /list (AdminGetOrderListReq) returns (AdminGetOrderListResp)
|
||||
|
||||
@doc "获取订单详情"
|
||||
@handler AdminGetOrderDetail
|
||||
get /detail/:id (AdminGetOrderDetailReq) returns (AdminGetOrderDetailResp)
|
||||
|
||||
@doc "创建订单"
|
||||
@handler AdminCreateOrder
|
||||
post /create (AdminCreateOrderReq) returns (AdminCreateOrderResp)
|
||||
|
||||
@doc "更新订单"
|
||||
@handler AdminUpdateOrder
|
||||
put /update/:id (AdminUpdateOrderReq) returns (AdminUpdateOrderResp)
|
||||
|
||||
@doc "删除订单"
|
||||
@handler AdminDeleteOrder
|
||||
delete /delete/:id (AdminDeleteOrderReq) returns (AdminDeleteOrderResp)
|
||||
|
||||
@doc "订单退款"
|
||||
@handler AdminRefundOrder
|
||||
post /refund/:id (AdminRefundOrderReq) returns (AdminRefundOrderResp)
|
||||
|
||||
@doc "重新执行代理处理"
|
||||
@handler AdminRetryAgentProcess
|
||||
post /retry-agent-process/:id (AdminRetryAgentProcessReq) returns (AdminRetryAgentProcessResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
AdminGetOrderListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
OrderNo string `form:"order_no,optional"` // 商户订单号
|
||||
PlatformOrderId string `form:"platform_order_id,optional"` // 支付订单号
|
||||
ProductName string `form:"product_name,optional"` // 产品名称
|
||||
PaymentPlatform string `form:"payment_platform,optional"` // 支付方式
|
||||
PaymentScene string `form:"payment_scene,optional"` // 支付平台
|
||||
Amount float64 `form:"amount,optional"` // 金额
|
||||
Status string `form:"status,optional"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
CreateTimeStart string `form:"create_time_start,optional"` // 创建时间开始
|
||||
CreateTimeEnd string `form:"create_time_end,optional"` // 创建时间结束
|
||||
PayTimeStart string `form:"pay_time_start,optional"` // 支付时间开始
|
||||
PayTimeEnd string `form:"pay_time_end,optional"` // 支付时间结束
|
||||
RefundTimeStart string `form:"refund_time_start,optional"` // 退款时间开始
|
||||
RefundTimeEnd string `form:"refund_time_end,optional"` // 退款时间结束
|
||||
}
|
||||
// 列表响应
|
||||
AdminGetOrderListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []OrderListItem `json:"items"` // 列表
|
||||
}
|
||||
// 列表项
|
||||
OrderListItem {
|
||||
Id string `json:"id"` // 订单ID
|
||||
OrderNo string `json:"order_no"` // 商户订单号
|
||||
PlatformOrderId string `json:"platform_order_id"` // 支付订单号
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
PaymentPlatform string `json:"payment_platform"` // 支付方式
|
||||
PaymentScene string `json:"payment_scene"` // 支付平台
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
Status string `json:"status"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
QueryState string `json:"query_state"` // 查询状态:pending-待查询,success-查询成功,failed-查询失败 processing-查询中
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
PayTime string `json:"pay_time"` // 支付时间
|
||||
RefundTime string `json:"refund_time"` // 退款时间
|
||||
IsAgentOrder bool `json:"is_agent_order"` // 是否是代理订单
|
||||
AgentProcessStatus string `json:"agent_process_status"` // 代理事务处理状态:not_agent-非代理订单,success-处理成功,failed-处理失败,pending-待处理
|
||||
}
|
||||
// 详情请求
|
||||
AdminGetOrderDetailReq {
|
||||
Id string `path:"id"` // 订单ID
|
||||
}
|
||||
// 详情响应
|
||||
AdminGetOrderDetailResp {
|
||||
Id string `json:"id"` // 订单ID
|
||||
OrderNo string `json:"order_no"` // 商户订单号
|
||||
PlatformOrderId string `json:"platform_order_id"` // 支付订单号
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
PaymentPlatform string `json:"payment_platform"` // 支付方式
|
||||
PaymentScene string `json:"payment_scene"` // 支付平台
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
Status string `json:"status"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
QueryState string `json:"query_state"` // 查询状态:pending-待查询,success-查询成功,failed-查询失败 processing-查询中
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
PayTime string `json:"pay_time"` // 支付时间
|
||||
RefundTime string `json:"refund_time"` // 退款时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
IsAgentOrder bool `json:"is_agent_order"` // 是否是代理订单
|
||||
AgentProcessStatus string `json:"agent_process_status"` // 代理事务处理状态:not_agent-非代理订单,success-处理成功,failed-处理失败,pending-待处理
|
||||
}
|
||||
// 创建请求
|
||||
AdminCreateOrderReq {
|
||||
OrderNo string `json:"order_no"` // 商户订单号
|
||||
PlatformOrderId string `json:"platform_order_id"` // 支付订单号
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
PaymentPlatform string `json:"payment_platform"` // 支付方式
|
||||
PaymentScene string `json:"payment_scene"` // 支付平台
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
Status string `json:"status,default=pending"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
}
|
||||
// 创建响应
|
||||
AdminCreateOrderResp {
|
||||
Id string `json:"id"` // 订单ID
|
||||
}
|
||||
// 更新请求
|
||||
AdminUpdateOrderReq {
|
||||
Id string `path:"id"` // 订单ID
|
||||
OrderNo *string `json:"order_no,optional"` // 商户订单号
|
||||
PlatformOrderId *string `json:"platform_order_id,optional"` // 支付订单号
|
||||
ProductName *string `json:"product_name,optional"` // 产品名称
|
||||
PaymentPlatform *string `json:"payment_platform,optional"` // 支付方式
|
||||
PaymentScene *string `json:"payment_scene,optional"` // 支付平台
|
||||
Amount *float64 `json:"amount,optional"` // 金额
|
||||
Status *string `json:"status,optional"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
PayTime *string `json:"pay_time,optional"` // 支付时间
|
||||
RefundTime *string `json:"refund_time,optional"` // 退款时间
|
||||
}
|
||||
// 更新响应
|
||||
AdminUpdateOrderResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 删除请求
|
||||
AdminDeleteOrderReq {
|
||||
Id string `path:"id"` // 订单ID
|
||||
}
|
||||
// 删除响应
|
||||
AdminDeleteOrderResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 退款请求
|
||||
AdminRefundOrderReq {
|
||||
Id string `path:"id"` // 订单ID
|
||||
RefundAmount float64 `json:"refund_amount"` // 退款金额
|
||||
RefundReason string `json:"refund_reason"` // 退款原因
|
||||
}
|
||||
// 退款响应
|
||||
AdminRefundOrderResp {
|
||||
Status string `json:"status"` // 退款状态
|
||||
RefundNo string `json:"refund_no"` // 退款单号
|
||||
Amount float64 `json:"amount"` // 退款金额
|
||||
}
|
||||
// 重新执行代理处理请求
|
||||
AdminRetryAgentProcessReq {
|
||||
Id string `path:"id"` // 订单ID
|
||||
}
|
||||
// 重新执行代理处理响应
|
||||
AdminRetryAgentProcessResp {
|
||||
Status string `json:"status"` // 执行状态:success-成功,already_processed-已处理,failed-失败
|
||||
Message string `json:"message"` // 执行结果消息
|
||||
ProcessedAt string `json:"processed_at"` // 处理时间
|
||||
}
|
||||
)
|
||||
113
app/main/api/desc/admin/platform_user.api
Normal file
113
app/main/api/desc/admin/platform_user.api
Normal file
@@ -0,0 +1,113 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "平台用户管理"
|
||||
desc: "平台用户管理"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 平台用户管理接口
|
||||
@server (
|
||||
prefix: /api/v1/admin/platform_user
|
||||
group: admin_platform_user
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 创建平台用户
|
||||
@handler AdminCreatePlatformUser
|
||||
post /create (AdminCreatePlatformUserReq) returns (AdminCreatePlatformUserResp)
|
||||
|
||||
// 更新平台用户
|
||||
@handler AdminUpdatePlatformUser
|
||||
put /update/:id (AdminUpdatePlatformUserReq) returns (AdminUpdatePlatformUserResp)
|
||||
|
||||
// 删除平台用户
|
||||
@handler AdminDeletePlatformUser
|
||||
delete /delete/:id (AdminDeletePlatformUserReq) returns (AdminDeletePlatformUserResp)
|
||||
|
||||
// 获取平台用户分页列表
|
||||
@handler AdminGetPlatformUserList
|
||||
get /list (AdminGetPlatformUserListReq) returns (AdminGetPlatformUserListResp)
|
||||
|
||||
// 获取平台用户详情
|
||||
@handler AdminGetPlatformUserDetail
|
||||
get /detail/:id (AdminGetPlatformUserDetailReq) returns (AdminGetPlatformUserDetailResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 分页列表请求
|
||||
AdminGetPlatformUserListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
Mobile string `form:"mobile,optional"` // 手机号
|
||||
Nickname string `form:"nickname,optional"` // 昵称
|
||||
Inside int64 `form:"inside,optional"` // 是否内部用户 1-是 0-否
|
||||
CreateTimeStart string `form:"create_time_start,optional"` // 创建时间开始
|
||||
CreateTimeEnd string `form:"create_time_end,optional"` // 创建时间结束
|
||||
OrderBy string `form:"order_by,optional"` // 排序字段
|
||||
OrderType string `form:"order_type,optional"` // 排序类型
|
||||
}
|
||||
// 分页列表响应
|
||||
AdminGetPlatformUserListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []PlatformUserListItem `json:"items"` // 列表
|
||||
}
|
||||
// 列表项
|
||||
PlatformUserListItem {
|
||||
Id string `json:"id"` // 用户ID
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
Nickname string `json:"nickname"` // 昵称
|
||||
Info string `json:"info"` // 备注信息
|
||||
Inside int64 `json:"inside"` // 是否内部用户 1-是 0-否
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
// 详情请求
|
||||
AdminGetPlatformUserDetailReq {
|
||||
Id string `path:"id"` // 用户ID
|
||||
}
|
||||
// 详情响应
|
||||
AdminGetPlatformUserDetailResp {
|
||||
Id string `json:"id"` // 用户ID
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
Nickname string `json:"nickname"` // 昵称
|
||||
Info string `json:"info"` // 备注信息
|
||||
Inside int64 `json:"inside"` // 是否内部用户 1-是 0-否
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
// 创建请求
|
||||
AdminCreatePlatformUserReq {
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
Password string `json:"password"` // 密码
|
||||
Nickname string `json:"nickname"` // 昵称
|
||||
Info string `json:"info"` // 备注信息
|
||||
Inside int64 `json:"inside"` // 是否内部用户 1-是 0-否
|
||||
}
|
||||
// 创建响应
|
||||
AdminCreatePlatformUserResp {
|
||||
Id string `json:"id"` // 用户ID
|
||||
}
|
||||
// 更新请求
|
||||
AdminUpdatePlatformUserReq {
|
||||
Id string `path:"id"` // 用户ID
|
||||
Mobile *string `json:"mobile,optional"` // 手机号
|
||||
Password *string `json:"password,optional"` // 密码
|
||||
Nickname *string `json:"nickname,optional"` // 昵称
|
||||
Info *string `json:"info,optional"` // 备注信息
|
||||
Inside *int64 `json:"inside,optional"` // 是否内部用户 1-是 0-否
|
||||
}
|
||||
// 更新响应
|
||||
AdminUpdatePlatformUserResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 删除请求
|
||||
AdminDeletePlatformUserReq {
|
||||
Id string `path:"id"` // 用户ID
|
||||
}
|
||||
// 删除响应
|
||||
AdminDeletePlatformUserResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
|
||||
122
app/main/api/desc/admin/role.api
Normal file
122
app/main/api/desc/admin/role.api
Normal file
@@ -0,0 +1,122 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "角色服务"
|
||||
desc: "角色服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/role
|
||||
group: admin_role
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取角色列表"
|
||||
@handler GetRoleList
|
||||
get /list (GetRoleListReq) returns (GetRoleListResp)
|
||||
|
||||
@doc "获取角色详情"
|
||||
@handler GetRoleDetail
|
||||
get /detail/:id (GetRoleDetailReq) returns (GetRoleDetailResp)
|
||||
|
||||
@doc "创建角色"
|
||||
@handler CreateRole
|
||||
post /create (CreateRoleReq) returns (CreateRoleResp)
|
||||
|
||||
@doc "更新角色"
|
||||
@handler UpdateRole
|
||||
put /update/:id (UpdateRoleReq) returns (UpdateRoleResp)
|
||||
|
||||
@doc "删除角色"
|
||||
@handler DeleteRole
|
||||
delete /delete/:id (DeleteRoleReq) returns (DeleteRoleResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
GetRoleListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
Name string `form:"name,optional"` // 角色名称
|
||||
Code string `form:"code,optional"` // 角色编码
|
||||
Status int64 `form:"status,optional,default=-1"` // 状态:0-禁用,1-启用
|
||||
}
|
||||
|
||||
// 列表响应
|
||||
GetRoleListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []RoleListItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
// 列表项
|
||||
RoleListItem {
|
||||
Id string `json:"id"` // 角色ID
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleCode string `json:"role_code"` // 角色编码
|
||||
Description string `json:"description"` // 角色描述
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
MenuIds []string `json:"menu_ids"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
GetRoleDetailReq {
|
||||
Id string `path:"id"` // 角色ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
GetRoleDetailResp {
|
||||
Id string `json:"id"` // 角色ID
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleCode string `json:"role_code"` // 角色编码
|
||||
Description string `json:"description"` // 角色描述
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
MenuIds []string `json:"menu_ids"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
CreateRoleReq {
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleCode string `json:"role_code"` // 角色编码
|
||||
Description string `json:"description"` // 角色描述
|
||||
Status int64 `json:"status,default=1"` // 状态:0-禁用,1-启用
|
||||
Sort int64 `json:"sort,default=0"` // 排序
|
||||
MenuIds []string `json:"menu_ids"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
CreateRoleResp {
|
||||
Id string `json:"id"` // 角色ID
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
UpdateRoleReq {
|
||||
Id string `path:"id"` // 角色ID
|
||||
RoleName *string `json:"role_name,optional"` // 角色名称
|
||||
RoleCode *string `json:"role_code,optional"` // 角色编码
|
||||
Description *string `json:"description,optional"` // 角色描述
|
||||
Status *int64 `json:"status,optional"` // 状态:0-禁用,1-启用
|
||||
Sort *int64 `json:"sort,optional"` // 排序
|
||||
MenuIds []string `json:"menu_ids,optional"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
UpdateRoleResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
DeleteRoleReq {
|
||||
Id string `path:"id"` // 角色ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
DeleteRoleResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
273
app/main/api/desc/front/agent.api
Normal file
273
app/main/api/desc/front/agent.api
Normal file
@@ -0,0 +1,273 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "代理服务(简化版)"
|
||||
desc: "新代理系统接口 - 系统简化后移除团队、返佣、升级、提现、实名、邀请码功能"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// ============================================
|
||||
// 公开接口(无需认证)
|
||||
// ============================================
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
)
|
||||
service main {
|
||||
// 获取推广链接数据
|
||||
@handler GetLinkData
|
||||
get /link (GetLinkDataReq) returns (GetLinkDataResp)
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
middleware: AuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 申请成为代理(系统简化:无需邀请码)
|
||||
@handler ApplyForAgent
|
||||
post /apply (AgentApplyReq) returns (AgentApplyResp)
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 需要登录的接口
|
||||
// ============================================
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
jwt: JwtAuth
|
||||
middleware: UserAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 查看代理信息(简化版)
|
||||
@handler GetAgentInfo
|
||||
get /info returns (AgentInfoResp)
|
||||
|
||||
// 获取代理仪表板数据(简化版)
|
||||
@handler GetAgentDashboard
|
||||
get /dashboard returns (AgentDashboardResp)
|
||||
|
||||
// 生成推广链接
|
||||
@handler GeneratingLink
|
||||
post /generating_link (AgentGeneratingLinkReq) returns (AgentGeneratingLinkResp)
|
||||
|
||||
// 获取产品配置
|
||||
@handler GetAgentProductConfig
|
||||
get /product_config returns (AgentProductConfigResp)
|
||||
|
||||
// 获取收益信息(简化版)
|
||||
@handler GetRevenueInfo
|
||||
get /revenue returns (GetRevenueInfoResp)
|
||||
|
||||
// 获取佣金记录
|
||||
@handler GetCommissionList
|
||||
get /commission/list (GetCommissionListReq) returns (GetCommissionListResp)
|
||||
|
||||
// 获取推广查询报告列表
|
||||
@handler GetPromotionQueryList
|
||||
get /promotion/query/list (GetPromotionQueryListReq) returns (GetPromotionQueryListResp)
|
||||
|
||||
// 创建提现申请
|
||||
@handler CreateWithdraw
|
||||
post /withdraw/create (CreateWithdrawReq) returns (CreateWithdrawResp)
|
||||
|
||||
// 获取提现记录列表
|
||||
@handler GetWithdrawList
|
||||
get /withdraw/list (GetWithdrawListReq) returns (GetWithdrawListResp)
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 短链重定向接口(公开访问,不需要认证和api前缀)
|
||||
// ============================================
|
||||
@server (
|
||||
group: agent
|
||||
)
|
||||
service main {
|
||||
// 短链重定向
|
||||
@handler ShortLinkRedirect
|
||||
get /s/:shortCode returns (ShortLinkRedirectResp)
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 类型定义
|
||||
// ============================================
|
||||
type (
|
||||
// 获取推广链接数据
|
||||
GetLinkDataReq {
|
||||
LinkIdentifier string `form:"link_identifier"` // 推广链接标识
|
||||
}
|
||||
GetLinkDataResp {
|
||||
AgentId string `json:"agent_id"` // 代理ID
|
||||
ProductId string `json:"product_id"` // 产品ID
|
||||
SetPrice float64 `json:"set_price"` // 代理设定价格
|
||||
ActualBasePrice float64 `json:"actual_base_price"` // 实际底价
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
ProductEn string `json:"product_en"` // 产品英文标识
|
||||
SellPrice float64 `json:"sell_price"` // 销售价格(使用代理设定价格)
|
||||
Description string `json:"description"` // 产品描述
|
||||
Features []Feature `json:"features"` // 产品功能列表
|
||||
}
|
||||
|
||||
// 申请成为代理
|
||||
AgentApplyReq {
|
||||
Region string `json:"region,optional"`
|
||||
Mobile string `json:"mobile"`
|
||||
Code string `json:"code"`
|
||||
Referrer string `json:"referrer"`
|
||||
AgentCode int64 `json:"agent_code,optional"`
|
||||
}
|
||||
AgentApplyResp {
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
AgentCode int64 `json:"agent_code"`
|
||||
}
|
||||
|
||||
// 代理信息(简化版)
|
||||
AgentInfoResp {
|
||||
AgentId string `json:"agent_id"`
|
||||
Region string `json:"region"`
|
||||
Mobile string `json:"mobile"`
|
||||
WechatId string `json:"wechat_id"`
|
||||
AgentCode int64 `json:"agent_code"`
|
||||
}
|
||||
|
||||
// 代理仪表板数据(简化版)
|
||||
AgentDashboardResp {
|
||||
Statistics DashboardStatistics `json:"statistics"` // 统计数据
|
||||
PromotionLink string `json:"promotion_link"` // 推广链接
|
||||
Product DashboardProduct `json:"product"` // 产品信息
|
||||
}
|
||||
DashboardStatistics {
|
||||
TodayOrders int64 `json:"today_orders"` // 今日订单数
|
||||
TodayEarnings string `json:"today_earnings"` // 今日佣金
|
||||
MonthEarnings string `json:"month_earnings"` // 本月佣金
|
||||
TotalOrders int64 `json:"total_orders"` // 总订单数
|
||||
TotalEarnings string `json:"total_earnings"` // 总佣金
|
||||
CommissionRate string `json:"commission_rate"` // 佣金率
|
||||
CurrentBalance string `json:"current_balance"` // 当前余额
|
||||
FrozenBalance string `json:"frozen_balance"` // 冻结余额
|
||||
}
|
||||
DashboardProduct {
|
||||
Name string `json:"name"` // 产品名称
|
||||
Price string `json:"price"` // 价格
|
||||
Description string `json:"description"` // 描述
|
||||
}
|
||||
|
||||
// 生成推广链接
|
||||
AgentGeneratingLinkReq {
|
||||
ProductId string `json:"product_id"` // 产品ID
|
||||
SetPrice float64 `json:"set_price"` // 设定价格
|
||||
TargetPath string `json:"target_path,optional"` // 目标地址(可选,默认为推广报告页面)
|
||||
}
|
||||
AgentGeneratingLinkResp {
|
||||
LinkIdentifier string `json:"link_identifier"` // 推广链接标识
|
||||
FullLink string `json:"full_link"` // 完整短链URL
|
||||
}
|
||||
|
||||
// 产品配置
|
||||
AgentProductConfigResp {
|
||||
List []ProductConfigItem `json:"list"`
|
||||
}
|
||||
ProductConfigItem {
|
||||
ProductId string `json:"product_id"` // 产品ID
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
ProductEn string `json:"product_en"` // 产品英文标识
|
||||
ActualBasePrice float64 `json:"actual_base_price"` // 实际底价
|
||||
PriceRangeMin float64 `json:"price_range_min"` // 最低价格
|
||||
PriceRangeMax float64 `json:"price_range_max"` // 最高价格
|
||||
PriceThreshold float64 `json:"price_threshold"` // 提价标准阈值
|
||||
PriceFeeRate float64 `json:"price_fee_rate"` // 提价手续费比例
|
||||
}
|
||||
|
||||
// 收益信息(简化版)
|
||||
GetRevenueInfoResp {
|
||||
Balance float64 `json:"balance"` // 可用余额
|
||||
TotalEarnings float64 `json:"total_earnings"` // 累计收益
|
||||
CommissionTotal float64 `json:"commission_total"` // 佣金累计总收益
|
||||
CommissionToday float64 `json:"commission_today"` // 佣金今日收益
|
||||
CommissionMonth float64 `json:"commission_month"` // 佣金本月收益
|
||||
}
|
||||
|
||||
// 佣金记录
|
||||
GetCommissionListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"page_size"` // 每页数量
|
||||
}
|
||||
GetCommissionListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
List []CommissionItem `json:"list"` // 列表
|
||||
}
|
||||
CommissionItem {
|
||||
Id string `json:"id"` // 记录ID
|
||||
OrderId string `json:"order_id"` // 订单ID
|
||||
OrderNo string `json:"order_no"` // 订单号
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
Amount float64 `json:"amount"` // 佣金金额
|
||||
Status int64 `json:"status"` // 状态:1=已发放,2=已冻结,3=已取消
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 推广查询列表
|
||||
GetPromotionQueryListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"page_size"` // 每页数量
|
||||
}
|
||||
GetPromotionQueryListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
List []PromotionQueryItem `json:"list"` // 列表
|
||||
}
|
||||
PromotionQueryItem {
|
||||
Id string `json:"id"` // 查询ID
|
||||
OrderId string `json:"order_id"` // 订单ID
|
||||
OrderNo string `json:"order_no"` // 订单号
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
OrderAmount float64 `json:"order_amount"` // 订单金额
|
||||
Amount float64 `json:"amount"` // 推广收益
|
||||
QueryName string `json:"query_name"` // 查询人姓名
|
||||
QueryMobile string `json:"query_mobile"` // 查询人手机号
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
QueryState string `json:"query_state"` // 查询状态
|
||||
}
|
||||
|
||||
// 短链重定向
|
||||
ShortLinkRedirectResp {}
|
||||
|
||||
// ============================================
|
||||
// 提现相关
|
||||
// ============================================
|
||||
|
||||
// 创建提现申请
|
||||
CreateWithdrawReq {
|
||||
WithdrawAmount float64 `json:"withdraw_amount"` // 提现金额
|
||||
AccountName string `json:"account_name"` // 收款人姓名
|
||||
BankCardNumber string `json:"bank_card_number"` // 银行卡号
|
||||
BankBranch string `json:"bank_branch,optional"` // 开户支行(可选)
|
||||
}
|
||||
CreateWithdrawResp {
|
||||
WithdrawId string `json:"withdraw_id"` // 提现记录ID
|
||||
}
|
||||
|
||||
// 获取提现记录列表
|
||||
GetWithdrawListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"page_size"` // 每页数量
|
||||
}
|
||||
GetWithdrawListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
List []WithdrawItem `json:"list"` // 列表
|
||||
}
|
||||
WithdrawItem {
|
||||
Id string `json:"id"` // 记录ID
|
||||
WithdrawAmount string `json:"withdraw_amount"` // 提现金额
|
||||
TaxAmount string `json:"tax_amount"` // 税费金额
|
||||
ActualAmount string `json:"actual_amount"` // 实际到账金额
|
||||
AccountName string `json:"account_name"` // 收款人姓名
|
||||
BankCardNumber string `json:"bank_card_number"` // 银行卡号(脱敏)
|
||||
Status int64 `json:"status"` // 状态:0=待审核,1=已通过,2=已拒绝
|
||||
AuditRemark string `json:"audit_remark"` // 审核备注
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
AuditTime string `json:"audit_time"` // 审核时间
|
||||
}
|
||||
)
|
||||
48
app/main/api/desc/front/app.api
Normal file
48
app/main/api/desc/front/app.api
Normal file
@@ -0,0 +1,48 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "APP服务"
|
||||
desc: "APP服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: app
|
||||
)
|
||||
service main {
|
||||
@doc (
|
||||
summary: "心跳检测接口"
|
||||
)
|
||||
@handler healthCheck
|
||||
get /health/check returns (HealthCheckResp)
|
||||
|
||||
@handler getAppVersion
|
||||
get /app/version returns (getAppVersionResp)
|
||||
|
||||
@handler getAppConfig
|
||||
get /app/config returns (getAppConfigResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 心跳检测响应
|
||||
HealthCheckResp {
|
||||
Status string `json:"status"` // 服务状态
|
||||
Message string `json:"message"` // 状态信息
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
getAppVersionResp {
|
||||
Version string `json:"version"`
|
||||
WgtUrl string `json:"wgtUrl"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
getAppConfigResp {
|
||||
QueryRetentionDays int64 `json:"query_retention_days"`
|
||||
WechatH5LoginEnabled bool `json:"wechat_h5_login_enabled"` // 微信公众号登录是否启用
|
||||
}
|
||||
)
|
||||
|
||||
69
app/main/api/desc/front/authorization.api
Normal file
69
app/main/api/desc/front/authorization.api
Normal file
@@ -0,0 +1,69 @@
|
||||
type (
|
||||
// GetAuthorizationDocumentReq 获取授权书请求
|
||||
GetAuthorizationDocumentReq {
|
||||
DocumentId string `json:"documentId" validate:"required"` // 授权书ID
|
||||
}
|
||||
// GetAuthorizationDocumentResp 获取授权书响应
|
||||
GetAuthorizationDocumentResp {
|
||||
DocumentId string `json:"documentId"` // 授权书ID
|
||||
UserId string `json:"userId"` // 用户ID
|
||||
OrderId string `json:"orderId"` // 订单ID
|
||||
QueryId string `json:"queryId"` // 查询ID
|
||||
FileName string `json:"fileName"` // 文件名
|
||||
FileUrl string `json:"fileUrl"` // 文件访问URL
|
||||
FileSize int64 `json:"fileSize"` // 文件大小
|
||||
FileType string `json:"fileType"` // 文件类型
|
||||
Status string `json:"status"` // 状态
|
||||
CreateTime string `json:"createTime"` // 创建时间
|
||||
}
|
||||
// GetAuthorizationDocumentByOrderReq 根据订单ID获取授权书请求
|
||||
GetAuthorizationDocumentByOrderReq {
|
||||
OrderId string `json:"orderId" validate:"required"` // 订单ID
|
||||
}
|
||||
// GetAuthorizationDocumentByOrderResp 根据订单ID获取授权书响应
|
||||
GetAuthorizationDocumentByOrderResp {
|
||||
Documents []AuthorizationDocumentInfo `json:"documents"` // 授权书列表
|
||||
}
|
||||
// AuthorizationDocumentInfo 授权书信息
|
||||
AuthorizationDocumentInfo {
|
||||
DocumentId string `json:"documentId"` // 授权书ID
|
||||
UserId string `json:"userId"` // 用户ID
|
||||
OrderId string `json:"orderId"` // 订单ID
|
||||
QueryId string `json:"queryId"` // 查询ID
|
||||
FileName string `json:"fileName"` // 文件名
|
||||
FileUrl string `json:"fileUrl"` // 文件访问URL
|
||||
FileSize int64 `json:"fileSize"` // 文件大小
|
||||
FileType string `json:"fileType"` // 文件类型
|
||||
Status string `json:"status"` // 状态
|
||||
CreateTime string `json:"createTime"` // 创建时间
|
||||
}
|
||||
// DownloadAuthorizationDocumentReq 下载授权书请求
|
||||
DownloadAuthorizationDocumentReq {
|
||||
DocumentId string `json:"documentId" validate:"required"` // 授权书ID
|
||||
}
|
||||
// DownloadAuthorizationDocumentResp 下载授权书响应
|
||||
DownloadAuthorizationDocumentResp {
|
||||
FileName string `json:"fileName"` // 文件名
|
||||
FileUrl string `json:"fileUrl"` // 文件访问URL
|
||||
}
|
||||
)
|
||||
|
||||
// 授权书相关接口
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: authorization
|
||||
)
|
||||
service main {
|
||||
// 获取授权书信息
|
||||
@handler GetAuthorizationDocument
|
||||
get /authorization/document/:documentId (GetAuthorizationDocumentReq) returns (GetAuthorizationDocumentResp)
|
||||
|
||||
// 根据订单ID获取授权书列表
|
||||
@handler GetAuthorizationDocumentByOrder
|
||||
get /authorization/document/order/:orderId (GetAuthorizationDocumentByOrderReq) returns (GetAuthorizationDocumentByOrderResp)
|
||||
|
||||
// 下载授权书文件
|
||||
@handler DownloadAuthorizationDocument
|
||||
get /authorization/download/:documentId (DownloadAuthorizationDocumentReq) returns (DownloadAuthorizationDocumentResp)
|
||||
}
|
||||
|
||||
94
app/main/api/desc/front/pay.api
Normal file
94
app/main/api/desc/front/pay.api
Normal file
@@ -0,0 +1,94 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "支付服务"
|
||||
desc: "支付服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: pay
|
||||
)
|
||||
service main {
|
||||
// 微信支付回调
|
||||
@handler WechatPayCallback
|
||||
post /pay/wechat/callback
|
||||
|
||||
// 支付宝支付回调
|
||||
@handler AlipayCallback
|
||||
post /pay/alipay/callback
|
||||
|
||||
// 微信退款回调
|
||||
@handler WechatPayRefundCallback
|
||||
post /pay/wechat/refund_callback
|
||||
|
||||
// 易支付回调
|
||||
@handler EasyPayCallback
|
||||
get /pay/easypay/callback
|
||||
|
||||
// 云印签支付回调
|
||||
@handler YunYinSignPayCallback
|
||||
post /pay/yunyinsign/callback
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: pay
|
||||
jwt: JwtAuth
|
||||
middleware: AuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 支付
|
||||
@handler Payment
|
||||
post /pay/payment (PaymentReq) returns (PaymentResp)
|
||||
|
||||
@handler IapCallback
|
||||
post /pay/iap_callback (IapCallbackReq)
|
||||
|
||||
@handler PaymentCheck
|
||||
post /pay/check (PaymentCheckReq) returns (PaymentCheckResp)
|
||||
|
||||
// 云印签退款
|
||||
@handler YunYinSignPayRefund
|
||||
post /pay/yunyinsign/refund (YunYinSignPayRefundReq) returns (YunYinSignPayRefundResp)
|
||||
}
|
||||
|
||||
type (
|
||||
PaymentReq {
|
||||
Id string `json:"id"`
|
||||
PayMethod string `json:"pay_method"` // 支付方式: wechat, alipay, easypay_alipay, appleiap, yunyinSignPay, yunyinSignPay_wechat, yunyinSignPay_alipay, test(仅开发环境), test_empty(仅开发环境-空报告模式)
|
||||
// 系统简化:移除 agent_vip, agent_upgrade 支付类型
|
||||
PayType string `json:"pay_type" validate:"required,oneof=query"`
|
||||
}
|
||||
PaymentResp {
|
||||
PrepayData interface{} `json:"prepay_data"`
|
||||
PrepayId string `json:"prepay_id"`
|
||||
OrderNo string `json:"order_no"`
|
||||
}
|
||||
PaymentCheckReq {
|
||||
OrderNo string `json:"order_no" validate:"required"`
|
||||
}
|
||||
PaymentCheckResp {
|
||||
Type string `json:"type"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
IapCallbackReq {
|
||||
OrderID string `json:"order_id" validate:"required"`
|
||||
TransactionReceipt string `json:"transaction_receipt" validate:"required"`
|
||||
}
|
||||
YunYinSignPayRefundReq {
|
||||
OrderNo string `json:"order_no"` // 订单号(sourceOrderCode),与 participate_id 二选一
|
||||
ParticipateId int64 `json:"participate_id,omitempty"` // 参与方ID,与 order_no 二选一
|
||||
RefundAmount float64 `json:"refund_amount" validate:"required,gt=0"` // 退款金额,必须大于0
|
||||
RefundReason string `json:"refund_reason,omitempty"` // 退款原因
|
||||
}
|
||||
YunYinSignPayRefundResp {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
)
|
||||
|
||||
55
app/main/api/desc/front/product.api
Normal file
55
app/main/api/desc/front/product.api
Normal file
@@ -0,0 +1,55 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品服务"
|
||||
desc: "产品服务"
|
||||
version: "v1"
|
||||
)
|
||||
type Feature {
|
||||
ID string `json:"id"` // 功能ID
|
||||
ApiID string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 功能描述
|
||||
}
|
||||
// 产品基本类型定义
|
||||
type Product {
|
||||
ProductName string `json:"product_name"`
|
||||
ProductEn string `json:"product_en"`
|
||||
Description string `json:"description"`
|
||||
Notes string `json:"notes,optional"`
|
||||
SellPrice float64 `json:"sell_price"`
|
||||
Features []Feature `json:"features"` // 关联功能列表
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1/product
|
||||
group: product
|
||||
|
||||
)
|
||||
service main {
|
||||
@handler GetProductByID
|
||||
get /:id (GetProductByIDRequest) returns (ProductResponse)
|
||||
|
||||
@handler GetProductByEn
|
||||
get /en/:product_en (GetProductByEnRequest) returns (ProductResponse)
|
||||
}
|
||||
|
||||
type GetProductByIDRequest {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
|
||||
type GetProductByEnRequest {
|
||||
ProductEn string `path:"product_en"`
|
||||
}
|
||||
|
||||
type ProductResponse {
|
||||
Product
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1/product
|
||||
group: product
|
||||
)
|
||||
service main {
|
||||
@handler GetProductAppByEn
|
||||
get /app_en/:product_en (GetProductByEnRequest) returns (ProductResponse)
|
||||
}
|
||||
221
app/main/api/desc/front/query.api
Normal file
221
app/main/api/desc/front/query.api
Normal file
@@ -0,0 +1,221 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品查询服务"
|
||||
desc: "产品查询服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
//============================> query v1 <============================
|
||||
// 查询基本类型定义
|
||||
type Query {
|
||||
Id string `json:"id"` // 主键ID
|
||||
OrderId string `json:"order_id"` // 订单ID
|
||||
OrderNo string `json:"order_no"` // 订单号
|
||||
Amount float64 `json:"amount"` // 订单金额
|
||||
UserId string `json:"user_id"` // 用户ID
|
||||
Product string `json:"product"` // 产品ID
|
||||
ProductName string `json:"product_name"` // 产品ID
|
||||
QueryParams map[string]interface{} `json:"query_params"`
|
||||
QueryData []QueryItem `json:"query_data"`
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
QueryState string `json:"query_state"` // 查询状态
|
||||
}
|
||||
|
||||
type QueryItem {
|
||||
Feature interface{} `json:"feature"`
|
||||
Data interface{} `json:"data"` // 这里可以是 map 或 具体的 struct
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: query
|
||||
middleware: AuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "query service agent"
|
||||
@handler queryServiceAgent
|
||||
post /query/service_agent/:product (QueryServiceReq) returns (QueryServiceResp)
|
||||
|
||||
@handler queryServiceApp
|
||||
post /query/service_app/:product (QueryServiceReq) returns (QueryServiceResp)
|
||||
}
|
||||
|
||||
type (
|
||||
QueryReq {
|
||||
Data string `json:"data" validate:"required"`
|
||||
}
|
||||
QueryResp {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryServiceReq {
|
||||
Product string `path:"product"`
|
||||
Data string `json:"data" validate:"required"`
|
||||
AgentIdentifier string `json:"agent_identifier,optional"`
|
||||
App bool `json:"app,optional"`
|
||||
}
|
||||
QueryServiceResp {
|
||||
Id string `json:"id"`
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: query
|
||||
jwt: JwtAuth
|
||||
middleware: AuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "query service"
|
||||
@handler queryService
|
||||
post /query/service/:product (QueryServiceReq) returns (QueryServiceResp)
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: query
|
||||
jwt: JwtAuth
|
||||
middleware: AuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取查询临时订单"
|
||||
@handler queryProvisionalOrder
|
||||
get /query/provisional_order/:id (QueryProvisionalOrderReq) returns (QueryProvisionalOrderResp)
|
||||
|
||||
@doc "查询列表"
|
||||
@handler queryList
|
||||
get /query/list (QueryListReq) returns (QueryListResp)
|
||||
|
||||
@doc "查询详情 按订单号 付款查询时"
|
||||
@handler queryDetailByOrderId
|
||||
get /query/orderId/:order_id (QueryDetailByOrderIdReq) returns (string)
|
||||
|
||||
@doc "查询详情 按订单号"
|
||||
@handler queryDetailByOrderNo
|
||||
get /query/orderNo/:order_no (QueryDetailByOrderNoReq) returns (string)
|
||||
|
||||
@doc "重试查询"
|
||||
@handler queryRetry
|
||||
post /query/retry/:id (QueryRetryReq) returns (QueryRetryResp)
|
||||
|
||||
@doc "更新查询数据"
|
||||
@handler updateQueryData
|
||||
post /query/update_data (UpdateQueryDataReq) returns (UpdateQueryDataResp)
|
||||
|
||||
@doc "生成分享链接"
|
||||
@handler QueryGenerateShareLink
|
||||
post /query/generate_share_link (QueryGenerateShareLinkReq) returns (QueryGenerateShareLinkResp)
|
||||
}
|
||||
|
||||
type (
|
||||
QueryGenerateShareLinkReq {
|
||||
OrderId *string `json:"order_id,optional"`
|
||||
OrderNo *string `json:"order_no,optional"`
|
||||
}
|
||||
QueryGenerateShareLinkResp {
|
||||
ShareLink string `json:"share_link"`
|
||||
}
|
||||
)
|
||||
|
||||
// 获取查询临时订单
|
||||
type (
|
||||
QueryProvisionalOrderReq {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
QueryProvisionalOrderResp {
|
||||
Name string `json:"name"`
|
||||
IdCard string `json:"id_card"`
|
||||
Mobile string `json:"mobile"`
|
||||
Product Product `json:"product"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"page_size"` // 每页数据量
|
||||
}
|
||||
QueryListResp {
|
||||
Total int64 `json:"total"` // 总记录数
|
||||
List []Query `json:"list"` // 查询列表
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryExampleReq {
|
||||
Feature string `form:"feature"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryDetailByOrderIdReq {
|
||||
OrderId string `path:"order_id"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryDetailByOrderNoReq {
|
||||
OrderNo string `path:"order_no"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryRetryReq {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
QueryRetryResp {
|
||||
Query
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
UpdateQueryDataReq {
|
||||
Id string `json:"id"` // 查询ID
|
||||
QueryData string `json:"query_data"` // 查询数据(未加密的JSON)
|
||||
}
|
||||
UpdateQueryDataResp {
|
||||
Id string `json:"id"`
|
||||
UpdatedAt string `json:"updated_at"` // 更新时间
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: query
|
||||
)
|
||||
service main {
|
||||
@handler querySingleTest
|
||||
post /query/single/test (QuerySingleTestReq) returns (QuerySingleTestResp)
|
||||
|
||||
@doc "查询详情"
|
||||
@handler queryShareDetail
|
||||
get /query/share/:id (QueryShareDetailReq) returns (string)
|
||||
|
||||
@doc "查询示例"
|
||||
@handler queryExample
|
||||
get /query/example (QueryExampleReq) returns (string)
|
||||
}
|
||||
|
||||
type (
|
||||
QueryShareDetailReq {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
type QuerySingleTestReq {
|
||||
Params map[string]interface{} `json:"params"`
|
||||
Api string `json:"api"`
|
||||
}
|
||||
|
||||
type QuerySingleTestResp {
|
||||
Data interface{} `json:"data"`
|
||||
Api string `json:"api"`
|
||||
}
|
||||
|
||||
193
app/main/api/desc/front/user.api
Normal file
193
app/main/api/desc/front/user.api
Normal file
@@ -0,0 +1,193 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "用户中心服务"
|
||||
desc: "用户中心服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
//============================> user v1 <============================
|
||||
// 用户基本类型定义
|
||||
type User {
|
||||
Id string `json:"id"`
|
||||
Mobile string `json:"mobile"`
|
||||
NickName string `json:"nickName"`
|
||||
UserType int64 `json:"userType"`
|
||||
}
|
||||
|
||||
//no need login
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: user
|
||||
)
|
||||
service main {
|
||||
@doc "unified auth"
|
||||
@handler auth
|
||||
post /user/auth (AuthReq) returns (AuthResp)
|
||||
@doc "mobile code login"
|
||||
@handler mobileCodeLogin
|
||||
post /user/mobileCodeLogin (MobileCodeLoginReq) returns (MobileCodeLoginResp)
|
||||
|
||||
@doc "wechat mini auth"
|
||||
@handler wxMiniAuth
|
||||
post /user/wxMiniAuth (WXMiniAuthReq) returns (WXMiniAuthResp)
|
||||
|
||||
@doc "wechat h5 auth"
|
||||
@handler wxH5Auth
|
||||
post /user/wxh5Auth (WXH5AuthReq) returns (WXH5AuthResp)
|
||||
|
||||
@handler getSignature
|
||||
post /wechat/getSignature (GetSignatureReq) returns (GetSignatureResp)
|
||||
}
|
||||
|
||||
type (
|
||||
AuthReq {
|
||||
Platform string `json:"platform"` // browser|wxh5|wxmini
|
||||
Code string `json:"code,optional"`
|
||||
}
|
||||
AuthResp {
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
UserType int64 `json:"userType"`
|
||||
HasMobile bool `json:"hasMobile"`
|
||||
IsAgent bool `json:"isAgent"`
|
||||
}
|
||||
MobileCodeLoginReq {
|
||||
Mobile string `json:"mobile"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
MobileCodeLoginResp {
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
WXMiniAuthReq {
|
||||
Code string `json:"code"`
|
||||
}
|
||||
WXMiniAuthResp {
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
GetSignatureReq {
|
||||
Url string `json:"url"`
|
||||
}
|
||||
GetSignatureResp {
|
||||
AppId string `json:"appId"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
NonceStr string `json:"nonceStr"`
|
||||
Signature string `json:"signature"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
WXH5AuthReq {
|
||||
Code string `json:"code"`
|
||||
}
|
||||
WXH5AuthResp {
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: user
|
||||
middleware: AuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "绑定手机号"
|
||||
@handler bindMobile
|
||||
post /user/bindMobile (BindMobileReq) returns (BindMobileResp)
|
||||
}
|
||||
|
||||
//need login
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: user
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@doc "get user info"
|
||||
@handler detail
|
||||
get /user/detail returns (UserInfoResp)
|
||||
|
||||
@doc "get new token"
|
||||
@handler getToken
|
||||
post /user/getToken returns (MobileCodeLoginResp)
|
||||
|
||||
@handler cancelOut
|
||||
post /user/cancelOut
|
||||
}
|
||||
|
||||
type (
|
||||
UserInfoResp {
|
||||
UserInfo User `json:"userInfo"`
|
||||
}
|
||||
BindMobileReq {
|
||||
Mobile string `json:"mobile" validate:"required,mobile"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
BindMobileResp {
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
}
|
||||
)
|
||||
|
||||
//============================> auth v1 <============================
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: auth
|
||||
)
|
||||
service main {
|
||||
@doc "get mobile verify code"
|
||||
@handler sendSms
|
||||
post /auth/sendSms (sendSmsReq)
|
||||
}
|
||||
|
||||
type (
|
||||
sendSmsReq {
|
||||
Mobile string `json:"mobile" validate:"required,mobile"`
|
||||
// 系统简化:移除 realName 验证码类型(实名认证功能已移除)
|
||||
ActionType string `json:"actionType" validate:"required,oneof=login register query agentApply bindMobile"`
|
||||
}
|
||||
)
|
||||
|
||||
//============================> notification v1 <============================
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: notification
|
||||
)
|
||||
service main {
|
||||
@doc "get notifications"
|
||||
@handler getNotifications
|
||||
get /notification/list returns (GetNotificationsResp)
|
||||
}
|
||||
|
||||
type Notification {
|
||||
Title string `json:"title"` // 通知标题
|
||||
Content string `json:"content"` // 通知内容 (富文本)
|
||||
NotificationPage string `json:"notificationPage"` // 通知页面
|
||||
StartDate string `json:"startDate"` // 通知开始日期,格式 "YYYY-MM-DD"
|
||||
EndDate string `json:"endDate"` // 通知结束日期,格式 "YYYY-MM-DD"
|
||||
StartTime string `json:"startTime"` // 每天通知开始时间,格式 "HH:MM:SS"
|
||||
EndTime string `json:"endTime"` // 每天通知结束时间,格式 "HH:MM:SS"
|
||||
}
|
||||
|
||||
type (
|
||||
// 获取通知响应体(分页)
|
||||
GetNotificationsResp {
|
||||
Notifications []Notification `json:"notifications"` // 通知列表
|
||||
Total int64 `json:"total"` // 总记录数
|
||||
}
|
||||
)
|
||||
|
||||
30
app/main/api/desc/main.api
Normal file
30
app/main/api/desc/main.api
Normal file
@@ -0,0 +1,30 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "单体服务中心"
|
||||
desc: "单体服务中心"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 前台
|
||||
import "./front/user.api"
|
||||
import "./front/query.api"
|
||||
import "./front/pay.api"
|
||||
import "./front/product.api"
|
||||
import "./front/agent.api"
|
||||
import "./front/app.api"
|
||||
import "./front/authorization.api"
|
||||
// 后台
|
||||
import "./admin/auth.api"
|
||||
import "./admin/menu.api"
|
||||
import "./admin/role.api"
|
||||
import "./admin/order.api"
|
||||
import "./admin/admin_user.api"
|
||||
import "./admin/platform_user.api"
|
||||
import "./admin/notification.api"
|
||||
import "./admin/admin_product.api"
|
||||
import "./admin/admin_feature.api"
|
||||
import "./admin/admin_query.api"
|
||||
import "./admin/admin_agent.api"
|
||||
import "./admin/admin_api.api"
|
||||
import "./admin/admin_role_api.api"
|
||||
Reference in New Issue
Block a user