first commit
This commit is contained in:
202
.cursorrules
Normal file
202
.cursorrules
Normal file
@@ -0,0 +1,202 @@
|
||||
你是一位精通Go-Zero框架的AI编程助手,专门帮助开发基于Go-Zero的微服务API项目。
|
||||
|
||||
熟悉Go-Zero的项目结构和架构模式,包括:
|
||||
- api服务开发
|
||||
- rpc服务开发
|
||||
- model层数据库操作
|
||||
- 中间件实现
|
||||
- 配置文件管理
|
||||
- JWT认证体系
|
||||
- 分布式事务处理
|
||||
- 使用goctl工具生成代码
|
||||
|
||||
项目目录结构说明:
|
||||
```
|
||||
xingfucha-server/ # 项目根目录
|
||||
├── app/ # 应用服务目录
|
||||
│ └── user/ # 用户服务
|
||||
│ ├── cmd/ # 服务启动入口
|
||||
│ │ ├── api/ # API服务
|
||||
│ │ │ ├── desc/ # API接口定义目录
|
||||
│ │ │ │ ├── user/ # 用户模块API定义
|
||||
│ │ │ │ │ └── user.api # 用户API类型定义
|
||||
│ │ │ │ └── main.api # 主API文件
|
||||
│ │ │ ├── etc/ # 配置文件目录
|
||||
│ │ │ │ └── user.yaml # 服务配置文件
|
||||
│ │ │ └── internal/ # 内部代码
|
||||
│ │ │ ├── config/ # 配置结构定义
|
||||
│ │ │ ├── handler/ # HTTP处理器
|
||||
│ │ │ ├── logic/ # 业务逻辑
|
||||
│ │ │ ├── middleware/ # 中间件
|
||||
│ │ │ ├── svc/ # 服务上下文
|
||||
│ │ │ └── types/ # 类型定义
|
||||
│ │ └── rpc/ # RPC服务(如果有)
|
||||
│ └── model/ # 数据库模型
|
||||
├── common/ # 公共代码
|
||||
│ ├── ctxdata/ # 上下文数据处理
|
||||
│ ├── globalkey/ # 全局键值定义
|
||||
│ ├── interceptor/ # 拦截器
|
||||
│ ├── jwt/ # JWT认证
|
||||
│ ├── kqueue/ # 消息队列
|
||||
│ ├── middleware/ # 中间件
|
||||
│ ├── result/ # 统一返回结果
|
||||
│ ├── tool/ # 工具函数
|
||||
│ ├── uniqueid/ # 唯一ID生成
|
||||
│ ├── wxminisub/ # 微信小程序订阅
|
||||
│ └── xerr/ # 错误处理
|
||||
├── data/ # 数据文件目录
|
||||
├── deploy/ # 部署相关文件
|
||||
│ └── template/ # goctl模板
|
||||
├── pkg/ # 可复用的包
|
||||
│ └── lzkit/ # 工具包
|
||||
└── tmp/ # 临时文件目录
|
||||
```
|
||||
|
||||
目录作用说明:
|
||||
1. app/user/cmd/api/:API服务目录
|
||||
- desc/:API接口定义,包含各模块的API文件
|
||||
- main.api:主API文件,导入所有模块API并定义路由
|
||||
- user/user.api:用户模块的请求响应参数定义
|
||||
- order/order.api:订单模块的请求响应参数定义
|
||||
- 其他模块API定义文件
|
||||
- etc/:配置文件目录,存放yaml配置
|
||||
- user.yaml:包含数据库、缓存、JWT等配置信息
|
||||
- internal/:服务内部代码
|
||||
- config/:配置结构定义,对应etc下的yaml文件
|
||||
- handler/:HTTP请求处理器,负责解析请求和返回响应
|
||||
- logic/:业务逻辑实现,处理具体业务
|
||||
- middleware/:HTTP中间件,如认证、日志等
|
||||
- svc/:服务上下文,管理服务依赖(如DB、Cache等)
|
||||
- types/:请求响应的结构体定义,由goctl根据API文件生成(不允许自己修改)
|
||||
|
||||
2. app/user/model/:数据库模型层
|
||||
- userModel.go:用户表模型定义及CRUD方法
|
||||
- userModel_gen.go:goctl工具生成的基础数据库操作代码(不允许自己修改)
|
||||
- vars.go:定义数据库相关变量和常量
|
||||
- 其他数据表模型文件
|
||||
|
||||
3. common/:存放公共代码
|
||||
- ctxdata/:上下文数据处理
|
||||
- globalkey/:全局键值定义
|
||||
- interceptor/:拦截器
|
||||
- jwt/:JWT认证相关
|
||||
- kqueue/:消息队列处理
|
||||
- middleware/:全局中间件
|
||||
- result/:统一返回结果处理
|
||||
- tool/:通用工具函数
|
||||
- uniqueid/:唯一ID生成器
|
||||
- wxminisub/:微信小程序订阅功能
|
||||
- xerr/:统一错误处理
|
||||
|
||||
4. pkg/:可在多个服务间共享的包
|
||||
- lzkit/:通用工具包
|
||||
|
||||
5. deploy/:部署相关文件
|
||||
- template/:goctl代码生成模板
|
||||
|
||||
6. data/:数据文件目录
|
||||
- 用于存放项目相关的数据文件
|
||||
|
||||
7. tmp/:临时文件目录
|
||||
- 用于存放临时生成的文件
|
||||
|
||||
使用goctl生成API服务的步骤:
|
||||
1. 首先确保API定义目录存在:
|
||||
```bash
|
||||
mkdir -p app/user/cmd/api/desc/user
|
||||
```
|
||||
|
||||
2. API文件组织结构(单体服务模式):
|
||||
```
|
||||
app/user/cmd/api/desc/
|
||||
├── user/
|
||||
│ └── user.api # 用户模块的请求响应参数定义
|
||||
├── order/
|
||||
│ └── order.api # 订单模块的请求响应参数定义
|
||||
└── main.api # 主API文件,集中管理所有模块的API定义
|
||||
```
|
||||
|
||||
3. 在app/user/cmd/api/desc/main.api中集中管理所有API:
|
||||
```
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "单体服务API"
|
||||
desc: "集中管理所有模块的API"
|
||||
author: "team"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 导入各模块的类型定义
|
||||
import "user/user.api"
|
||||
import "order/order.api"
|
||||
|
||||
// 各模块下定义路由,例如user模块 desc/user.api
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: user
|
||||
)
|
||||
service main {
|
||||
// 用户模块接口
|
||||
@handler Login
|
||||
post /login (LoginReq) returns (LoginResp)
|
||||
}
|
||||
```
|
||||
|
||||
4. 各模块在下一层定义类型,例如在app/user/cmd/api/desc/user/user.api中只定义用户模块的接口的类型:
|
||||
```
|
||||
type (
|
||||
LoginReq {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
LoginResp {
|
||||
Token string `json:"token"`
|
||||
ExpireAt int64 `json:"expireAt"`
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
5. 使用goctl生成API代码(始终使用main.api):
|
||||
```bash
|
||||
goctl api go -api app/user/cmd/api/desc/main.api -dir app/user/cmd/api --home ./deploy/template
|
||||
```
|
||||
|
||||
注意:无论修改哪个模块的API文件,都需要执行main.api来生成代码,因为这是单体服务模式。
|
||||
6. goctl生成的文件和目录结构:
|
||||
```
|
||||
app/user/cmd/api/
|
||||
├── desc/ # API接口定义目录(已存在)
|
||||
├── etc/ # 配置文件目录
|
||||
│ └── main.yaml # 服务配置文件
|
||||
├── internal/ # 内部代码
|
||||
│ ├── config/ # 配置结构定义
|
||||
│ │ └── config.go # 配置结构体
|
||||
│ ├── handler/ # HTTP处理器
|
||||
│ │ ├── routes.go # 路由注册
|
||||
│ │ └── user/ # 用户模块处理器
|
||||
│ │ └── login_handler.go # 登录处理器
|
||||
│ ├── logic/ # 业务逻辑
|
||||
│ │ └── user/ # 用户模块逻辑
|
||||
│ │ └── login_logic.go # 登录逻辑
|
||||
│ ├── middleware/ # 中间件
|
||||
│ ├── svc/ # 服务上下文
|
||||
│ │ └── service_context.go # 服务上下文定义
|
||||
│ └── types/ # 类型定义
|
||||
│ └── types.go # 请求响应类型定义
|
||||
└── main.go # 服务入口文件
|
||||
```
|
||||
|
||||
7. 生成代码后,才能够实现具体的业务逻辑,例如:
|
||||
- user.api中的`mobileLogin`接口生成的逻辑文件在`app/user/cmd/api/internal/logic/user/mobile_login_logic.go`
|
||||
- user.api中的`wxMiniAuth`接口生成的逻辑文件在`app/user/cmd/api/internal/logic/user/wx_mini_auth_logic.go`
|
||||
- query.api中的`queryService`接口生成的逻辑文件在`app/user/cmd/api/internal/logic/query/query_service_logic.go`
|
||||
|
||||
生成的逻辑文件中需要实现`Logic`结构体的`XXX`方法(方法名与接口名对应),这是业务逻辑的核心部分。
|
||||
|
||||
代码说明尽量简洁,但关键逻辑和go-zero特有模式需要添加注释。
|
||||
|
||||
始终关注性能、安全性和可维护性。
|
||||
|
||||
在回答问题时,优先考虑Go-Zero的特性和设计理念,而不是通用的Go编程模式。
|
||||
30
.gitignore
vendored
Normal file
30
.gitignore
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
# idea
|
||||
.idea
|
||||
.idea/
|
||||
*.iml
|
||||
.DS_Store
|
||||
**/.DS_Store
|
||||
|
||||
#deploy data
|
||||
|
||||
data/*
|
||||
!data/.gitkeep
|
||||
|
||||
# gitlab ci
|
||||
.cache
|
||||
|
||||
#vscode
|
||||
.vscode
|
||||
.vscode/
|
||||
|
||||
/tmp/
|
||||
|
||||
/app/api
|
||||
|
||||
# debug binary (Delve)
|
||||
_debug_bin.*
|
||||
*.exe
|
||||
|
||||
# authorization documents (PDF files)
|
||||
app/main/api/data/authorization_docs/
|
||||
**/authorization_docs/**/*.pdf
|
||||
33
app/main/api/Dockerfile
Normal file
33
app/main/api/Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
FROM golang:1.23.4-alpine AS builder
|
||||
|
||||
LABEL stage=gobuilder
|
||||
|
||||
ENV CGO_ENABLED 0
|
||||
ENV GOPROXY https://goproxy.cn,direct
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
RUN apk update --no-cache && apk add --no-cache tzdata
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
ADD go.mod .
|
||||
ADD go.sum .
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
COPY app/main/api/etc /app/etc
|
||||
COPY app/main/api/static /app/static
|
||||
RUN go build -ldflags="-s -w" -o /app/main app/main/api/main.go
|
||||
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai
|
||||
ENV TZ Asia/Shanghai
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/main /app/main
|
||||
COPY --from=builder /app/etc /app/etc
|
||||
COPY --from=builder /app/static /app/static
|
||||
|
||||
CMD ["./main", "-f", "etc/main.yaml"]
|
||||
BIN
app/main/api/__debug_bin.exe3126434176
Normal file
BIN
app/main/api/__debug_bin.exe3126434176
Normal file
Binary file not shown.
599
app/main/api/desc/admin/admin_agent.api
Normal file
599
app/main/api/desc/admin/admin_agent.api
Normal file
@@ -0,0 +1,599 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "后台代理管理服务"
|
||||
desc: "后台代理相关接口"
|
||||
author: "team"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 代理管理接口
|
||||
@server(
|
||||
prefix: /api/v1/admin/agent
|
||||
group: admin_agent
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 代理分页查询
|
||||
@handler AdminGetAgentList
|
||||
get /list (AdminGetAgentListReq) returns (AdminGetAgentListResp)
|
||||
|
||||
// 代理推广链接分页查询
|
||||
@handler AdminGetAgentLinkList
|
||||
get /agent-link/list (AdminGetAgentLinkListReq) returns (AdminGetAgentLinkListResp)
|
||||
|
||||
// 代理佣金分页查询
|
||||
@handler AdminGetAgentCommissionList
|
||||
get /agent-commission/list (AdminGetAgentCommissionListReq) returns (AdminGetAgentCommissionListResp)
|
||||
|
||||
// 代理佣金状态更新
|
||||
@handler AdminUpdateAgentCommissionStatus
|
||||
post /agent-commission/update-status (AdminUpdateAgentCommissionStatusReq) returns (AdminUpdateAgentCommissionStatusResp)
|
||||
|
||||
// 批量解冻代理佣金
|
||||
@handler AdminBatchUnfreezeAgentCommission
|
||||
post /agent-commission/batch-unfreeze (AdminBatchUnfreezeAgentCommissionReq) returns (AdminBatchUnfreezeAgentCommissionResp)
|
||||
|
||||
// 代理奖励分页查询
|
||||
@handler AdminGetAgentRewardList
|
||||
get /agent-reward/list (AdminGetAgentRewardListReq) returns (AdminGetAgentRewardListResp)
|
||||
|
||||
// 代理提现分页查询
|
||||
@handler AdminGetAgentWithdrawalList
|
||||
get /agent-withdrawal/list (AdminGetAgentWithdrawalListReq) returns (AdminGetAgentWithdrawalListResp)
|
||||
|
||||
// 代理上级抽佣分页查询
|
||||
@handler AdminGetAgentCommissionDeductionList
|
||||
get /agent-commission-deduction/list (AdminGetAgentCommissionDeductionListReq) returns (AdminGetAgentCommissionDeductionListResp)
|
||||
|
||||
// 获取代理钱包信息
|
||||
@handler AdminGetAgentWallet
|
||||
get /wallet/:agent_id (AdminGetAgentWalletReq) returns (AdminGetAgentWalletResp)
|
||||
|
||||
// 修改代理钱包余额
|
||||
@handler AdminUpdateAgentWalletBalance
|
||||
post /wallet/update-balance (AdminUpdateAgentWalletBalanceReq) returns (AdminUpdateAgentWalletBalanceResp)
|
||||
|
||||
// 平台抽佣分页查询
|
||||
@handler AdminGetAgentPlatformDeductionList
|
||||
get /agent-platform-deduction/list (AdminGetAgentPlatformDeductionListReq) returns (AdminGetAgentPlatformDeductionListResp)
|
||||
|
||||
// 代理产品配置分页查询
|
||||
@handler AdminGetAgentProductionConfigList
|
||||
get /agent-production-config/list (AdminGetAgentProductionConfigListReq) returns (AdminGetAgentProductionConfigListResp)
|
||||
|
||||
// 代理产品配置编辑
|
||||
@handler AdminUpdateAgentProductionConfig
|
||||
post /agent-production-config/update (AdminUpdateAgentProductionConfigReq) returns (AdminUpdateAgentProductionConfigResp)
|
||||
|
||||
// 代理会员充值订单分页查询
|
||||
@handler AdminGetAgentMembershipRechargeOrderList
|
||||
get /agent-membership-recharge-order/list (AdminGetAgentMembershipRechargeOrderListReq) returns (AdminGetAgentMembershipRechargeOrderListResp)
|
||||
|
||||
// 代理会员配置分页查询
|
||||
@handler AdminGetAgentMembershipConfigList
|
||||
get /agent-membership-config/list (AdminGetAgentMembershipConfigListReq) returns (AdminGetAgentMembershipConfigListResp)
|
||||
|
||||
// 代理会员配置编辑
|
||||
@handler AdminUpdateAgentMembershipConfig
|
||||
post /agent-membership-config/update (AdminUpdateAgentMembershipConfigReq) returns (AdminUpdateAgentMembershipConfigResp)
|
||||
|
||||
// 银行卡提现审核(确认/拒绝)
|
||||
@handler AdminReviewBankCardWithdrawal
|
||||
post /agent-withdrawal/bank-card/review (AdminReviewBankCardWithdrawalReq) returns (AdminReviewBankCardWithdrawalResp)
|
||||
|
||||
// 获取提现统计数据
|
||||
@handler AdminGetWithdrawalStatistics
|
||||
get /agent-withdrawal/statistics (AdminGetWithdrawalStatisticsReq) returns (AdminGetWithdrawalStatisticsResp)
|
||||
|
||||
// 获取代理订单统计数据
|
||||
@handler AdminGetAgentOrderStatistics
|
||||
get /agent-order/statistics (AdminGetAgentOrderStatisticsReq) returns (AdminGetAgentOrderStatisticsResp)
|
||||
|
||||
// 获取代理统计数据
|
||||
@handler AdminGetAgentStatistics
|
||||
get /statistics (AdminGetAgentStatisticsReq) returns (AdminGetAgentStatisticsResp)
|
||||
|
||||
// 获取代理链接产品统计
|
||||
@handler AdminGetAgentLinkProductStatistics
|
||||
get /agent-link/product-statistics (AdminGetAgentLinkProductStatisticsReq) returns (AdminGetAgentLinkProductStatisticsResp)
|
||||
|
||||
// 获取系统配置
|
||||
@handler AdminGetSystemConfig
|
||||
get /system-config (AdminGetSystemConfigResp)
|
||||
|
||||
// 更新系统配置
|
||||
@handler AdminUpdateSystemConfig
|
||||
post /system-config (AdminUpdateSystemConfigReq) returns (AdminUpdateSystemConfigResp)
|
||||
|
||||
// 代理钱包流水分页查询
|
||||
@handler AdminGetAgentWalletTransactionList
|
||||
get /wallet-transaction/list (AdminGetAgentWalletTransactionListReq) returns (AdminGetAgentWalletTransactionListResp)
|
||||
|
||||
}
|
||||
|
||||
type (
|
||||
// 代理分页查询请求
|
||||
AdminGetAgentListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
Mobile *string `form:"mobile,optional"` // 手机号(可选)
|
||||
Region *string `form:"region,optional"` // 区域(可选)
|
||||
ParentAgentId *int64 `form:"parent_agent_id,optional"` // 上级代理ID(可选)
|
||||
}
|
||||
|
||||
// 代理列表项
|
||||
AgentListItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
UserId int64 `json:"user_id"` // 用户ID
|
||||
ParentAgentId int64 `json:"parent_agent_id"` // 上级代理ID
|
||||
LevelName string `json:"level_name"` // 等级名称
|
||||
Region string `json:"region"` // 区域
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
MembershipExpiryTime string `json:"membership_expiry_time"` // 会员到期时间
|
||||
Balance float64 `json:"balance"` // 钱包余额
|
||||
TotalEarnings float64 `json:"total_earnings"` // 累计收益
|
||||
FrozenBalance float64 `json:"frozen_balance"` // 冻结余额
|
||||
WithdrawnAmount float64 `json:"withdrawn_amount"` // 提现总额
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
IsRealNameVerified bool `json:"is_real_name_verified"` // 是否已实名认证
|
||||
RealName string `json:"real_name"` // 实名姓名
|
||||
IdCard string `json:"id_card"` // 身份证号
|
||||
RealNameStatus string `json:"real_name_status"` // 实名状态(pending/approved/rejected)
|
||||
}
|
||||
|
||||
// 代理分页查询响应
|
||||
AdminGetAgentListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 代理推广链接分页查询请求
|
||||
AdminGetAgentLinkListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *int64 `form:"agent_id,optional"` // 代理ID(可选)
|
||||
ProductName *string `form:"product_name,optional"` // 产品名(可选)
|
||||
LinkIdentifier *string `form:"link_identifier,optional"` // 推广码(可选)
|
||||
}
|
||||
|
||||
// 代理推广链接列表项
|
||||
AgentLinkListItem {
|
||||
AgentId int64 `json:"agent_id"` // 代理ID
|
||||
ProductName string `json:"product_name"` // 产品名
|
||||
Price float64 `json:"price"` // 价格
|
||||
LinkIdentifier string `json:"link_identifier"` // 推广码
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 代理推广链接分页查询响应
|
||||
AdminGetAgentLinkListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentLinkListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 代理佣金分页查询请求
|
||||
AdminGetAgentCommissionListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *int64 `form:"agent_id,optional"` // 代理ID(可选)
|
||||
OrderId *int64 `form:"order_id,optional"` // 订单ID(可选)
|
||||
ProductName *string `form:"product_name,optional"` // 产品名(可选)
|
||||
Status *int64 `form:"status,optional"` // 状态(可选)
|
||||
CreateTimeStart *string `form:"create_time_start,optional"` // 创建时间开始(可选)
|
||||
CreateTimeEnd *string `form:"create_time_end,optional"` // 创建时间结束(可选)
|
||||
}
|
||||
|
||||
// 代理佣金列表项
|
||||
AgentCommissionListItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
AgentId int64 `json:"agent_id"` // 代理ID
|
||||
OrderId int64 `json:"order_id"` // 订单ID
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
ProductName string `json:"product_name"` // 产品名
|
||||
Status int64 `json:"status"` // 状态
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 代理佣金分页查询响应
|
||||
AdminGetAgentCommissionListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentCommissionListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 代理佣金状态更新请求
|
||||
AdminUpdateAgentCommissionStatusReq {
|
||||
Id int64 `json:"id"` // 佣金记录ID
|
||||
Status int64 `json:"status"` // 状态:0-已结算,1-冻结中,2-已取消
|
||||
}
|
||||
|
||||
// 代理佣金状态更新响应
|
||||
AdminUpdateAgentCommissionStatusResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 批量解冻代理佣金请求
|
||||
AdminBatchUnfreezeAgentCommissionReq {
|
||||
AgentId *int64 `json:"agent_id,optional"` // 代理ID,可选。如果不传则解冻所有冻结中的佣金
|
||||
}
|
||||
|
||||
// 批量解冻代理佣金响应
|
||||
AdminBatchUnfreezeAgentCommissionResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
Count int64 `json:"count"` // 解冻的数量
|
||||
Amount float64 `json:"amount"` // 解冻的总金额
|
||||
}
|
||||
|
||||
// 代理奖励分页查询请求
|
||||
AdminGetAgentRewardListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *int64 `form:"agent_id,optional"` // 代理ID(可选)
|
||||
RelationAgentId *int64 `form:"relation_agent_id,optional"` // 关联代理ID(可选)
|
||||
Type *string `form:"type,optional"` // 奖励类型(可选)
|
||||
}
|
||||
|
||||
// 代理奖励列表项
|
||||
AgentRewardListItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
AgentId int64 `json:"agent_id"` // 代理ID
|
||||
RelationAgentId int64 `json:"relation_agent_id"` // 关联代理ID
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
Type string `json:"type"` // 奖励类型
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 代理奖励分页查询响应
|
||||
AdminGetAgentRewardListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentRewardListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 代理提现分页查询请求
|
||||
AdminGetAgentWithdrawalListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *int64 `form:"agent_id,optional"` // 代理ID(可选)
|
||||
Status *int64 `form:"status,optional"` // 状态(可选)
|
||||
WithdrawNo *string `form:"withdraw_no,optional"` // 提现单号(可选)
|
||||
WithdrawType *int64 `form:"withdraw_type,optional"` // 提现类型(可选)1-支付宝,2-银行卡
|
||||
}
|
||||
|
||||
// 代理提现列表项
|
||||
AgentWithdrawalListItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
AgentId int64 `json:"agent_id"` // 代理ID
|
||||
WithdrawNo string `json:"withdraw_no"` // 提现单号
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
ActualAmount float64 `json:"actual_amount"` // 实际到账金额(扣税后)
|
||||
TaxAmount float64 `json:"tax_amount"` // 扣税金额
|
||||
Status int64 `json:"status"` // 状态
|
||||
PayeeAccount string `json:"payee_account"` // 收款账户
|
||||
Remark string `json:"remark"` // 备注
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
WithdrawType int64 `json:"withdraw_type"` // 提现类型:1-支付宝,2-银行卡
|
||||
BankCardNo string `json:"bank_card_no"` // 银行卡号
|
||||
BankName string `json:"bank_name"` // 开户支行
|
||||
PayeeName string `json:"payee_name"` // 收款人姓名
|
||||
}
|
||||
|
||||
// 代理提现分页查询响应
|
||||
AdminGetAgentWithdrawalListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentWithdrawalListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 代理抽佣分页查询请求
|
||||
AdminGetAgentCommissionDeductionListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *int64 `form:"agent_id,optional"` // 代理ID(可选)
|
||||
ProductName *string `form:"product_name,optional"` // 产品名(可选)
|
||||
Type *string `form:"type,optional"` // 类型(cost/pricing,可选)
|
||||
Status *int64 `form:"status,optional"` // 状态(可选)
|
||||
}
|
||||
|
||||
// 代理抽佣列表项
|
||||
AgentCommissionDeductionListItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
AgentId int64 `json:"agent_id"` // 代理ID
|
||||
DeductedAgentId int64 `json:"deducted_agent_id"` // 被扣代理ID
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
ProductName string `json:"product_name"` // 产品名
|
||||
Type string `json:"type"` // 类型(cost/pricing)
|
||||
Status int64 `json:"status"` // 状态
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 代理抽佣分页查询响应
|
||||
AdminGetAgentCommissionDeductionListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentCommissionDeductionListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 平台抽佣分页查询请求
|
||||
AdminGetAgentPlatformDeductionListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *int64 `form:"agent_id,optional"` // 代理ID(可选)
|
||||
Type *string `form:"type,optional"` // 类型(cost/pricing,可选)
|
||||
Status *int64 `form:"status,optional"` // 状态(可选)
|
||||
}
|
||||
|
||||
// 平台抽佣列表项
|
||||
AgentPlatformDeductionListItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
AgentId int64 `json:"agent_id"` // 代理ID
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
Type string `json:"type"` // 类型(cost/pricing)
|
||||
Status int64 `json:"status"` // 状态
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 平台抽佣分页查询响应
|
||||
AdminGetAgentPlatformDeductionListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentPlatformDeductionListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 代理产品配置分页查询请求
|
||||
AdminGetAgentProductionConfigListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
ProductName *string `form:"product_name,optional"` // 产品名(可选)
|
||||
Id *int64 `form:"id,optional"` // 配置ID(可选)
|
||||
}
|
||||
|
||||
// 代理产品配置分页查询响应
|
||||
AdminGetAgentProductionConfigListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentProductionConfigItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 代理产品配置列表项
|
||||
AgentProductionConfigItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
ProductName string `json:"product_name"` // 产品名
|
||||
CostPrice float64 `json:"cost_price"` // 成本
|
||||
PriceRangeMin float64 `json:"price_range_min"` // 最低定价
|
||||
PriceRangeMax float64 `json:"price_range_max"` // 最高定价
|
||||
PricingStandard float64 `json:"pricing_standard"` // 定价标准
|
||||
OverpricingRatio float64 `json:"overpricing_ratio"` // 超价比例
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 代理产品配置编辑请求
|
||||
AdminUpdateAgentProductionConfigReq {
|
||||
Id int64 `json:"id"` // 主键
|
||||
CostPrice float64 `json:"cost_price"` // 成本
|
||||
PriceRangeMin float64 `json:"price_range_min"` // 最低定价
|
||||
PriceRangeMax float64 `json:"price_range_max"` // 最高定价
|
||||
PricingStandard float64 `json:"pricing_standard"` // 定价标准
|
||||
OverpricingRatio float64 `json:"overpricing_ratio"` // 超价比例
|
||||
}
|
||||
|
||||
// 代理产品配置编辑响应
|
||||
AdminUpdateAgentProductionConfigResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 代理会员充值订单分页查询请求
|
||||
AdminGetAgentMembershipRechargeOrderListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
UserId *int64 `form:"user_id,optional"` // 用户ID(可选)
|
||||
AgentId *int64 `form:"agent_id,optional"` // 代理ID(可选)
|
||||
OrderNo *string `form:"order_no,optional"` // 订单号(可选)
|
||||
PlatformOrderId *string `form:"platform_order_id,optional"` // 平台订单号(可选)
|
||||
Status *string `form:"status,optional"` // 状态(可选)
|
||||
PaymentMethod *string `form:"payment_method,optional"` // 支付方式(可选)
|
||||
}
|
||||
|
||||
// 代理会员充值订单列表项
|
||||
AgentMembershipRechargeOrderListItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
UserId int64 `json:"user_id"` // 用户ID
|
||||
AgentId int64 `json:"agent_id"` // 代理ID
|
||||
LevelName string `json:"level_name"` // 等级名称
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
PaymentMethod string `json:"payment_method"` // 支付方式
|
||||
OrderNo string `json:"order_no"` // 订单号
|
||||
PlatformOrderId string `json:"platform_order_id"` // 平台订单号
|
||||
Status string `json:"status"` // 状态
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 代理会员充值订单分页查询响应
|
||||
AdminGetAgentMembershipRechargeOrderListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentMembershipRechargeOrderListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 代理会员配置分页查询请求
|
||||
AdminGetAgentMembershipConfigListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
LevelName *string `form:"level_name,optional"` // 会员级别名称(可选)
|
||||
}
|
||||
|
||||
// 代理会员配置分页查询响应
|
||||
AdminGetAgentMembershipConfigListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentMembershipConfigListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 代理会员配置列表项
|
||||
AgentMembershipConfigListItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
LevelName string `json:"level_name"` // 会员级别名称
|
||||
Price *float64 `json:"price"` // 会员年费
|
||||
ReportCommission *float64 `json:"report_commission"` // 直推报告收益
|
||||
LowerActivityReward *float64 `json:"lower_activity_reward"` // 下级活跃奖励金额
|
||||
NewActivityReward *float64 `json:"new_activity_reward"` // 新增活跃奖励金额
|
||||
LowerStandardCount *int64 `json:"lower_standard_count"` // 活跃下级达标个数
|
||||
NewLowerStandardCount *int64 `json:"new_lower_standard_count"` // 新增活跃下级达标个数
|
||||
LowerWithdrawRewardRatio *float64 `json:"lower_withdraw_reward_ratio"` // 下级提现奖励比例
|
||||
LowerConvertVipReward *float64 `json:"lower_convert_vip_reward"` // 下级转化VIP奖励
|
||||
LowerConvertSvipReward *float64 `json:"lower_convert_svip_reward"` // 下级转化SVIP奖励
|
||||
ExemptionAmount *float64 `json:"exemption_amount"` // 免责金额
|
||||
PriceIncreaseMax *float64 `json:"price_increase_max"` // 提价最高金额
|
||||
PriceRatio *float64 `json:"price_ratio"` // 提价区间收取比例
|
||||
PriceIncreaseAmount *float64 `json:"price_increase_amount"` // 在原本成本上加价的金额
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 代理会员配置编辑请求
|
||||
AdminUpdateAgentMembershipConfigReq {
|
||||
Id int64 `json:"id"` // 主键
|
||||
LevelName string `json:"level_name"` // 会员级别名称
|
||||
Price float64 `json:"price"` // 会员年费
|
||||
ReportCommission float64 `json:"report_commission"` // 直推报告收益
|
||||
LowerActivityReward *float64 `json:"lower_activity_reward,optional,omitempty"` // 下级活跃奖励金额
|
||||
NewActivityReward *float64 `json:"new_activity_reward,optional,omitempty"` // 新增活跃奖励金额
|
||||
LowerStandardCount *int64 `json:"lower_standard_count,optional,omitempty"` // 活跃下级达标个数
|
||||
NewLowerStandardCount *int64 `json:"new_lower_standard_count,optional,omitempty"` // 新增活跃下级达标个数
|
||||
LowerWithdrawRewardRatio *float64 `json:"lower_withdraw_reward_ratio,optional,omitempty"` // 下级提现奖励比例
|
||||
LowerConvertVipReward *float64 `json:"lower_convert_vip_reward,optional,omitempty"` // 下级转化VIP奖励
|
||||
LowerConvertSvipReward *float64 `json:"lower_convert_svip_reward,optional,omitempty"` // 下级转化SVIP奖励
|
||||
ExemptionAmount *float64 `json:"exemption_amount,optional,omitempty"` // 免责金额
|
||||
PriceIncreaseMax *float64 `json:"price_increase_max,optional,omitempty"` // 提价最高金额
|
||||
PriceRatio *float64 `json:"price_ratio,optional,omitempty"` // 提价区间收取比例
|
||||
PriceIncreaseAmount *float64 `json:"price_increase_amount,optional,omitempty"` // 在原本成本上加价的金额
|
||||
}
|
||||
|
||||
// 代理会员配置编辑响应
|
||||
AdminUpdateAgentMembershipConfigResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 银行卡提现审核请求
|
||||
AdminReviewBankCardWithdrawalReq {
|
||||
WithdrawalId int64 `json:"withdrawal_id"` // 提现记录ID
|
||||
Action int64 `json:"action"` // 操作:1-确认,2-拒绝
|
||||
Remark string `json:"remark"` // 备注(拒绝时必填)
|
||||
}
|
||||
|
||||
// 银行卡提现审核响应
|
||||
AdminReviewBankCardWithdrawalResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 获取提现统计数据请求
|
||||
AdminGetWithdrawalStatisticsReq {
|
||||
}
|
||||
|
||||
// 获取提现统计数据响应
|
||||
AdminGetWithdrawalStatisticsResp {
|
||||
TotalWithdrawalAmount float64 `json:"total_withdrawal_amount"` // 总提现金额
|
||||
TodayWithdrawalAmount float64 `json:"today_withdrawal_amount"` // 今日提现金额
|
||||
TotalActualAmount float64 `json:"total_actual_amount"` // 总实际到账金额
|
||||
TotalTaxAmount float64 `json:"total_tax_amount"` // 总扣税金额
|
||||
}
|
||||
|
||||
// 获取代理订单统计数据请求
|
||||
AdminGetAgentOrderStatisticsReq {
|
||||
}
|
||||
|
||||
// 获取代理订单统计数据响应
|
||||
AdminGetAgentOrderStatisticsResp {
|
||||
TotalAgentOrderCount int64 `json:"total_agent_order_count"` // 总代理订单数
|
||||
TodayAgentOrderCount int64 `json:"today_agent_order_count"` // 今日代理订单数
|
||||
}
|
||||
|
||||
// 获取代理统计数据请求
|
||||
AdminGetAgentStatisticsReq {
|
||||
}
|
||||
|
||||
// 获取代理统计数据响应
|
||||
AdminGetAgentStatisticsResp {
|
||||
TotalAgentCount int64 `json:"total_agent_count"` // 总代理数
|
||||
TodayAgentCount int64 `json:"today_agent_count"` // 今日新增代理数
|
||||
}
|
||||
|
||||
// 获取代理链接产品统计请求
|
||||
AdminGetAgentLinkProductStatisticsReq {
|
||||
}
|
||||
|
||||
// 代理链接产品统计列表项
|
||||
AgentLinkProductStatisticsItem {
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
LinkCount int64 `json:"link_count"` // 推广链接数量
|
||||
}
|
||||
|
||||
// 获取代理链接产品统计响应
|
||||
AdminGetAgentLinkProductStatisticsResp {
|
||||
Items []AgentLinkProductStatisticsItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 获取代理钱包信息请求
|
||||
AdminGetAgentWalletReq {
|
||||
AgentId int64 `path:"agent_id"` // 代理ID
|
||||
}
|
||||
|
||||
// 获取代理钱包信息响应
|
||||
AdminGetAgentWalletResp {
|
||||
Balance float64 `json:"balance"` // 可用余额
|
||||
FrozenBalance float64 `json:"frozen_balance"` // 冻结余额
|
||||
TotalEarnings float64 `json:"total_earnings"` // 总收益
|
||||
}
|
||||
|
||||
// 修改代理钱包余额请求
|
||||
AdminUpdateAgentWalletBalanceReq {
|
||||
AgentId int64 `json:"agent_id"` // 代理ID
|
||||
Amount float64 `json:"amount"` // 修改金额(正数增加,负数减少)
|
||||
}
|
||||
|
||||
// 修改代理钱包余额响应
|
||||
AdminUpdateAgentWalletBalanceResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
Balance float64 `json:"balance"` // 修改后的余额
|
||||
}
|
||||
|
||||
// 更新系统配置请求
|
||||
AdminUpdateSystemConfigReq {
|
||||
CommissionSafeMode *bool `json:"commission_safe_mode,optional"` // 佣金安全防御模式:true-冻结模式,false-直接结算模式
|
||||
}
|
||||
|
||||
// 更新系统配置响应
|
||||
AdminUpdateSystemConfigResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 获取系统配置响应
|
||||
AdminGetSystemConfigResp {
|
||||
CommissionSafeMode bool `json:"commission_safe_mode"` // 佣金安全防御模式
|
||||
}
|
||||
|
||||
// 代理钱包流水分页查询请求
|
||||
AdminGetAgentWalletTransactionListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId int64 `form:"agent_id"` // 代理ID
|
||||
TransactionType *string `form:"transaction_type,optional"` // 交易类型(可选)
|
||||
CreateTimeStart *string `form:"create_time_start,optional"` // 创建时间开始(可选)
|
||||
CreateTimeEnd *string `form:"create_time_end,optional"` // 创建时间结束(可选)
|
||||
}
|
||||
|
||||
// 代理钱包流水列表项
|
||||
AgentWalletTransactionListItem {
|
||||
Id int64 `json:"id"` // 主键
|
||||
AgentId int64 `json:"agent_id"` // 代理ID
|
||||
TransactionType string `json:"transaction_type"` // 交易类型
|
||||
Amount float64 `json:"amount"` // 变动金额
|
||||
BalanceBefore float64 `json:"balance_before"` // 变动前余额
|
||||
BalanceAfter float64 `json:"balance_after"` // 变动后余额
|
||||
FrozenBalanceBefore float64 `json:"frozen_balance_before"` // 变动前冻结余额
|
||||
FrozenBalanceAfter float64 `json:"frozen_balance_after"` // 变动后冻结余额
|
||||
TransactionId *string `json:"transaction_id"` // 关联交易ID
|
||||
RelatedUserId *int64 `json:"related_user_id"` // 关联用户ID
|
||||
Remark *string `json:"remark"` // 备注说明
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// 代理钱包流水分页查询响应
|
||||
AdminGetAgentWalletTransactionListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []AgentWalletTransactionListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
)
|
||||
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 int64 `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 int64 `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 int64 `json:"id"`
|
||||
}
|
||||
|
||||
// 更新API请求
|
||||
AdminUpdateApiReq {
|
||||
Id int64 `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 int64 `path:"id"`
|
||||
}
|
||||
|
||||
// 删除API响应
|
||||
AdminDeleteApiResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 批量更新API状态请求
|
||||
AdminBatchUpdateApiStatusReq {
|
||||
Ids []int64 `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)
|
||||
}
|
||||
132
app/main/api/desc/admin/admin_feature.api
Normal file
132
app/main/api/desc/admin/admin_feature.api
Normal file
@@ -0,0 +1,132 @@
|
||||
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"` // 描述
|
||||
CostPrice float64 `json:"cost_price"` // 成本价
|
||||
}
|
||||
// 创建功能响应
|
||||
AdminCreateFeatureResp {
|
||||
Id int64 `json:"id"` // 功能ID
|
||||
}
|
||||
// 更新功能请求
|
||||
AdminUpdateFeatureReq {
|
||||
Id int64 `path:"id"` // 功能ID
|
||||
ApiId *string `json:"api_id,optional"` // API标识
|
||||
Name *string `json:"name,optional"` // 描述
|
||||
CostPrice *float64 `json:"cost_price,optional"` // 成本价
|
||||
}
|
||||
// 更新功能响应
|
||||
AdminUpdateFeatureResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 删除功能请求
|
||||
AdminDeleteFeatureReq {
|
||||
Id int64 `path:"id"` // 功能ID
|
||||
}
|
||||
// 删除功能响应
|
||||
AdminDeleteFeatureResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 获取功能列表请求
|
||||
AdminGetFeatureListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
ApiId *string `form:"api_id,optional"` // API标识
|
||||
Name *string `form:"name,optional"` // 描述
|
||||
}
|
||||
// 功能列表项
|
||||
FeatureListItem {
|
||||
Id int64 `json:"id"` // 功能ID
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 描述
|
||||
CostPrice float64 `json:"cost_price"` // 成本价
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
// 获取功能列表响应
|
||||
AdminGetFeatureListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []FeatureListItem `json:"items"` // 列表数据
|
||||
}
|
||||
// 获取功能详情请求
|
||||
AdminGetFeatureDetailReq {
|
||||
Id int64 `path:"id"` // 功能ID
|
||||
}
|
||||
// 获取功能详情响应
|
||||
AdminGetFeatureDetailResp {
|
||||
Id int64 `json:"id"` // 功能ID
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 描述
|
||||
CostPrice float64 `json:"cost_price"` // 成本价
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
// 配置功能示例数据请求
|
||||
AdminConfigFeatureExampleReq {
|
||||
FeatureId int64 `json:"feature_id"` // 功能ID
|
||||
Data string `json:"data"` // 示例数据JSON
|
||||
}
|
||||
// 配置功能示例数据响应
|
||||
AdminConfigFeatureExampleResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 查看功能示例数据请求
|
||||
AdminGetFeatureExampleReq {
|
||||
FeatureId int64 `path:"feature_id"` // 功能ID
|
||||
}
|
||||
// 查看功能示例数据响应
|
||||
AdminGetFeatureExampleResp {
|
||||
Id int64 `json:"id"` // 示例数据ID
|
||||
FeatureId int64 `json:"feature_id"` // 功能ID
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Data string `json:"data"` // 示例数据JSON
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
)
|
||||
|
||||
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 int64 `json:"id"` // 产品ID
|
||||
}
|
||||
|
||||
// 更新产品请求
|
||||
AdminUpdateProductReq {
|
||||
Id int64 `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 int64 `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 int64 `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 int64 `path:"id"` // 产品ID
|
||||
}
|
||||
|
||||
// 获取产品详情响应
|
||||
AdminGetProductDetailResp {
|
||||
Id int64 `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 int64 `path:"product_id"` // 产品ID
|
||||
}
|
||||
|
||||
// 获取产品功能列表响应Item
|
||||
AdminGetProductFeatureListResp {
|
||||
Id int64 `json:"id"` // 关联ID
|
||||
ProductId int64 `json:"product_id"` // 产品ID
|
||||
FeatureId int64 `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 int64 `json:"feature_id"` // 功能ID
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
Enable int64 `json:"enable"` // 是否启用
|
||||
IsImportant int64 `json:"is_important"` // 是否重要
|
||||
}
|
||||
|
||||
// 更新产品功能关联请求(批量)
|
||||
AdminUpdateProductFeaturesReq {
|
||||
ProductId int64 `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 int64 `path:"order_id"`
|
||||
}
|
||||
|
||||
type AdminGetQueryDetailByOrderIdResp {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
OrderId int64 `json:"order_id"` // 订单ID
|
||||
UserId int64 `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 int64 `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 int64 `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 int64 `json:"id"` // 主键ID
|
||||
CleanupLogId int64 `json:"cleanup_log_id"` // 清理日志ID
|
||||
QueryId int64 `json:"query_id"` // 查询ID
|
||||
OrderId int64 `json:"order_id"` // 订单ID
|
||||
UserId int64 `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 int64 `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 int64 `json:"id"` // 主键ID
|
||||
ConfigValue string `json:"config_value"` // 配置值
|
||||
Status int64 `json:"status"` // 状态:1-启用,0-禁用
|
||||
}
|
||||
|
||||
type AdminUpdateQueryCleanupConfigResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
21
app/main/api/desc/admin/admin_queue.api
Normal file
21
app/main/api/desc/admin/admin_queue.api
Normal file
@@ -0,0 +1,21 @@
|
||||
syntax = "v1"
|
||||
|
||||
info(
|
||||
title: "Admin Queue管理"
|
||||
desc: "管理员队列管理接口"
|
||||
author: "team"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: admin_queue
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
|
||||
}
|
||||
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 int64 `path:"role_id"`
|
||||
}
|
||||
|
||||
// 获取角色API权限列表响应
|
||||
AdminGetRoleApiListResp {
|
||||
Items []AdminRoleApiInfo `json:"items"`
|
||||
}
|
||||
|
||||
// 角色API权限信息
|
||||
AdminRoleApiInfo {
|
||||
Id int64 `json:"id"`
|
||||
RoleId int64 `json:"role_id"`
|
||||
ApiId int64 `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 int64 `json:"role_id"`
|
||||
ApiIds []int64 `json:"api_ids"`
|
||||
}
|
||||
|
||||
// 分配角色API权限响应
|
||||
AdminAssignRoleApiResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 移除角色API权限请求
|
||||
AdminRemoveRoleApiReq {
|
||||
RoleId int64 `json:"role_id"`
|
||||
ApiIds []int64 `json:"api_ids"`
|
||||
}
|
||||
|
||||
// 移除角色API权限响应
|
||||
AdminRemoveRoleApiResp {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 更新角色API权限请求
|
||||
AdminUpdateRoleApiReq {
|
||||
RoleId int64 `json:"role_id"`
|
||||
ApiIds []int64 `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 int64 `json:"id"` // 用户ID
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
RoleIds []int64 `json:"role_ids"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
AdminGetUserDetailReq {
|
||||
Id int64 `path:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
AdminGetUserDetailResp {
|
||||
Id int64 `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 []int64 `json:"role_ids"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
AdminCreateUserReq {
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Status int64 `json:"status,default=1"` // 状态:0-禁用,1-启用
|
||||
RoleIds []int64 `json:"role_ids"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
AdminCreateUserResp {
|
||||
Id int64 `json:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
AdminUpdateUserReq {
|
||||
Id int64 `path:"id"` // 用户ID
|
||||
Username *string `json:"username,optional"` // 用户名
|
||||
RealName *string `json:"real_name,optional"` // 真实姓名
|
||||
Status *int64 `json:"status,optional"` // 状态:0-禁用,1-启用
|
||||
RoleIds []int64 `json:"role_ids,optional"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
AdminUpdateUserResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
AdminDeleteUserReq {
|
||||
Id int64 `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 int64 `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"`
|
||||
}
|
||||
)
|
||||
147
app/main/api/desc/admin/menu.api
Normal file
147
app/main/api/desc/admin/menu.api
Normal file
@@ -0,0 +1,147 @@
|
||||
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 int64 `json:"id"` // 菜单ID
|
||||
Pid int64 `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 int64 `path:"id"` // 菜单ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
GetMenuDetailResp {
|
||||
Id int64 `json:"id"` // 菜单ID
|
||||
Pid int64 `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 int64 `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 int64 `json:"id"` // 菜单ID
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
UpdateMenuReq {
|
||||
Id int64 `path:"id"` // 菜单ID
|
||||
Pid int64 `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 int64 `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 int64 `json:"id"` // 通知ID
|
||||
}
|
||||
|
||||
// 更新通知请求
|
||||
AdminUpdateNotificationReq {
|
||||
Id int64 `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 int64 `path:"id"` // 通知ID
|
||||
}
|
||||
|
||||
// 删除通知响应
|
||||
AdminDeleteNotificationResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 获取通知详情请求
|
||||
AdminGetNotificationDetailReq {
|
||||
Id int64 `path:"id"` // 通知ID
|
||||
}
|
||||
|
||||
// 获取通知详情响应
|
||||
AdminGetNotificationDetailResp {
|
||||
Id int64 `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 int64 `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)
|
||||
}
|
||||
250
app/main/api/desc/admin/order.api
Normal file
250
app/main/api/desc/admin/order.api
Normal file
@@ -0,0 +1,250 @@
|
||||
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)
|
||||
|
||||
@doc "获取退款统计数据"
|
||||
@handler AdminGetRefundStatistics
|
||||
get /refund-statistics (AdminGetRefundStatisticsReq) returns (AdminGetRefundStatisticsResp)
|
||||
|
||||
@doc "获取收入和利润统计数据"
|
||||
@handler AdminGetRevenueStatistics
|
||||
get /revenue-statistics (AdminGetRevenueStatisticsReq) returns (AdminGetRevenueStatisticsResp)
|
||||
|
||||
@doc "获取订单来源统计数据"
|
||||
@handler AdminGetOrderSourceStatistics
|
||||
get /source-statistics (AdminGetOrderSourceStatisticsReq) returns (AdminGetOrderSourceStatisticsResp)
|
||||
|
||||
@doc "获取订单统计数据"
|
||||
@handler AdminGetOrderStatistics
|
||||
get /statistics (AdminGetOrderStatisticsReq) returns (AdminGetOrderStatisticsResp)
|
||||
}
|
||||
|
||||
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-支付失败
|
||||
IsPromotion int64 `form:"is_promotion,optional,default=-1"` // 是否推广订单:0-否,1-是
|
||||
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"` // 退款时间结束
|
||||
SalesCost float64 `form:"sales_cost,optional"` // 成本价
|
||||
QueryName string `form:"query_name,optional"` // 被查询人姓名(通过 query_user_record 表追溯订单)
|
||||
QueryIdCard string `form:"query_id_card,optional"` // 被查询人身份证(通过 query_user_record 表追溯订单)
|
||||
QueryMobile string `form:"query_mobile,optional"` // 被查询人手机号(通过 query_user_record 表追溯订单)
|
||||
}
|
||||
// 列表响应
|
||||
AdminGetOrderListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []OrderListItem `json:"items"` // 列表
|
||||
}
|
||||
// 列表项
|
||||
OrderListItem {
|
||||
Id int64 `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"` // 金额
|
||||
SalesCost float64 `json:"sales_cost"` // 成本价
|
||||
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"` // 退款时间
|
||||
IsPromotion int64 `json:"is_promotion"` // 是否推广订单:0-否,1-是
|
||||
IsAgentOrder bool `json:"is_agent_order"` // 是否是代理订单
|
||||
AgentProcessStatus string `json:"agent_process_status"` // 代理事务处理状态:not_agent-非代理订单,success-处理成功,failed-处理失败,pending-待处理
|
||||
|
||||
}
|
||||
// 详情请求
|
||||
AdminGetOrderDetailReq {
|
||||
Id int64 `path:"id"` // 订单ID
|
||||
}
|
||||
// 详情响应
|
||||
AdminGetOrderDetailResp {
|
||||
Id int64 `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"` // 金额
|
||||
SalesCost float64 `json:"sales_cost"` // 成本价
|
||||
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"` // 退款时间
|
||||
IsPromotion int64 `json:"is_promotion"` // 是否推广订单:0-否,1-是
|
||||
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-支付失败
|
||||
IsPromotion int64 `json:"is_promotion,default=0"` // 是否推广订单:0-否,1-是
|
||||
}
|
||||
// 创建响应
|
||||
AdminCreateOrderResp {
|
||||
Id int64 `json:"id"` // 订单ID
|
||||
}
|
||||
// 更新请求
|
||||
AdminUpdateOrderReq {
|
||||
Id int64 `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"` // 退款时间
|
||||
IsPromotion *int64 `json:"is_promotion,optional"` // 是否推广订单:0-否,1-是
|
||||
}
|
||||
// 更新响应
|
||||
AdminUpdateOrderResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 删除请求
|
||||
AdminDeleteOrderReq {
|
||||
Id int64 `path:"id"` // 订单ID
|
||||
}
|
||||
// 删除响应
|
||||
AdminDeleteOrderResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
// 退款请求
|
||||
AdminRefundOrderReq {
|
||||
Id int64 `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 int64 `path:"id"` // 订单ID
|
||||
}
|
||||
// 重新执行代理处理响应
|
||||
AdminRetryAgentProcessResp {
|
||||
Status string `json:"status"` // 执行状态:success-成功,already_processed-已处理,failed-失败
|
||||
Message string `json:"message"` // 执行结果消息
|
||||
ProcessedAt string `json:"processed_at"` // 处理时间
|
||||
}
|
||||
|
||||
// 获取退款统计数据请求
|
||||
AdminGetRefundStatisticsReq {
|
||||
}
|
||||
|
||||
// 获取退款统计数据响应
|
||||
AdminGetRefundStatisticsResp {
|
||||
TotalRefundAmount float64 `json:"total_refund_amount"` // 总退款金额
|
||||
TodayRefundAmount float64 `json:"today_refund_amount"` // 今日退款金额
|
||||
}
|
||||
|
||||
// 获取收入和利润统计数据请求
|
||||
AdminGetRevenueStatisticsReq {
|
||||
}
|
||||
|
||||
// 获取收入和利润统计数据响应
|
||||
AdminGetRevenueStatisticsResp {
|
||||
TotalRevenueAmount float64 `json:"total_revenue_amount"` // 总收入金额
|
||||
TodayRevenueAmount float64 `json:"today_revenue_amount"` // 今日收入金额
|
||||
TotalProfitAmount float64 `json:"total_profit_amount"` // 总利润金额
|
||||
TodayProfitAmount float64 `json:"today_profit_amount"` // 今日利润金额
|
||||
}
|
||||
|
||||
// 获取订单来源统计数据请求
|
||||
AdminGetOrderSourceStatisticsReq {
|
||||
}
|
||||
|
||||
// 订单来源统计项
|
||||
OrderSourceStatisticsItem {
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
OrderCount int64 `json:"order_count"` // 订单数量
|
||||
}
|
||||
|
||||
// 获取订单来源统计数据响应
|
||||
AdminGetOrderSourceStatisticsResp {
|
||||
Items []OrderSourceStatisticsItem `json:"items"` // 订单来源统计列表
|
||||
}
|
||||
|
||||
// 获取订单统计数据请求
|
||||
AdminGetOrderStatisticsReq {
|
||||
Dimension string `form:"dimension"` // 时间维度:day-日(当月1号到今天),month-月(今年1月到当月),year-年(过去5年),all-全部(按日统计)
|
||||
}
|
||||
|
||||
// 订单统计项
|
||||
OrderStatisticsItem {
|
||||
Date string `json:"date"` // 日期
|
||||
Count int64 `json:"count"` // 订单数量
|
||||
Amount float64 `json:"amount"` // 订单金额
|
||||
}
|
||||
|
||||
// 获取订单统计数据响应
|
||||
AdminGetOrderStatisticsResp {
|
||||
Items []OrderStatisticsItem `json:"items"` // 订单统计列表
|
||||
}
|
||||
)
|
||||
122
app/main/api/desc/admin/platform_user.api
Normal file
122
app/main/api/desc/admin/platform_user.api
Normal file
@@ -0,0 +1,122 @@
|
||||
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 int64 `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 int64 `path:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
AdminGetPlatformUserDetailResp {
|
||||
Id int64 `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 int64 `json:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
AdminUpdatePlatformUserReq {
|
||||
Id int64 `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 int64 `path:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
AdminDeletePlatformUserResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
182
app/main/api/desc/admin/promotion.api
Normal file
182
app/main/api/desc/admin/promotion.api
Normal file
@@ -0,0 +1,182 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "推广服务"
|
||||
desc: "推广服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/promotion/link
|
||||
group: admin_promotion
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取推广链接列表"
|
||||
@handler GetPromotionLinkList
|
||||
get /list (GetPromotionLinkListReq) returns (GetPromotionLinkListResp)
|
||||
|
||||
@doc "获取推广链接详情"
|
||||
@handler GetPromotionLinkDetail
|
||||
get /detail/:id (GetPromotionLinkDetailReq) returns (GetPromotionLinkDetailResp)
|
||||
|
||||
@doc "创建推广链接"
|
||||
@handler CreatePromotionLink
|
||||
post /create (CreatePromotionLinkReq) returns (CreatePromotionLinkResp)
|
||||
|
||||
@doc "更新推广链接"
|
||||
@handler UpdatePromotionLink
|
||||
put /update/:id (UpdatePromotionLinkReq) returns (UpdatePromotionLinkResp)
|
||||
|
||||
@doc "删除推广链接"
|
||||
@handler DeletePromotionLink
|
||||
delete /delete/:id (DeletePromotionLinkReq) returns (DeletePromotionLinkResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
GetPromotionLinkListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
Name string `form:"name,optional"` // 链接名称
|
||||
Url string `form:"url,optional"` // 推广链接URL
|
||||
}
|
||||
|
||||
// 列表响应
|
||||
GetPromotionLinkListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []PromotionLinkItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
// 列表项
|
||||
PromotionLinkItem {
|
||||
Id int64 `json:"id"` // 链接ID
|
||||
Name string `json:"name"` // 链接名称
|
||||
Url string `json:"url"` // 推广链接URL
|
||||
ClickCount int64 `json:"click_count"` // 点击数
|
||||
PayCount int64 `json:"pay_count"` // 付费次数
|
||||
PayAmount string `json:"pay_amount"` // 付费金额
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
LastClickTime string `json:"last_click_time,optional"` // 最后点击时间
|
||||
LastPayTime string `json:"last_pay_time,optional"` // 最后付费时间
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
GetPromotionLinkDetailReq {
|
||||
Id int64 `path:"id"` // 链接ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
GetPromotionLinkDetailResp {
|
||||
Name string `json:"name"` // 链接名称
|
||||
Url string `json:"url"` // 推广链接URL
|
||||
ClickCount int64 `json:"click_count"` // 点击数
|
||||
PayCount int64 `json:"pay_count"` // 付费次数
|
||||
PayAmount string `json:"pay_amount"` // 付费金额
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
LastClickTime string `json:"last_click_time,optional"` // 最后点击时间
|
||||
LastPayTime string `json:"last_pay_time,optional"` // 最后付费时间
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
CreatePromotionLinkReq {
|
||||
Name string `json:"name"` // 链接名称
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
CreatePromotionLinkResp {
|
||||
Id int64 `json:"id"` // 链接ID
|
||||
Url string `json:"url"` // 生成的推广链接URL
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
UpdatePromotionLinkReq {
|
||||
Id int64 `path:"id"` // 链接ID
|
||||
Name *string `json:"name,optional"` // 链接名称
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
UpdatePromotionLinkResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
DeletePromotionLinkReq {
|
||||
Id int64 `path:"id"` // 链接ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
DeletePromotionLinkResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/promotion/link
|
||||
group: admin_promotion
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "记录链接点击"
|
||||
@handler RecordLinkClick
|
||||
get /record/:path (RecordLinkClickReq) returns (RecordLinkClickResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 记录链接点击请求
|
||||
RecordLinkClickReq {
|
||||
Path string `path:"path"` // 链接路径
|
||||
}
|
||||
|
||||
// 记录链接点击响应
|
||||
RecordLinkClickResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
@server (
|
||||
prefix: api/v1/admin/promotion/stats
|
||||
group: admin_promotion
|
||||
middleware: AdminAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "获取推广历史记录"
|
||||
@handler GetPromotionStatsHistory
|
||||
get /history (GetPromotionStatsHistoryReq) returns ([]PromotionStatsHistoryItem)
|
||||
|
||||
@doc "获取推广总统计"
|
||||
@handler GetPromotionStatsTotal
|
||||
get /total (GetPromotionStatsTotalReq) returns (GetPromotionStatsTotalResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 获取推广历史记录请求
|
||||
GetPromotionStatsHistoryReq {
|
||||
StartDate string `form:"start_date"` // 开始日期,格式:YYYY-MM-DD
|
||||
EndDate string `form:"end_date"` // 结束日期,格式:YYYY-MM-DD
|
||||
}
|
||||
|
||||
// 推广历史记录项
|
||||
PromotionStatsHistoryItem {
|
||||
Id int64 `json:"id"` // 记录ID
|
||||
LinkId int64 `json:"link_id"` // 链接ID
|
||||
PayAmount float64 `json:"pay_amount"` // 金额
|
||||
ClickCount int64 `json:"click_count"` // 点击数
|
||||
PayCount int64 `json:"pay_count"` // 付费次数
|
||||
StatsDate string `json:"stats_date"` // 统计日期
|
||||
}
|
||||
|
||||
// 获取推广总统计请求
|
||||
GetPromotionStatsTotalReq {
|
||||
}
|
||||
|
||||
// 获取推广总统计响应
|
||||
GetPromotionStatsTotalResp {
|
||||
TodayPayAmount float64 `json:"today_pay_amount"` // 今日金额
|
||||
TodayClickCount int64 `json:"today_click_count"` // 今日点击数
|
||||
TodayPayCount int64 `json:"today_pay_count"` // 今日付费次数
|
||||
TotalPayAmount float64 `json:"total_pay_amount"` // 总金额
|
||||
TotalClickCount int64 `json:"total_click_count"` // 总点击数
|
||||
TotalPayCount int64 `json:"total_pay_count"` // 总付费次数
|
||||
}
|
||||
)
|
||||
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 int64 `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 []int64 `json:"menu_ids"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
GetRoleDetailReq {
|
||||
Id int64 `path:"id"` // 角色ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
GetRoleDetailResp {
|
||||
Id int64 `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 []int64 `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 []int64 `json:"menu_ids"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
CreateRoleResp {
|
||||
Id int64 `json:"id"` // 角色ID
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
UpdateRoleReq {
|
||||
Id int64 `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 []int64 `json:"menu_ids,optional"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
UpdateRoleResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
DeleteRoleReq {
|
||||
Id int64 `path:"id"` // 角色ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
DeleteRoleResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
451
app/main/api/desc/front/agent.api
Normal file
451
app/main/api/desc/front/agent.api
Normal file
@@ -0,0 +1,451 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "代理服务"
|
||||
desc: "代理服务接口"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
)
|
||||
service main {
|
||||
// 获取推广二维码海报
|
||||
@handler GetAgentPromotionQrcode
|
||||
get /promotion/qrcode (GetAgentPromotionQrcodeReq)
|
||||
|
||||
// 获取会员开通信息
|
||||
@handler GetMembershipInfo
|
||||
get /membership/info returns (GetMembershipInfoResp)
|
||||
}
|
||||
|
||||
type (
|
||||
GetAgentPromotionQrcodeReq {
|
||||
QrcodeType string `form:"qrcode_type"`
|
||||
QrcodeUrl string `form:"qrcode_url"`
|
||||
}
|
||||
// 会员配置信息
|
||||
MembershipConfigInfo {
|
||||
Id int64 `json:"id"` // 主键
|
||||
LevelName string `json:"level_name"` // 会员级别名称
|
||||
Price float64 `json:"price"` // 会员年费
|
||||
ReportCommission float64 `json:"report_commission"` // 直推报告收益
|
||||
LowerActivityReward float64 `json:"lower_activity_reward"` // 下级活跃奖励金额
|
||||
NewActivityReward float64 `json:"new_activity_reward"` // 新增活跃奖励金额
|
||||
LowerStandardCount int64 `json:"lower_standard_count"` // 活跃下级达标个数
|
||||
NewLowerStandardCount int64 `json:"new_lower_standard_count"` // 新增活跃下级达标个数
|
||||
LowerWithdrawRewardRatio float64 `json:"lower_withdraw_reward_ratio"` // 下级提现奖励比例
|
||||
LowerConvertVipReward float64 `json:"lower_convert_vip_reward"` // 下级转化VIP奖励
|
||||
LowerConvertSvipReward float64 `json:"lower_convert_svip_reward"` // 下级转化SVIP奖励
|
||||
ExemptionAmount float64 `json:"exemption_amount"` // 免审核金额
|
||||
PriceIncreaseMax float64 `json:"price_increase_max"` // 提价最高金额
|
||||
PriceRatio float64 `json:"price_ratio"` // 提价区间收取比例
|
||||
PriceIncreaseAmount float64 `json:"price_increase_amount"` // 在原本成本上加价的金额
|
||||
}
|
||||
// 获取会员开通信息响应
|
||||
GetMembershipInfoResp {
|
||||
NormalConfig MembershipConfigInfo `json:"normal_config"` // 普通代理配置
|
||||
VipConfig MembershipConfigInfo `json:"vip_config"` // VIP会员配置
|
||||
SvipConfig MembershipConfigInfo `json:"svip_config"` // SVIP会员配置
|
||||
}
|
||||
)
|
||||
|
||||
// 代理服务基本类型定义
|
||||
type AgentProductConfig {
|
||||
ProductID int64 `json:"product_id"`
|
||||
CostPrice float64 `json:"cost_price"`
|
||||
PriceRangeMin float64 `json:"price_range_min"`
|
||||
PriceRangeMax float64 `json:"price_range_max"`
|
||||
PPricingStandard float64 `json:"p_pricing_standard"`
|
||||
POverpricingRatio float64 `json:"p_overpricing_ratio"`
|
||||
APricingStandard float64 `json:"a_pricing_standard"`
|
||||
APricingEnd float64 `json:"a_pricing_end"`
|
||||
AOverpricingRatio float64 `json:"a_overpricing_ratio"`
|
||||
}
|
||||
|
||||
type AgentMembershipUserConfig {
|
||||
ProductID int64 `json:"product_id"`
|
||||
PriceIncreaseAmount float64 `json:"price_increase_amount"`
|
||||
PriceRangeFrom float64 `json:"price_range_from"`
|
||||
PriceRangeTo float64 `json:"price_range_to"`
|
||||
PriceRatio float64 `json:"price_ratio"`
|
||||
}
|
||||
|
||||
type ProductConfig {
|
||||
ProductID int64 `json:"product_id"`
|
||||
CostPrice float64 `json:"cost_price"`
|
||||
PriceRangeMin float64 `json:"price_range_min"`
|
||||
PriceRangeMax float64 `json:"price_range_max"`
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
// 查看代理信息
|
||||
@handler GetAgentInfo
|
||||
get /info returns (AgentInfoResp)
|
||||
|
||||
@handler GetAgentRevenueInfo
|
||||
get /revenue (GetAgentRevenueInfoReq) returns (GetAgentRevenueInfoResp)
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
jwt: JwtAuth
|
||||
middleware: UserAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 查询代理申请状态
|
||||
@handler GetAgentAuditStatus
|
||||
get /audit/status returns (AgentAuditStatusResp)
|
||||
|
||||
// 生成推广标识
|
||||
@handler GeneratingLink
|
||||
post /generating_link (AgentGeneratingLinkReq) returns (AgentGeneratingLinkResp)
|
||||
|
||||
// 获取推广定价配置
|
||||
@handler GetAgentProductConfig
|
||||
get /product_config returns (AgentProductConfigResp)
|
||||
|
||||
// 获取下级分页列表
|
||||
@handler GetAgentSubordinateList
|
||||
get /subordinate/list (GetAgentSubordinateListReq) returns (GetAgentSubordinateListResp)
|
||||
|
||||
// 下级贡献详情
|
||||
@handler GetAgentSubordinateContributionDetail
|
||||
get /subordinate/contribution/detail (GetAgentSubordinateContributionDetailReq) returns (GetAgentSubordinateContributionDetailResp)
|
||||
|
||||
@handler AgentRealName
|
||||
post /real_name (AgentRealNameReq) returns (AgentRealNameResp)
|
||||
}
|
||||
|
||||
type (
|
||||
AgentInfoResp {
|
||||
status int64 `json:"status"` // 0=待审核,1=审核通过,2=审核未通过,3=未申请
|
||||
isAgent bool `json:"is_agent"`
|
||||
agentID int64 `json:"agent_id"`
|
||||
level string `json:"level"`
|
||||
region string `json:"region"`
|
||||
mobile string `json:"mobile"`
|
||||
expiryTime string `json:"expiry_time"`
|
||||
isRealName bool `json:"is_real_name"`
|
||||
}
|
||||
// 查询代理申请状态响应
|
||||
AgentAuditStatusResp {
|
||||
Status int64 `json:"status"` // 0=待审核,1=审核通过,2=审核未通过
|
||||
AuditReason string `json:"audit_reason"`
|
||||
}
|
||||
AgentGeneratingLinkReq {
|
||||
Product string `json:"product"`
|
||||
Price string `json:"price"`
|
||||
}
|
||||
AgentGeneratingLinkResp {
|
||||
LinkIdentifier string `json:"link_identifier"`
|
||||
}
|
||||
AgentProductConfigResp {
|
||||
AgentProductConfig []AgentProductConfig
|
||||
}
|
||||
GetAgentSubordinateListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"page_size"` // 每页数据量
|
||||
}
|
||||
GetAgentSubordinateListResp {
|
||||
Total int64 `json:"total"` // 总记录数
|
||||
List []AgentSubordinateList `json:"list"` // 查询列表
|
||||
}
|
||||
AgentSubordinateList {
|
||||
ID int64 `json:"id"`
|
||||
Mobile string `json:"mobile"`
|
||||
CreateTime string `json:"create_time"`
|
||||
LevelName string `json:"level_name"`
|
||||
TotalOrders int64 `json:"total_orders"` // 总单量
|
||||
TotalEarnings float64 `json:"total_earnings"` // 总金额
|
||||
TotalContribution float64 `json:"total_contribution"` // 总贡献
|
||||
}
|
||||
GetAgentSubordinateContributionDetailReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"page_size"` // 每页数据量
|
||||
SubordinateID int64 `form:"subordinate_id"` // 下级ID
|
||||
}
|
||||
GetAgentSubordinateContributionDetailResp {
|
||||
Mobile string `json:"mobile"`
|
||||
Total int64 `json:"total"` // 总记录数
|
||||
CreateTime string `json:"create_time"`
|
||||
TotalEarnings float64 `json:"total_earnings"` // 总金额
|
||||
TotalContribution float64 `json:"total_contribution"` // 总贡献
|
||||
TotalOrders int64 `json:"total_orders"` // 总单量
|
||||
LevelName string `json:"level_name"` // 等级名称
|
||||
List []AgentSubordinateContributionDetail `json:"list"` // 查询列表
|
||||
Stats AgentSubordinateContributionStats `json:"stats"` // 统计数据
|
||||
}
|
||||
AgentSubordinateContributionDetail {
|
||||
ID int64 `json:"id"`
|
||||
CreateTime string `json:"create_time"`
|
||||
Amount float64 `json:"amount"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
AgentSubordinateContributionStats {
|
||||
CostCount int64 `json:"cost_count"` // 成本扣除次数
|
||||
CostAmount float64 `json:"cost_amount"` // 成本扣除总额
|
||||
PricingCount int64 `json:"pricing_count"` // 定价扣除次数
|
||||
PricingAmount float64 `json:"pricing_amount"` // 定价扣除总额
|
||||
DescendantPromotionCount int64 `json:"descendant_promotion_count"` // 下级推广次数
|
||||
DescendantPromotionAmount float64 `json:"descendant_promotion_amount"` // 下级推广总额
|
||||
DescendantUpgradeVipCount int64 `json:"descendant_upgrade_vip_count"` // 下级升级VIP次数
|
||||
DescendantUpgradeVipAmount float64 `json:"descendant_upgrade_vip_amount"` // 下级升级VIP总额
|
||||
DescendantUpgradeSvipCount int64 `json:"descendant_upgrade_svip_count"` // 下级升级SVIP次数
|
||||
DescendantUpgradeSvipAmount float64 `json:"descendant_upgrade_svip_amount"` // 下级升级SVIP总额
|
||||
DescendantStayActiveCount int64 `json:"descendant_stay_active_count"` // 下级保持活跃次数
|
||||
DescendantStayActiveAmount float64 `json:"descendant_stay_active_amount"` // 下级保持活跃总额
|
||||
DescendantNewActiveCount int64 `json:"descendant_new_active_count"` // 下级新增活跃次数
|
||||
DescendantNewActiveAmount float64 `json:"descendant_new_active_amount"` // 下级新增活跃总额
|
||||
DescendantWithdrawCount int64 `json:"descendant_withdraw_count"` // 下级提现次数
|
||||
DescendantWithdrawAmount float64 `json:"descendant_withdraw_amount"` // 下级提现总额
|
||||
}
|
||||
AgentRealNameReq {
|
||||
Name string `json:"name"`
|
||||
IDCard string `json:"id_card"`
|
||||
Mobile string `json:"mobile"`
|
||||
Code string `json:"code"`
|
||||
}
|
||||
AgentRealNameResp {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
jwt: JwtAuth
|
||||
middleware: UserAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@handler GetAgentMembershipProductConfig
|
||||
get /membership/user_config (AgentMembershipProductConfigReq) returns (AgentMembershipProductConfigResp)
|
||||
|
||||
@handler SaveAgentMembershipUserConfig
|
||||
post /membership/save_user_config (SaveAgentMembershipUserConfigReq)
|
||||
}
|
||||
|
||||
type (
|
||||
// 获取会员当前配置
|
||||
AgentMembershipProductConfigReq {
|
||||
ProductID int64 `form:"product_id"`
|
||||
}
|
||||
// 获取会员当前配置
|
||||
AgentMembershipProductConfigResp {
|
||||
AgentMembershipUserConfig AgentMembershipUserConfig `json:"agent_membership_user_config"`
|
||||
ProductConfig ProductConfig `json:"product_config"`
|
||||
PriceIncreaseMax float64 `json:"price_increase_max"`
|
||||
PriceIncreaseAmount float64 `json:"price_increase_amount"`
|
||||
PriceRatio float64 `json:"price_ratio"`
|
||||
}
|
||||
SaveAgentMembershipUserConfigReq {
|
||||
ProductID int64 `json:"product_id"`
|
||||
PriceIncreaseAmount float64 `json:"price_increase_amount"`
|
||||
PriceRangeFrom float64 `json:"price_range_from"`
|
||||
PriceRangeTo float64 `json:"price_range_to"`
|
||||
PriceRatio float64 `json:"price_ratio"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
jwt: JwtAuth
|
||||
middleware: UserAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@handler GetAgentCommission
|
||||
get /commission (GetCommissionReq) returns (GetCommissionResp)
|
||||
|
||||
@handler GetAgentRewards
|
||||
get /rewards (GetRewardsReq) returns (GetRewardsResp)
|
||||
|
||||
@handler GetAgentWithdrawal
|
||||
get /withdrawal (GetWithdrawalReq) returns (GetWithdrawalResp)
|
||||
|
||||
@handler AgentWithdrawal
|
||||
post /withdrawal (WithdrawalReq) returns (WithdrawalResp)
|
||||
|
||||
@handler ActivateAgentMembership
|
||||
post /membership/activate (AgentActivateMembershipReq) returns (AgentActivateMembershipResp)
|
||||
|
||||
@handler GetAgentWithdrawalTaxExemption
|
||||
get /withdrawal/tax/exemption (GetWithdrawalTaxExemptionReq) returns (GetWithdrawalTaxExemptionResp)
|
||||
|
||||
// 银行卡提现申请
|
||||
@handler BankCardWithdrawal
|
||||
post /withdrawal/bank-card (BankCardWithdrawalReq) returns (WithdrawalResp)
|
||||
|
||||
// 获取历史银行卡信息
|
||||
@handler GetBankCardInfo
|
||||
get /withdrawal/bank-card/info (GetBankCardInfoReq) returns (GetBankCardInfoResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 收益信息
|
||||
GetAgentRevenueInfoReq {}
|
||||
GetAgentRevenueInfoResp {
|
||||
Balance float64 `json:"balance"`
|
||||
FrozenBalance float64 `json:"frozen_balance"`
|
||||
TotalEarnings float64 `json:"total_earnings"`
|
||||
DirectPush DirectPushReport `json:"direct_push"` // 直推报告数据
|
||||
ActiveReward ActiveReward `json:"active_reward"` // 活跃下级奖励数据
|
||||
}
|
||||
// 直推报告数据结构
|
||||
DirectPushReport {
|
||||
TotalCommission float64 `json:"total_commission"`
|
||||
TotalReport int `json:"total_report"`
|
||||
Today TimeRangeReport `json:"today"` // 近24小时数据
|
||||
Last7D TimeRangeReport `json:"last7d"` // 近7天数据
|
||||
Last30D TimeRangeReport `json:"last30d"` // 近30天数据
|
||||
}
|
||||
// 活跃下级奖励数据结构
|
||||
ActiveReward {
|
||||
TotalReward float64 `json:"total_reward"`
|
||||
Today ActiveRewardData `json:"today"` // 今日数据
|
||||
Last7D ActiveRewardData `json:"last7d"` // 近7天数据
|
||||
Last30D ActiveRewardData `json:"last30d"` // 近30天数据
|
||||
}
|
||||
// 通用时间范围报告结构
|
||||
TimeRangeReport {
|
||||
Commission float64 `json:"commission"` // 佣金
|
||||
Report int `json:"report"` // 报告量
|
||||
}
|
||||
// 活跃奖励专用结构
|
||||
ActiveRewardData {
|
||||
NewActiveReward float64 `json:"active_reward"`
|
||||
SubPromoteReward float64 `json:"sub_promote_reward"`
|
||||
SubUpgradeReward float64 `json:"sub_upgrade_reward"`
|
||||
SubWithdrawReward float64 `json:"sub_withdraw_reward"`
|
||||
}
|
||||
Commission {
|
||||
OrderId string `json:"order_id"` // 订单号
|
||||
ProductName string `json:"product_name"`
|
||||
Amount float64 `json:"amount"` // 原始佣金金额
|
||||
RefundedAmount float64 `json:"refunded_amount"` // 已退款佣金金额
|
||||
NetAmount float64 `json:"net_amount"` // 剩余净佣金金额 = amount - refunded_amount
|
||||
Status int64 `json:"status"` // 状态:0-已结算,1-冻结中,2-已退款
|
||||
CreateTime string `json:"create_time"`
|
||||
QueryParams map[string]interface{} `json:"query_params,omitempty"`
|
||||
}
|
||||
GetCommissionReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"page_size"` // 每页数据量
|
||||
}
|
||||
GetCommissionResp {
|
||||
Total int64 `json:"total"` // 总记录数
|
||||
List []Commission `json:"list"` // 查询列表
|
||||
}
|
||||
Rewards {
|
||||
Type string `json:"type"`
|
||||
Amount float64 `json:"amount"`
|
||||
CreateTime string `json:"create_time"`
|
||||
}
|
||||
GetRewardsReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"page_size"` // 每页数据量
|
||||
}
|
||||
GetRewardsResp {
|
||||
Total int64 `json:"total"` // 总记录数
|
||||
List []Rewards `json:"list"` // 查询列表
|
||||
}
|
||||
Withdrawal {
|
||||
Status int64 `json:"status"`
|
||||
Amount float64 `json:"amount"`
|
||||
WithdrawalNo string `json:"withdrawal_no"`
|
||||
Remark string `json:"remark"`
|
||||
payeeAccount string `json:"payee_account"`
|
||||
CreateTime string `json:"create_time"`
|
||||
}
|
||||
GetWithdrawalReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"page_size"` // 每页数据量
|
||||
}
|
||||
GetWithdrawalResp {
|
||||
Total int64 `json:"total"` // 总记录数
|
||||
List []Withdrawal `json:"list"` // 查询列表
|
||||
}
|
||||
WithdrawalReq {
|
||||
Amount float64 `json:"amount"` // 提现金额
|
||||
payeeAccount string `json:"payee_account"`
|
||||
payeeName string `json:"payee_name"`
|
||||
}
|
||||
WithdrawalResp {
|
||||
Status int64 `json:"status"` // 1申请中 2成功 3失败
|
||||
failMsg string `json:"fail_msg"`
|
||||
}
|
||||
// 开通代理会员请求参数
|
||||
AgentActivateMembershipReq {
|
||||
Type string `json:"type,oneof=VIP SVIP"` // 会员类型:vip/svip
|
||||
}
|
||||
// 开通代理会员响应
|
||||
AgentActivateMembershipResp {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
GetWithdrawalTaxExemptionReq {}
|
||||
GetWithdrawalTaxExemptionResp {
|
||||
TotalExemptionAmount float64 `json:"total_exemption_amount"`
|
||||
UsedExemptionAmount float64 `json:"used_exemption_amount"`
|
||||
RemainingExemptionAmount float64 `json:"remaining_exemption_amount"`
|
||||
TaxRate float64 `json:"tax_rate"`
|
||||
}
|
||||
// 银行卡提现申请请求
|
||||
BankCardWithdrawalReq {
|
||||
BankCardNo string `json:"bank_card_no"` // 银行卡号
|
||||
BankName string `json:"bank_name"` // 开户支行
|
||||
Amount float64 `json:"amount"` // 提现金额
|
||||
}
|
||||
// 获取历史银行卡信息请求
|
||||
GetBankCardInfoReq {}
|
||||
// 获取历史银行卡信息响应
|
||||
GetBankCardInfoResp {
|
||||
BankCardNo string `json:"bank_card_no"` // 银行卡号
|
||||
BankName string `json:"bank_name"` // 开户支行
|
||||
PayeeName string `json:"payee_name"` // 收款人姓名
|
||||
IdCard string `json:"id_card"` // 身份证号
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
middleware: AuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 提交代理申请
|
||||
@handler ApplyForAgent
|
||||
post /apply (AgentApplyReq) returns (AgentApplyResp)
|
||||
|
||||
// 获取推广标识数据
|
||||
@handler GetLinkData
|
||||
get /link (GetLinkDataReq) returns (GetLinkDataResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 代理申请请求参数
|
||||
AgentApplyReq {
|
||||
Region string `json:"region"`
|
||||
Mobile string `json:"mobile"`
|
||||
Code string `json:"code"`
|
||||
Ancestor string `json:"ancestor,optional"`
|
||||
}
|
||||
AgentApplyResp {
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
}
|
||||
GetLinkDataReq {
|
||||
LinkIdentifier string `form:"link_identifier"`
|
||||
}
|
||||
GetLinkDataResp {
|
||||
Product
|
||||
}
|
||||
)
|
||||
|
||||
37
app/main/api/desc/front/app.api
Normal file
37
app/main/api/desc/front/app.api
Normal file
@@ -0,0 +1,37 @@
|
||||
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)
|
||||
}
|
||||
|
||||
type (
|
||||
// 心跳检测响应
|
||||
HealthCheckResp {
|
||||
Status string `json:"status"` // 服务状态
|
||||
Message string `json:"message"` // 状态信息
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
getAppVersionResp {
|
||||
Version string `json:"version"`
|
||||
WgtUrl string `json:"wgtUrl"`
|
||||
}
|
||||
)
|
||||
83
app/main/api/desc/front/authorization.api
Normal file
83
app/main/api/desc/front/authorization.api
Normal file
@@ -0,0 +1,83 @@
|
||||
type (
|
||||
// GetAuthorizationDocumentReq 获取授权书请求
|
||||
GetAuthorizationDocumentReq {
|
||||
DocumentId int64 `json:"documentId" validate:"required"` // 授权书ID
|
||||
}
|
||||
|
||||
// GetAuthorizationDocumentResp 获取授权书响应
|
||||
GetAuthorizationDocumentResp {
|
||||
DocumentId int64 `json:"documentId"` // 授权书ID
|
||||
UserId int64 `json:"userId"` // 用户ID
|
||||
OrderId int64 `json:"orderId"` // 订单ID
|
||||
QueryId int64 `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 int64 `json:"orderId" validate:"required"` // 订单ID
|
||||
}
|
||||
|
||||
// GetAuthorizationDocumentByOrderResp 根据订单ID获取授权书响应
|
||||
GetAuthorizationDocumentByOrderResp {
|
||||
Documents []AuthorizationDocumentInfo `json:"documents"` // 授权书列表
|
||||
}
|
||||
|
||||
// AuthorizationDocumentInfo 授权书信息
|
||||
AuthorizationDocumentInfo {
|
||||
DocumentId int64 `json:"documentId"` // 授权书ID
|
||||
UserId int64 `json:"userId"` // 用户ID
|
||||
OrderId int64 `json:"orderId"` // 订单ID
|
||||
QueryId int64 `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 int64 `json:"documentId" validate:"required"` // 授权书ID
|
||||
}
|
||||
|
||||
// DownloadAuthorizationDocumentByNameReq 通过文件名下载授权书请求
|
||||
DownloadAuthorizationDocumentByNameReq {
|
||||
FileName string `path:"fileName" validate:"required"` // 授权书文件名
|
||||
}
|
||||
|
||||
// DownloadAuthorizationDocumentResp 下载授权书响应
|
||||
DownloadAuthorizationDocumentResp {
|
||||
FileName string `json:"fileName"` // 文件名
|
||||
FilePath string `json:"filePath"` // 文件存储路径
|
||||
}
|
||||
)
|
||||
|
||||
// 授权书相关接口
|
||||
@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)
|
||||
|
||||
// 通过文件名下载授权书文件
|
||||
@handler DownloadAuthorizationDocumentByName
|
||||
get /authorization/download/file/:fileName (DownloadAuthorizationDocumentByNameReq) returns (DownloadAuthorizationDocumentResp)
|
||||
}
|
||||
71
app/main/api/desc/front/pay.api
Normal file
71
app/main/api/desc/front/pay.api
Normal file
@@ -0,0 +1,71 @@
|
||||
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
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: pay
|
||||
jwt: JwtAuth
|
||||
middleware: UserAuthInterceptor
|
||||
|
||||
)
|
||||
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)
|
||||
}
|
||||
|
||||
type (
|
||||
PaymentReq {
|
||||
Id string `json:"id"`
|
||||
PayMethod string `json:"pay_method"`
|
||||
PayType string `json:"pay_type" validate:"required,oneof=query agent_vip"`
|
||||
}
|
||||
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 int64 `json:"order_id" validate:"required"`
|
||||
TransactionReceipt string `json:"transaction_receipt" validate:"required"`
|
||||
}
|
||||
)
|
||||
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 int64 `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 int64 `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)
|
||||
}
|
||||
232
app/main/api/desc/front/query.api
Normal file
232
app/main/api/desc/front/query.api
Normal file
@@ -0,0 +1,232 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品查询服务"
|
||||
desc: "产品查询服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
//============================> query v1 <============================
|
||||
// 查询基本类型定义
|
||||
type Query {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
OrderId int64 `json:"order_id"` // 订单ID
|
||||
UserId int64 `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: UserAuthInterceptor
|
||||
)
|
||||
service main {
|
||||
@doc "query service"
|
||||
@handler queryService
|
||||
post /query/service/:product (QueryServiceReq) returns (QueryServiceResp)
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: query
|
||||
jwt: JwtAuth
|
||||
middleware: UserAuthInterceptor
|
||||
)
|
||||
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 (QueryDetailByOrderIdResp)
|
||||
|
||||
@doc "查询详情 按订单号"
|
||||
@handler queryDetailByOrderNo
|
||||
get /query/orderNo/:order_no (QueryDetailByOrderNoReq) returns (QueryDetailByOrderNoResp)
|
||||
|
||||
@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 *int64 `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"`
|
||||
}
|
||||
QueryExampleResp {
|
||||
Query
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryDetailByOrderIdReq {
|
||||
OrderId int64 `path:"order_id"`
|
||||
}
|
||||
QueryDetailByOrderIdResp {
|
||||
Query
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryDetailByOrderNoReq {
|
||||
OrderNo string `path:"order_no"`
|
||||
}
|
||||
QueryDetailByOrderNoResp {
|
||||
Query
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryRetryReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
QueryRetryResp {
|
||||
Query
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
UpdateQueryDataReq {
|
||||
Id int64 `json:"id"` // 查询ID
|
||||
QueryData string `json:"query_data"` // 查询数据(未加密的JSON)
|
||||
}
|
||||
UpdateQueryDataResp {
|
||||
Id int64 `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 (QueryShareDetailResp)
|
||||
|
||||
@doc "查询示例"
|
||||
@handler queryExample
|
||||
get /query/example (QueryExampleReq) returns (QueryExampleResp)
|
||||
}
|
||||
|
||||
type (
|
||||
QueryShareDetailReq {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
QueryShareDetailResp {
|
||||
Status string `json:"status"`
|
||||
Query
|
||||
}
|
||||
)
|
||||
|
||||
type QuerySingleTestReq {
|
||||
Params map[string]interface{} `json:"params"`
|
||||
Api string `json:"api"`
|
||||
}
|
||||
|
||||
type QuerySingleTestResp {
|
||||
Data interface{} `json:"data"`
|
||||
Api string `json:"api"`
|
||||
}
|
||||
|
||||
177
app/main/api/desc/front/user.api
Normal file
177
app/main/api/desc/front/user.api
Normal file
@@ -0,0 +1,177 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "用户中心服务"
|
||||
desc: "用户中心服务"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
//============================> user v1 <============================
|
||||
// 用户基本类型定义
|
||||
type User {
|
||||
Id int64 `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 "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 (
|
||||
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"`
|
||||
ActionType string `json:"actionType" validate:"required,oneof=login register query agentApply realName 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"` // 总记录数
|
||||
}
|
||||
)
|
||||
|
||||
32
app/main/api/desc/main.api
Normal file
32
app/main/api/desc/main.api
Normal file
@@ -0,0 +1,32 @@
|
||||
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/promotion.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"
|
||||
import "./admin/admin_queue.api"
|
||||
96
app/main/api/etc/main.dev.yaml
Normal file
96
app/main/api/etc/main.dev.yaml
Normal file
@@ -0,0 +1,96 @@
|
||||
Name: main
|
||||
Host: 0.0.0.0
|
||||
Port: 8888
|
||||
Timeout: 0
|
||||
DataSource: "xfc:xfc5vg67b3UNHu8@tcp(127.0.0.1:23201)/xfc?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
CacheRedis:
|
||||
- Host: "127.0.0.1:23202"
|
||||
Pass: "xfc3m3WsgyCKWqz" # Redis 密码,如果未设置则留空
|
||||
Type: "node" # 单节点模式
|
||||
JwtAuth:
|
||||
AccessSecret: "xfcWUvoIwL-FK0qnlxhvxR9tV6SjfOpeJMpKmY2QvT99lA"
|
||||
AccessExpire: 2592000
|
||||
RefreshAfter: 1296000
|
||||
VerifyCode:
|
||||
AccessKeyID: "LTAI5tKGB3TVJbMHSoZN3yr9"
|
||||
AccessKeySecret: "OCQ30GWp4yENMjmfOAaagksE18bp65"
|
||||
EndpointURL: "dysmsapi.aliyuncs.com"
|
||||
SignName: "海南海宇大数据"
|
||||
TemplateCode: "SMS_302641455"
|
||||
ValidTime: 300
|
||||
Encrypt:
|
||||
SecretKey: "ff83609b2b24fc73196aac3d3dfb874f"
|
||||
WestConfig:
|
||||
Url: "http://proxy.tianyuanapi.com/api/invoke"
|
||||
Key: "121a1e41fc1690dd6b90afbcacd80cf4"
|
||||
SecretId: "449159"
|
||||
SecretSecondId: "296804"
|
||||
YushanConfig:
|
||||
ApiKey: "4c566c4a4b543164535455685655316c"
|
||||
AcctID: "YSSJ843926726"
|
||||
Url: "https://api.yushanshuju.com/credit-gw/service"
|
||||
Alipay:
|
||||
AppID: "2021005180646821"
|
||||
PrivateKey: "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCKYBFGYLmPV1Rgv+4tI98RoGlcfRC/gNrQD2VkAcKqM7aEWgfo81CMZ/r62v6CJLLKvbKXZhkcBtlW2urVnV3ZYtLeNuXZx1Bd5wuMWcUS89FqZHFT3FKQbTvZsHFrn50gvvSJDOcRxjAM9cZlbCpY2qeqa19L6HkqMFfZ5LOFgIV+v2j7+3LK6eLXBoMSP1Emem1ZlV318TkBYGenIE0S6Q1/FxdHjHrWztTySDPq7Kd0ymnHwd8VtTyVh+kt4Rf57WZK6UBu2MxYPjrSkVQ/It5vxuLvbbMYqM4PT+QNk2uqQsHENdRk1RlGeYA9UEUc56tVVklqcW2tX2Ke0B9XAgMBAAECggEAHbDLRByQ9C66zh+gjVL7FB8lPFEhfNW7HZWQHcs656Y87V0cAWHj0Jym/5hpr6cMLfBSF6YykQ7vJ3HFnZwsfO51bHS/EOFxXxSqJ61DWfOy5W8z2diWZqLpiqYPUBZpcpNGiPmZwviRatZ5gV2aIIKaIzjys6joBqNk1j36PxSmP5MGx9gR7B/qqLAPd+wGcZA0jRuzey0Z2YiXN3JS32+Cd/XVjc3DglioHkAynAAsxfGICDtIbnfQc4eRFJXP2TXHUDGQCLzV3fYFQRT8RPi9wJUYcWgx/mgyfdWDKBq464a0KS3dVuT05Q0+VQJTgFwX/eGu8ici4s5oL+wDEQKBgQD82hhpqpYPOMlHb+07MmITe/glSNGWPo0JgC6pCc+9VbN6S43Shc3idduMTt1o4WLMM9KoFUfxBjcvc+CQI94iskLArvjf/c0zE5J2euZLNdJwYaRsJ+7qQbdU0srhKzXb7fGq3LhSKlK/jJFdv/mga88UwVwaopdg6xmaxgkiwwKBgQCMGRr1EiLV29xlgTEXFcwDID9k149NZgpXzJd/VTscLXR1BuRNictjQRahK+B0hebC21doGJU5ubSdCVTUy2f9DZlhA0qiKBA/if98/q1gmok3c8bDtHDsVB40kPRojGc6WWWqu1MCMk++gmpGo+vXzJfV3ACmEDvUJF/eYPKf3QKBgHEr2KNq07FKdGSCB0donJcl9IITnqNFqfCnq7rDBnUy55sEOB0TAHyszbB2GAl6X7MQOug6ZjHN22Nk1Q0O0Lzs1o3RgtkWiwKibvqStYLSOzdLrMEv+nJlKX5QvreblIa0cGdOVT2JbfIII4Q3ia4wssYSaXwOa/zYHWS14J7rAoGAAUsWCZ8iPTErZrB7oIft+zVoAGlRBFjlzYuw9lb2FbuBsLbgkqqr+v2V1OUPzGOUDsZxlx9q+T5yoWR9qP07t4VRniimnrqZ88w1VJURSqwCikWCVzoqNLROFxQjfXeWWF6M5reV+5Y1UD/p9T78JWDZIftG8kGCG+I+FFJ2yu0CgYBOjrvGXkbTzVM5QkJYitzOBXwwTZEHSboiejvZpApttfJzPVN4pmvJdqIRMibrC1gDR9CULPM+kbaqgDYeaUSDd1oN5692AtHEN4+M/wshbpHwrdFFYZaaBGvu0vzktCXXJwON4cB3KTQs7sBQ8cT0t9d7fOZDIlpKP2oGKBB0QQ=="
|
||||
AlipayPublicKey: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAimARRmC5j1dUYL/uLSPfEaBpXH0Qv4Da0A9lZAHCqjO2hFoH6PNQjGf6+tr+giSyyr2yl2YZHAbZVtrq1Z1d2WLS3jbl2cdQXecLjFnFEvPRamRxU9xSkG072bBxa5+dIL70iQznEcYwDPXGZWwqWNqnqmtfS+h5KjBX2eSzhYCFfr9o+/tyyuni1waDEj9RJnptWZVd9fE5AWBnpyBNEukNfxcXR4x61s7U8kgz6uyndMppx8HfFbU8lYfpLeEX+e1mSulAbtjMWD460pFUPyLeb8bi722zGKjOD0/kDZNrqkLBxDXUZNUZRnmAPVBFHOerVVZJanFtrV9intAfVwIDAQAB"
|
||||
AppCertPath: "etc/merchant/alipay/appCertPublicKey_2021005180646821.crt"
|
||||
AlipayCertPath: "etc/merchant/alipay/alipayCertPublicKey_RSA2.crt"
|
||||
AlipayRootCertPath: "etc/merchant/alipay/alipayRootCert.crt"
|
||||
IsProduction: true
|
||||
NotifyUrl: "https://6m4685017o.goho.co/api/v1/pay/alipay/callback"
|
||||
ReturnURL: "http://localhost:5678/inquire"
|
||||
|
||||
Wxpay:
|
||||
AppID: "wx442ee1ac1ee75917"
|
||||
MchID: "1738205312"
|
||||
MchCertificateSerialNumber: "6BD3F3D86A470C1ED31476EC5EF68DC16E023F43"
|
||||
MchApiv3Key: "ZtYxWvUsRqPoNmLkJiHgFeDcBap6gQ3K5"
|
||||
MchPrivateKeyPath: "etc/merchant/wxpay/apiclient_key.pem"
|
||||
MchPublicKeyID: "PUB_KEY_ID_0117382053122026011600191612000202"
|
||||
MchPublicKeyPath: "etc/merchant/wxpay/pub_key.pem"
|
||||
MchPlatformRAS: ""
|
||||
NotifyUrl: "https://www.xingfucha.cn/api/v1/pay/wechat/callback"
|
||||
RefundNotifyUrl: "https://www.xingfucha.cn/api/v1/pay/wechat/refund_callback"
|
||||
Applepay:
|
||||
ProductionVerifyURL: "https://api.storekit.itunes.apple.com/inApps/v1/transactions/receipt"
|
||||
SandboxVerifyURL: "https://api.storekit-sandbox.itunes.apple.com/inApps/v1/transactions/receipt"
|
||||
Sandbox: false
|
||||
BundleID: "com.allinone.check"
|
||||
IssuerID: "bf828d85-5269-4914-9660-c066e09cd6ef"
|
||||
KeyID: "LAY65829DQ"
|
||||
LoadPrivateKeyPath: "etc/merchant/AuthKey_LAY65829DQ.p8"
|
||||
Ali:
|
||||
Code: "d55b58829efb41c8aa8e86769cba4844"
|
||||
SystemConfig:
|
||||
ThreeVerify: false
|
||||
CommissionSafeMode: false # 佣金安全防御模式:true-冻结模式,false-直接结算模式
|
||||
WechatH5:
|
||||
AppID: "wx442ee1ac1ee75917"
|
||||
AppSecret: "c80474909db42f63913b7a307b3bee17"
|
||||
WechatMini:
|
||||
AppID: "wx781abb66b3368963" # 小程序的AppID
|
||||
AppSecret: "c7d02cdb0fc23c35c93187af9243b00d" # 小程序的AppSecret
|
||||
TycAppID: "wxe74617f3dd56c196"
|
||||
TycAppSecret: "c8207e54aef5689b2a7c1f91ed7ae8a0"
|
||||
Query:
|
||||
ShareLinkExpire: 604800 # 7天 = 7 * 24 * 60 * 60 = 604800秒
|
||||
AdminConfig:
|
||||
AccessSecret: "jK8nP3qR7tV2xZ5aB9cD1eF6gH4iJ0kL8mN5oP6qR7sT"
|
||||
AccessExpire: 604800
|
||||
RefreshAfter: 302400
|
||||
AdminPromotion:
|
||||
URLDomain: "https://www.xingfucha.cn/p"
|
||||
TaxConfig:
|
||||
TaxRate: 0.06
|
||||
TaxExemptionAmount: 0.00
|
||||
Tianyuanapi:
|
||||
AccessID: "7f8a9b2c4d5e6f1a"
|
||||
Key: "9e4f8a1b3c6d7e2f5a8b9c0d1e4f7a2b"
|
||||
BaseURL: "https://api.tianyuanapi.com"
|
||||
Timeout: 60
|
||||
Authorization:
|
||||
FileBaseURL: "https://www.quannengcha.com/api/v1/auth-docs" # 授权书文件访问基础URL
|
||||
Promotion:
|
||||
PromotionDomain: "http://localhost:8888" # 推广域名(用于生成短链)
|
||||
OfficialDomain: "http://localhost:5678" # 正式站点域名(短链重定向的目标域名)
|
||||
ExtensionTime: 24 # 佣金解冻延迟时间,单位:24小时
|
||||
83
app/main/api/etc/main.yaml
Normal file
83
app/main/api/etc/main.yaml
Normal file
@@ -0,0 +1,83 @@
|
||||
Name: main
|
||||
Host: 0.0.0.0
|
||||
Port: 8888
|
||||
DataSource: "xfc:xfc5vg67b3UNHu8@tcp(xfc_mysql:3306)/xfc?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
CacheRedis:
|
||||
- Host: "xfc_redis:6379"
|
||||
Pass: "xfc3m3WsgyCKWqz" # Redis 密码,如果未设置则留空
|
||||
Type: "node" # 单节点模式
|
||||
|
||||
JwtAuth:
|
||||
AccessSecret: "xfcWUvoIwL-FK0qnlxhvxR9tV6SjfOpeJMpKmY2QvT99lA"
|
||||
AccessExpire: 2592000
|
||||
RefreshAfter: 1296000
|
||||
|
||||
VerifyCode:
|
||||
AccessKeyID: "LTAI5tKGB3TVJbMHSoZN3yr9"
|
||||
AccessKeySecret: "OCQ30GWp4yENMjmfOAaagksE18bp65"
|
||||
EndpointURL: "dysmsapi.aliyuncs.com"
|
||||
SignName: "海南海宇大数据"
|
||||
TemplateCode: "SMS_302641455"
|
||||
ValidTime: 300
|
||||
Encrypt:
|
||||
SecretKey: "ff83609b2b24fc73196aac3d3dfb874f"
|
||||
Alipay:
|
||||
AppID: "2021005180646821"
|
||||
PrivateKey: "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCKYBFGYLmPV1Rgv+4tI98RoGlcfRC/gNrQD2VkAcKqM7aEWgfo81CMZ/r62v6CJLLKvbKXZhkcBtlW2urVnV3ZYtLeNuXZx1Bd5wuMWcUS89FqZHFT3FKQbTvZsHFrn50gvvSJDOcRxjAM9cZlbCpY2qeqa19L6HkqMFfZ5LOFgIV+v2j7+3LK6eLXBoMSP1Emem1ZlV318TkBYGenIE0S6Q1/FxdHjHrWztTySDPq7Kd0ymnHwd8VtTyVh+kt4Rf57WZK6UBu2MxYPjrSkVQ/It5vxuLvbbMYqM4PT+QNk2uqQsHENdRk1RlGeYA9UEUc56tVVklqcW2tX2Ke0B9XAgMBAAECggEAHbDLRByQ9C66zh+gjVL7FB8lPFEhfNW7HZWQHcs656Y87V0cAWHj0Jym/5hpr6cMLfBSF6YykQ7vJ3HFnZwsfO51bHS/EOFxXxSqJ61DWfOy5W8z2diWZqLpiqYPUBZpcpNGiPmZwviRatZ5gV2aIIKaIzjys6joBqNk1j36PxSmP5MGx9gR7B/qqLAPd+wGcZA0jRuzey0Z2YiXN3JS32+Cd/XVjc3DglioHkAynAAsxfGICDtIbnfQc4eRFJXP2TXHUDGQCLzV3fYFQRT8RPi9wJUYcWgx/mgyfdWDKBq464a0KS3dVuT05Q0+VQJTgFwX/eGu8ici4s5oL+wDEQKBgQD82hhpqpYPOMlHb+07MmITe/glSNGWPo0JgC6pCc+9VbN6S43Shc3idduMTt1o4WLMM9KoFUfxBjcvc+CQI94iskLArvjf/c0zE5J2euZLNdJwYaRsJ+7qQbdU0srhKzXb7fGq3LhSKlK/jJFdv/mga88UwVwaopdg6xmaxgkiwwKBgQCMGRr1EiLV29xlgTEXFcwDID9k149NZgpXzJd/VTscLXR1BuRNictjQRahK+B0hebC21doGJU5ubSdCVTUy2f9DZlhA0qiKBA/if98/q1gmok3c8bDtHDsVB40kPRojGc6WWWqu1MCMk++gmpGo+vXzJfV3ACmEDvUJF/eYPKf3QKBgHEr2KNq07FKdGSCB0donJcl9IITnqNFqfCnq7rDBnUy55sEOB0TAHyszbB2GAl6X7MQOug6ZjHN22Nk1Q0O0Lzs1o3RgtkWiwKibvqStYLSOzdLrMEv+nJlKX5QvreblIa0cGdOVT2JbfIII4Q3ia4wssYSaXwOa/zYHWS14J7rAoGAAUsWCZ8iPTErZrB7oIft+zVoAGlRBFjlzYuw9lb2FbuBsLbgkqqr+v2V1OUPzGOUDsZxlx9q+T5yoWR9qP07t4VRniimnrqZ88w1VJURSqwCikWCVzoqNLROFxQjfXeWWF6M5reV+5Y1UD/p9T78JWDZIftG8kGCG+I+FFJ2yu0CgYBOjrvGXkbTzVM5QkJYitzOBXwwTZEHSboiejvZpApttfJzPVN4pmvJdqIRMibrC1gDR9CULPM+kbaqgDYeaUSDd1oN5692AtHEN4+M/wshbpHwrdFFYZaaBGvu0vzktCXXJwON4cB3KTQs7sBQ8cT0t9d7fOZDIlpKP2oGKBB0QQ=="
|
||||
AlipayPublicKey: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAimARRmC5j1dUYL/uLSPfEaBpXH0Qv4Da0A9lZAHCqjO2hFoH6PNQjGf6+tr+giSyyr2yl2YZHAbZVtrq1Z1d2WLS3jbl2cdQXecLjFnFEvPRamRxU9xSkG072bBxa5+dIL70iQznEcYwDPXGZWwqWNqnqmtfS+h5KjBX2eSzhYCFfr9o+/tyyuni1waDEj9RJnptWZVd9fE5AWBnpyBNEukNfxcXR4x61s7U8kgz6uyndMppx8HfFbU8lYfpLeEX+e1mSulAbtjMWD460pFUPyLeb8bi722zGKjOD0/kDZNrqkLBxDXUZNUZRnmAPVBFHOerVVZJanFtrV9intAfVwIDAQAB"
|
||||
AppCertPath: "etc/merchant/alipay/appCertPublicKey_2021005180646821.crt"
|
||||
AlipayCertPath: "etc/merchant/alipay/alipayCertPublicKey_RSA2.crt"
|
||||
AlipayRootCertPath: "etc/merchant/alipay/alipayRootCert.crt"
|
||||
IsProduction: true
|
||||
NotifyUrl: "https://www.xingfucha.cn/api/v1/pay/alipay/callback"
|
||||
ReturnURL: "https://www.xingfucha.cn/payment/result"
|
||||
Wxpay:
|
||||
AppID: "wx442ee1ac1ee75917"
|
||||
MchID: "1738205312"
|
||||
MchCertificateSerialNumber: "6BD3F3D86A470C1ED31476EC5EF68DC16E023F43"
|
||||
MchApiv3Key: "ZtYxWvUsRqPoNmLkJiHgFeDcBap6gQ3K5"
|
||||
MchPrivateKeyPath: "etc/merchant/wxpay/apiclient_key.pem"
|
||||
MchPublicKeyID: "PUB_KEY_ID_0117382053122026011600191612000202"
|
||||
MchPublicKeyPath: "etc/merchant/wxpay/pub_key.pem"
|
||||
MchPlatformRAS: ""
|
||||
NotifyUrl: "https://www.xingfucha.cn/api/v1/pay/wechat/callback"
|
||||
RefundNotifyUrl: "https://www.xingfucha.cn/api/v1/pay/wechat/refund_callback"
|
||||
Applepay:
|
||||
ProductionVerifyURL: "https://api.storekit.itunes.apple.com/inApps/v1/transactions/receipt"
|
||||
SandboxVerifyURL: "https://api.storekit-sandbox.itunes.apple.com/inApps/v1/transactions/receipt"
|
||||
Sandbox: true
|
||||
BundleID: "com.allinone.check"
|
||||
IssuerID: "bf828d85-5269-4914-9660-c066e09cd6ef"
|
||||
KeyID: "LAY65829DQ"
|
||||
LoadPrivateKeyPath: "etc/merchant/AuthKey_LAY65829DQ.p8"
|
||||
SystemConfig:
|
||||
ThreeVerify: true
|
||||
CommissionSafeMode: false # 佣金安全防御模式:true-冻结模式,false-直接结算模式
|
||||
WechatH5:
|
||||
AppID: "wx442ee1ac1ee75917"
|
||||
AppSecret: "c80474909db42f63913b7a307b3bee17"
|
||||
WechatMini:
|
||||
AppID: "wx5bacc94add2da981" # 小程序的AppID
|
||||
AppSecret: "48a2c1e8ff1b7d4c0ff82fbefa64d2d0" # 小程序的AppSecret
|
||||
Query:
|
||||
ShareLinkExpire: 604800 # 7天 = 7 * 24 * 60 * 60 = 604800秒
|
||||
AdminConfig:
|
||||
AccessSecret: "jK8nP3qR7tV2xZ5aB9cD1eF6gH4iJ0kL8mN5oP6qR7sT"
|
||||
AccessExpire: 604800
|
||||
RefreshAfter: 302400
|
||||
AdminPromotion:
|
||||
URLDomain: "https://www.xingfucha.cn/p"
|
||||
TaxConfig:
|
||||
TaxRate: 0.06
|
||||
TaxExemptionAmount: 0.00
|
||||
Tianyuanapi:
|
||||
AccessID: "7f8a9b2c4d5e6f1a"
|
||||
Key: "9e4f8a1b3c6d7e2f5a8b9c0d1e4f7a2b"
|
||||
BaseURL: "https://api.tianyuanapi.com"
|
||||
Timeout: 60
|
||||
Authorization:
|
||||
FileBaseURL: "https://www.xingfucha.cn/api/v1/auth-docs" # 授权书文件访问基础URL
|
||||
Promotion:
|
||||
PromotionDomain: "https://p.xingfucha.cn" # 推广域名(用于生成短链)
|
||||
OfficialDomain: "https://www.xingfucha.cn" # 正式站点域名(短链重定向的目标域名)
|
||||
ExtensionTime: 24 # 佣金解冻延迟时间,单位:24小时
|
||||
17
app/main/api/etc/merchant/alipay/CSR文件.csr
Normal file
17
app/main/api/etc/merchant/alipay/CSR文件.csr
Normal file
@@ -0,0 +1,17 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIICvTCCAaUCAQAweDEJMAcGA1UEBhMAMQkwBwYDVQQIEwAxCTAHBgNVBAcTADE/
|
||||
MD0GA1UECgw25rW35Y+j6b6Z5Y2O5rW35a6H572R57uc5bel5L2c5a6k77yI5Liq
|
||||
5L2T5bel5ZWG5oi377yJMQkwBwYDVQQLEwAxCTAHBgNVBAMTADCCASIwDQYJKoZI
|
||||
hvcNAQEBBQADggEPADCCAQoCggEBAIpgEUZguY9XVGC/7i0j3xGgaVx9EL+A2tAP
|
||||
ZWQBwqoztoRaB+jzUIxn+vra/oIkssq9spdmGRwG2Vba6tWdXdli0t425dnHUF3n
|
||||
C4xZxRLz0WpkcVPcUpBtO9mwcWufnSC+9IkM5xHGMAz1xmVsKljap6prX0voeSow
|
||||
V9nks4WAhX6/aPv7csrp4tcGgxI/USZ6bVmVXfXxOQFgZ6cgTRLpDX8XF0eMetbO
|
||||
1PJIM+rsp3TKacfB3xW1PJWH6S3hF/ntZkrpQG7YzFg+OtKRVD8i3m/G4u9tsxio
|
||||
zg9P5A2Ta6pCwcQ11GTVGUZ5gD1QRRznq1VWSWpxba1fYp7QH1cCAwEAAaAAMA0G
|
||||
CSqGSIb3DQEBBAUAA4IBAQBNe1CQC2AsGIVQgHQQP125r7t6k2wD5ud3WmfdIecj
|
||||
ZAzgrWTsuQ6WBcfWPPux/vHVisYIHfUXqcNxy30ywqPfRsT8YOvS3kwqELMy4qAR
|
||||
Ln0tgFOrerl//pdtxSeogectgM7LaxnGlXDtUJCux4jJhiXsJYWpXfG/J112stmP
|
||||
wB/9BZKhAM7rlMzebcBn0qUnWTV+NZVVC6vA9g2raH2dcJdZMmjE+9aK7n03RSBB
|
||||
GKDYF4MpGBJVzl3jupIUX4IsakW9VqmSOxOgiINrzR7RlEmAan6TV/zmHjcQkHum
|
||||
rfRYHlRWlXMaPlo2NWzTLRK2LG+Qs7ARAz3nz6VZiTAy
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
@@ -0,0 +1,43 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDxDCCAqygAwIBAgIQICYBE6Tq4uq+ZBTR7G+WxzANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE
|
||||
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0
|
||||
aG9yaXR5MTkwNwYDVQQDDDBBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IENs
|
||||
YXNzIDIgUjEwHhcNMjYwMTEzMDg1NzExWhcNMzEwMTEyMDg1NzExWjCBpDELMAkGA1UEBhMCQ04x
|
||||
PzA9BgNVBAoMNua1t+WPo+m+meWNjua1t+Wuh+e9kee7nOW3peS9nOWupO+8iOS4quS9k+W3peWV
|
||||
huaIt++8iTEPMA0GA1UECwwGQWxpcGF5MUMwQQYDVQQDDDrmlK/ku5jlrp0o5Lit5Zu9Kee9kee7
|
||||
nOaKgOacr+aciemZkOWFrOWPuC0yMDg4MTUxMzgzMDI0ODAxMIIBIjANBgkqhkiG9w0BAQEFAAOC
|
||||
AQ8AMIIBCgKCAQEAzTCyAakFo4JngoXBXjlRxmfXbJnaMUt8DDcL7ypBtlkxPozQ/UIYV6lyDmJX
|
||||
zEitXXEejOcrPytPigMlFFKonEhR+kOk8y1ELHjG1Xq45Z6Uxq40Eu8CRcD9PN49/dvzOORHuOJb
|
||||
wJSPst/JPjg72xLzf6BAe8Q2EK5EhRGaSXS981AQBMOfVfdha48rYv3E5NrwGRW97NEkOrkL/1Iu
|
||||
Ztqfk4l6yiBj7Rsaz+JMy6NPJZdh30txhDX8A4NhrGlI+pBttJWCvNzOEdsX06z5B+ppzWtwblCf
|
||||
uTWJi+2pXn9NWfL+fBCoqAIAlQtPCYIzlY+r43wgUgz/5xlvCFVaeQIDAQABoxIwEDAOBgNVHQ8B
|
||||
Af8EBAMCA/gwDQYJKoZIhvcNAQELBQADggEBAFmHgif72ABslHVv3GcorjW0OB85A+8GoJj7a3hN
|
||||
BO7rJT9so78phS9jU0kQUIMuuUGpmJarp6sc2hQI83YGaorWaaSrKlkF768VD5cKCym2Kk+YeIa6
|
||||
F8V5yWBrG7UHxJ61UywGpBrXmxneSQDEpAU7EcE+y4HqeZKKI27DGoVaWHse3nYNQoM7tSzz0URt
|
||||
3h0GpCU9oUhlCXYbyukwiIFGpQic6wpw5UzeMM/Ypt7dZBJ87t8LZ6zBXwTjJjAqXV+FT/bSy4I7
|
||||
oQ6lruquNvUI4u6Gcezfil4ZJjASSPQO5zSkpVfs7IDqcKpJVvQyAp7QqW8jNnK+oxS4eu0ZmOo=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIE4jCCAsqgAwIBAgIIYsSr5bKAMl8wDQYJKoZIhvcNAQELBQAwejELMAkGA1UEBhMCQ04xFjAU
|
||||
BgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5MTEw
|
||||
LwYDVQQDDChBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFIxMB4XDTE4MDMy
|
||||
MjE0MzQxNVoXDTM3MTEyNjE0MzQxNVowgYIxCzAJBgNVBAYTAkNOMRYwFAYDVQQKDA1BbnQgRmlu
|
||||
YW5jaWFsMSAwHgYDVQQLDBdDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTE5MDcGA1UEAwwwQW50IEZp
|
||||
bmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBDbGFzcyAyIFIxMIIBIjANBgkqhkiG9w0B
|
||||
AQEFAAOCAQ8AMIIBCgKCAQEAsLMfYaoRoPRbmDcAfXPCmKf43pWRN5yTXa/KJWO0l+mrgQvs89bA
|
||||
NEvbDUxlkGwycwtwi5DgBuBgVhLliXu+R9CYgr2dXs8D8Hx/gsggDcyGPLmVrDOnL+dyeauheARZ
|
||||
fA3du60fwEwwbGcVIpIxPa/4n3IS/ElxQa6DNgqxh8J9Xwh7qMGl0JK9+bALuxf7B541Gr4p0WEN
|
||||
G8fhgjBV4w4ut9eQLOoa1eddOUSZcy46Z7allwowwgt7b5VFfx/P1iKJ3LzBMgkCK7GZ2kiLrL7R
|
||||
iqV+h482J7hkJD+ardoc6LnrHO/hIZymDxok+VH9fVeUdQa29IZKrIDVj65THQIDAQABo2MwYTAf
|
||||
BgNVHSMEGDAWgBRfdLQEwE8HWurlsdsio4dBspzhATAdBgNVHQ4EFgQUSqHkYINtUSAtDPnS8Xoy
|
||||
oP9p7qEwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggIB
|
||||
AIQ8TzFy4bVIVb8+WhHKCkKNPcJe2EZuIcqvRoi727lZTJOfYy/JzLtckyZYfEI8J0lasZ29wkTt
|
||||
a1IjSo+a6XdhudU4ONVBrL70U8Kzntplw/6TBNbLFpp7taRALjUgbCOk4EoBMbeCL0GiYYsTS0mw
|
||||
7xdySzmGQku4GTyqutIGPQwKxSj9iSFw1FCZqr4VP4tyXzMUgc52SzagA6i7AyLedd3tbS6lnR5B
|
||||
L+W9Kx9hwT8L7WANAxQzv/jGldeuSLN8bsTxlOYlsdjmIGu/C9OWblPYGpjQQIRyvs4Cc/mNhrh+
|
||||
14EQgwuemIIFDLOgcD+iISoN8CqegelNcJndFw1PDN6LkVoiHz9p7jzsge8RKay/QW6C03KNDpWZ
|
||||
EUCgCUdfHfo8xKeR+LL1cfn24HKJmZt8L/aeRZwZ1jwePXFRVtiXELvgJuM/tJDIFj2KD337iV64
|
||||
fWcKQ/ydDVGqfDZAdcU4hQdsrPWENwPTQPfVPq2NNLMyIH9+WKx9Ed6/WzeZmIy5ZWpX1TtTolo6
|
||||
OJXQFeItMAjHxW/ZSZTok5IS3FuRhExturaInnzjYpx50a6kS34c5+c8hYq7sAtZ/CNLZmBnBCFD
|
||||
aMQqT8xFZJ5uolUaSeXxg7JFY1QsYp5RKvj4SjFwCGKJ2+hPPe9UyyltxOidNtxjaknOCeBHytOr
|
||||
-----END CERTIFICATE-----
|
||||
88
app/main/api/etc/merchant/alipay/alipayRootCert.crt
Normal file
88
app/main/api/etc/merchant/alipay/alipayRootCert.crt
Normal file
@@ -0,0 +1,88 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIBszCCAVegAwIBAgIIaeL+wBcKxnswDAYIKoEcz1UBg3UFADAuMQswCQYDVQQG
|
||||
EwJDTjEOMAwGA1UECgwFTlJDQUMxDzANBgNVBAMMBlJPT1RDQTAeFw0xMjA3MTQw
|
||||
MzExNTlaFw00MjA3MDcwMzExNTlaMC4xCzAJBgNVBAYTAkNOMQ4wDAYDVQQKDAVO
|
||||
UkNBQzEPMA0GA1UEAwwGUk9PVENBMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE
|
||||
MPCca6pmgcchsTf2UnBeL9rtp4nw+itk1Kzrmbnqo05lUwkwlWK+4OIrtFdAqnRT
|
||||
V7Q9v1htkv42TsIutzd126NdMFswHwYDVR0jBBgwFoAUTDKxl9kzG8SmBcHG5Yti
|
||||
W/CXdlgwDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFEwysZfZ
|
||||
MxvEpgXBxuWLYlvwl3ZYMAwGCCqBHM9VAYN1BQADSAAwRQIgG1bSLeOXp3oB8H7b
|
||||
53W+CKOPl2PknmWEq/lMhtn25HkCIQDaHDgWxWFtnCrBjH16/W3Ezn7/U/Vjo5xI
|
||||
pDoiVhsLwg==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF0zCCA7ugAwIBAgIIH8+hjWpIDREwDQYJKoZIhvcNAQELBQAwejELMAkGA1UE
|
||||
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmlj
|
||||
YXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5jaWFsIENlcnRpZmlj
|
||||
YXRpb24gQXV0aG9yaXR5IFIxMB4XDTE4MDMyMTEzNDg0MFoXDTM4MDIyODEzNDg0
|
||||
MFowejELMAkGA1UEBhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNV
|
||||
BAsMF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5j
|
||||
aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFIxMIICIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAg8AMIICCgKCAgEAtytTRcBNuur5h8xuxnlKJetT65cHGemGi8oD+beHFPTk
|
||||
rUTlFt9Xn7fAVGo6QSsPb9uGLpUFGEdGmbsQ2q9cV4P89qkH04VzIPwT7AywJdt2
|
||||
xAvMs+MgHFJzOYfL1QkdOOVO7NwKxH8IvlQgFabWomWk2Ei9WfUyxFjVO1LVh0Bp
|
||||
dRBeWLMkdudx0tl3+21t1apnReFNQ5nfX29xeSxIhesaMHDZFViO/DXDNW2BcTs6
|
||||
vSWKyJ4YIIIzStumD8K1xMsoaZBMDxg4itjWFaKRgNuPiIn4kjDY3kC66Sl/6yTl
|
||||
YUz8AybbEsICZzssdZh7jcNb1VRfk79lgAprm/Ktl+mgrU1gaMGP1OE25JCbqli1
|
||||
Pbw/BpPynyP9+XulE+2mxFwTYhKAwpDIDKuYsFUXuo8t261pCovI1CXFzAQM2w7H
|
||||
DtA2nOXSW6q0jGDJ5+WauH+K8ZSvA6x4sFo4u0KNCx0ROTBpLif6GTngqo3sj+98
|
||||
SZiMNLFMQoQkjkdN5Q5g9N6CFZPVZ6QpO0JcIc7S1le/g9z5iBKnifrKxy0TQjtG
|
||||
PsDwc8ubPnRm/F82RReCoyNyx63indpgFfhN7+KxUIQ9cOwwTvemmor0A+ZQamRe
|
||||
9LMuiEfEaWUDK+6O0Gl8lO571uI5onYdN1VIgOmwFbe+D8TcuzVjIZ/zvHrAGUcC
|
||||
AwEAAaNdMFswCwYDVR0PBAQDAgEGMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFF90
|
||||
tATATwda6uWx2yKjh0GynOEBMB8GA1UdIwQYMBaAFF90tATATwda6uWx2yKjh0Gy
|
||||
nOEBMA0GCSqGSIb3DQEBCwUAA4ICAQCVYaOtqOLIpsrEikE5lb+UARNSFJg6tpkf
|
||||
tJ2U8QF/DejemEHx5IClQu6ajxjtu0Aie4/3UnIXop8nH/Q57l+Wyt9T7N2WPiNq
|
||||
JSlYKYbJpPF8LXbuKYG3BTFTdOVFIeRe2NUyYh/xs6bXGr4WKTXb3qBmzR02FSy3
|
||||
IODQw5Q6zpXj8prYqFHYsOvGCEc1CwJaSaYwRhTkFedJUxiyhyB5GQwoFfExCVHW
|
||||
05ZFCAVYFldCJvUzfzrWubN6wX0DD2dwultgmldOn/W/n8at52mpPNvIdbZb2F41
|
||||
T0YZeoWnCJrYXjq/32oc1cmifIHqySnyMnavi75DxPCdZsCOpSAT4j4lAQRGsfgI
|
||||
kkLPGQieMfNNkMCKh7qjwdXAVtdqhf0RVtFILH3OyEodlk1HYXqX5iE5wlaKzDop
|
||||
PKwf2Q3BErq1xChYGGVS+dEvyXc/2nIBlt7uLWKp4XFjqekKbaGaLJdjYP5b2s7N
|
||||
1dM0MXQ/f8XoXKBkJNzEiM3hfsU6DOREgMc1DIsFKxfuMwX3EkVQM1If8ghb6x5Y
|
||||
jXayv+NLbidOSzk4vl5QwngO/JYFMkoc6i9LNwEaEtR9PhnrdubxmrtM+RjfBm02
|
||||
77q3dSWFESFQ4QxYWew4pHE0DpWbWy/iMIKQ6UZ5RLvB8GEcgt8ON7BBJeMc+Dyi
|
||||
kT9qhqn+lw==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICiDCCAgygAwIBAgIIQX76UsB/30owDAYIKoZIzj0EAwMFADB6MQswCQYDVQQG
|
||||
EwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UECwwXQ2VydGlmaWNh
|
||||
dGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNpYWwgQ2VydGlmaWNh
|
||||
dGlvbiBBdXRob3JpdHkgRTEwHhcNMTkwNDI4MTYyMDQ0WhcNNDkwNDIwMTYyMDQ0
|
||||
WjB6MQswCQYDVQQGEwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UE
|
||||
CwwXQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNp
|
||||
YWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRTEwdjAQBgcqhkjOPQIBBgUrgQQA
|
||||
IgNiAASCCRa94QI0vR5Up9Yr9HEupz6hSoyjySYqo7v837KnmjveUIUNiuC9pWAU
|
||||
WP3jwLX3HkzeiNdeg22a0IZPoSUCpasufiLAnfXh6NInLiWBrjLJXDSGaY7vaokt
|
||||
rpZvAdmjXTBbMAsGA1UdDwQEAwIBBjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBRZ
|
||||
4ZTgDpksHL2qcpkFkxD2zVd16TAfBgNVHSMEGDAWgBRZ4ZTgDpksHL2qcpkFkxD2
|
||||
zVd16TAMBggqhkjOPQQDAwUAA2gAMGUCMQD4IoqT2hTUn0jt7oXLdMJ8q4vLp6sg
|
||||
wHfPiOr9gxreb+e6Oidwd2LDnC4OUqCWiF8CMAzwKs4SnDJYcMLf2vpkbuVE4dTH
|
||||
Rglz+HGcTLWsFs4KxLsq7MuU+vJTBUeDJeDjdA==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDxTCCAq2gAwIBAgIUEMdk6dVgOEIS2cCP0Q43P90Ps5YwDQYJKoZIhvcNAQEF
|
||||
BQAwajELMAkGA1UEBhMCQ04xEzARBgNVBAoMCmlUcnVzQ2hpbmExHDAaBgNVBAsM
|
||||
E0NoaW5hIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMMH2lUcnVzQ2hpbmEgQ2xhc3Mg
|
||||
MiBSb290IENBIC0gRzMwHhcNMTMwNDE4MDkzNjU2WhcNMzMwNDE4MDkzNjU2WjBq
|
||||
MQswCQYDVQQGEwJDTjETMBEGA1UECgwKaVRydXNDaGluYTEcMBoGA1UECwwTQ2hp
|
||||
bmEgVHJ1c3QgTmV0d29yazEoMCYGA1UEAwwfaVRydXNDaGluYSBDbGFzcyAyIFJv
|
||||
b3QgQ0EgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOPPShpV
|
||||
nJbMqqCw6Bz1kehnoPst9pkr0V9idOwU2oyS47/HjJXk9Rd5a9xfwkPO88trUpz5
|
||||
4GmmwspDXjVFu9L0eFaRuH3KMha1Ak01citbF7cQLJlS7XI+tpkTGHEY5pt3EsQg
|
||||
wykfZl/A1jrnSkspMS997r2Gim54cwz+mTMgDRhZsKK/lbOeBPpWtcFizjXYCqhw
|
||||
WktvQfZBYi6o4sHCshnOswi4yV1p+LuFcQ2ciYdWvULh1eZhLxHbGXyznYHi0dGN
|
||||
z+I9H8aXxqAQfHVhbdHNzi77hCxFjOy+hHrGsyzjrd2swVQ2iUWP8BfEQqGLqM1g
|
||||
KgWKYfcTGdbPB1MCAwEAAaNjMGEwHQYDVR0OBBYEFG/oAMxTVe7y0+408CTAK8hA
|
||||
uTyRMB8GA1UdIwQYMBaAFG/oAMxTVe7y0+408CTAK8hAuTyRMA8GA1UdEwEB/wQF
|
||||
MAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBLnUTfW7hp
|
||||
emMbuUGCk7RBswzOT83bDM6824EkUnf+X0iKS95SUNGeeSWK2o/3ALJo5hi7GZr3
|
||||
U8eLaWAcYizfO99UXMRBPw5PRR+gXGEronGUugLpxsjuynoLQu8GQAeysSXKbN1I
|
||||
UugDo9u8igJORYA+5ms0s5sCUySqbQ2R5z/GoceyI9LdxIVa1RjVX8pYOj8JFwtn
|
||||
DJN3ftSFvNMYwRuILKuqUYSHc2GPYiHVflDh5nDymCMOQFcFG3WsEuB+EYQPFgIU
|
||||
1DHmdZcz7Llx8UOZXX2JupWCYzK1XhJb+r4hK5ncf/w8qGtYlmyJpxk3hr1TfUJX
|
||||
Yf4Zr0fJsGuv
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,24 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEszCCA5ugAwIBAgIQICYBE7H2eGMTtFdr6ZwthDANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE
|
||||
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0
|
||||
aG9yaXR5MTkwNwYDVQQDDDBBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IENs
|
||||
YXNzIDEgUjEwHhcNMjYwMTEzMDg1NzEwWhcNMzEwMTEyMDg1NzEwWjB6MQswCQYDVQQGEwJDTjE/
|
||||
MD0GA1UECgw25rW35Y+j6b6Z5Y2O5rW35a6H572R57uc5bel5L2c5a6k77yI5Liq5L2T5bel5ZWG
|
||||
5oi377yJMQ8wDQYDVQQLDAZBbGlwYXkxGTAXBgNVBAMMEDIwODgxNTEzODMwMjQ4MDEwggEiMA0G
|
||||
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCKYBFGYLmPV1Rgv+4tI98RoGlcfRC/gNrQD2VkAcKq
|
||||
M7aEWgfo81CMZ/r62v6CJLLKvbKXZhkcBtlW2urVnV3ZYtLeNuXZx1Bd5wuMWcUS89FqZHFT3FKQ
|
||||
bTvZsHFrn50gvvSJDOcRxjAM9cZlbCpY2qeqa19L6HkqMFfZ5LOFgIV+v2j7+3LK6eLXBoMSP1Em
|
||||
em1ZlV318TkBYGenIE0S6Q1/FxdHjHrWztTySDPq7Kd0ymnHwd8VtTyVh+kt4Rf57WZK6UBu2MxY
|
||||
PjrSkVQ/It5vxuLvbbMYqM4PT+QNk2uqQsHENdRk1RlGeYA9UEUc56tVVklqcW2tX2Ke0B9XAgMB
|
||||
AAGjggEqMIIBJjAfBgNVHSMEGDAWgBRxB+IEYRbk5fJl6zEPyeD0PJrVkTAdBgNVHQ4EFgQUi+Ue
|
||||
QjMWuNzfe5ZFDPXxgn3RGScwQAYDVR0gBDkwNzA1BgdggRwBbgEBMCowKAYIKwYBBQUHAgEWHGh0
|
||||
dHA6Ly9jYS5hbGlwYXkuY29tL2Nwcy5wZGYwDgYDVR0PAQH/BAQDAgbAMDAGA1UdHwQpMCcwJaAj
|
||||
oCGGH2h0dHA6Ly9jYS5hbGlwYXkuY29tL2NybDEwOS5jcmwwYAYIKwYBBQUHAQEEVDBSMCgGCCsG
|
||||
AQUFBzAChhxodHRwOi8vY2EuYWxpcGF5LmNvbS9jYTYuY2VyMCYGCCsGAQUFBzABhhpodHRwOi8v
|
||||
Y2EuYWxpcGF5LmNvbTo4MzQwLzANBgkqhkiG9w0BAQsFAAOCAQEASZVvz6RAf2Cu0hIGPDu9C3uP
|
||||
mGw0QotKtX6Fj88NIRjmVXwBwDFyb4cURW/9advMgHTlNiIEMl2u/jMAkqEZgihZxAoBinVKhm4z
|
||||
l8mCBxn/16HP6T2z1K+nQJmBQpjkajOVWu/Rs65eODs1/eSwwIn2XF2ThFBqEUuyKw4FtQGeCxMA
|
||||
fkgd+avdw4YSO+nIqK2aTAOMXcbWgfVkZ4CAR7nl77aF4I+NWa/dZ2r529XiuweNOxpDMsCYh9HH
|
||||
IL1glap20QPUgGvVHRnTQe0FdF+yv6yROtlvdGS8fTJHUdD1N35JgAndOZmCdORoLUO49uTYhymz
|
||||
uJ1rLwz528bCyA==
|
||||
-----END CERTIFICATE-----
|
||||
1
app/main/api/etc/merchant/alipay/应用公钥RSA2048.txt
Normal file
1
app/main/api/etc/merchant/alipay/应用公钥RSA2048.txt
Normal file
@@ -0,0 +1 @@
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAimARRmC5j1dUYL/uLSPfEaBpXH0Qv4Da0A9lZAHCqjO2hFoH6PNQjGf6+tr+giSyyr2yl2YZHAbZVtrq1Z1d2WLS3jbl2cdQXecLjFnFEvPRamRxU9xSkG072bBxa5+dIL70iQznEcYwDPXGZWwqWNqnqmtfS+h5KjBX2eSzhYCFfr9o+/tyyuni1waDEj9RJnptWZVd9fE5AWBnpyBNEukNfxcXR4x61s7U8kgz6uyndMppx8HfFbU8lYfpLeEX+e1mSulAbtjMWD460pFUPyLeb8bi722zGKjOD0/kDZNrqkLBxDXUZNUZRnmAPVBFHOerVVZJanFtrV9intAfVwIDAQAB
|
||||
@@ -0,0 +1 @@
|
||||
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCKYBFGYLmPV1Rgv+4tI98RoGlcfRC/gNrQD2VkAcKqM7aEWgfo81CMZ/r62v6CJLLKvbKXZhkcBtlW2urVnV3ZYtLeNuXZx1Bd5wuMWcUS89FqZHFT3FKQbTvZsHFrn50gvvSJDOcRxjAM9cZlbCpY2qeqa19L6HkqMFfZ5LOFgIV+v2j7+3LK6eLXBoMSP1Emem1ZlV318TkBYGenIE0S6Q1/FxdHjHrWztTySDPq7Kd0ymnHwd8VtTyVh+kt4Rf57WZK6UBu2MxYPjrSkVQ/It5vxuLvbbMYqM4PT+QNk2uqQsHENdRk1RlGeYA9UEUc56tVVklqcW2tX2Ke0B9XAgMBAAECggEAHbDLRByQ9C66zh+gjVL7FB8lPFEhfNW7HZWQHcs656Y87V0cAWHj0Jym/5hpr6cMLfBSF6YykQ7vJ3HFnZwsfO51bHS/EOFxXxSqJ61DWfOy5W8z2diWZqLpiqYPUBZpcpNGiPmZwviRatZ5gV2aIIKaIzjys6joBqNk1j36PxSmP5MGx9gR7B/qqLAPd+wGcZA0jRuzey0Z2YiXN3JS32+Cd/XVjc3DglioHkAynAAsxfGICDtIbnfQc4eRFJXP2TXHUDGQCLzV3fYFQRT8RPi9wJUYcWgx/mgyfdWDKBq464a0KS3dVuT05Q0+VQJTgFwX/eGu8ici4s5oL+wDEQKBgQD82hhpqpYPOMlHb+07MmITe/glSNGWPo0JgC6pCc+9VbN6S43Shc3idduMTt1o4WLMM9KoFUfxBjcvc+CQI94iskLArvjf/c0zE5J2euZLNdJwYaRsJ+7qQbdU0srhKzXb7fGq3LhSKlK/jJFdv/mga88UwVwaopdg6xmaxgkiwwKBgQCMGRr1EiLV29xlgTEXFcwDID9k149NZgpXzJd/VTscLXR1BuRNictjQRahK+B0hebC21doGJU5ubSdCVTUy2f9DZlhA0qiKBA/if98/q1gmok3c8bDtHDsVB40kPRojGc6WWWqu1MCMk++gmpGo+vXzJfV3ACmEDvUJF/eYPKf3QKBgHEr2KNq07FKdGSCB0donJcl9IITnqNFqfCnq7rDBnUy55sEOB0TAHyszbB2GAl6X7MQOug6ZjHN22Nk1Q0O0Lzs1o3RgtkWiwKibvqStYLSOzdLrMEv+nJlKX5QvreblIa0cGdOVT2JbfIII4Q3ia4wssYSaXwOa/zYHWS14J7rAoGAAUsWCZ8iPTErZrB7oIft+zVoAGlRBFjlzYuw9lb2FbuBsLbgkqqr+v2V1OUPzGOUDsZxlx9q+T5yoWR9qP07t4VRniimnrqZ88w1VJURSqwCikWCVzoqNLROFxQjfXeWWF6M5reV+5Y1UD/p9T78JWDZIftG8kGCG+I+FFJ2yu0CgYBOjrvGXkbTzVM5QkJYitzOBXwwTZEHSboiejvZpApttfJzPVN4pmvJdqIRMibrC1gDR9CULPM+kbaqgDYeaUSDd1oN5692AtHEN4+M/wshbpHwrdFFYZaaBGvu0vzktCXXJwON4cB3KTQs7sBQ8cT0t9d7fOZDIlpKP2oGKBB0QQ==
|
||||
BIN
app/main/api/etc/merchant/wxpay/apiclient_cert.p12
Normal file
BIN
app/main/api/etc/merchant/wxpay/apiclient_cert.p12
Normal file
Binary file not shown.
25
app/main/api/etc/merchant/wxpay/apiclient_cert.pem
Normal file
25
app/main/api/etc/merchant/wxpay/apiclient_cert.pem
Normal file
@@ -0,0 +1,25 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEOjCCAyKgAwIBAgIUa9Pz2GpHDB7TFHbsXvaNwW4CP0MwDQYJKoZIhvcNAQEL
|
||||
BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
|
||||
FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
|
||||
Q0EwHhcNMjYwMTE2MDYzMjU2WhcNMzEwMTE1MDYzMjU2WjCBkzETMBEGA1UEAwwK
|
||||
MTczODIwNTMxMjEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMT8wPQYDVQQL
|
||||
DDbmtbflj6PpvpnljY7mtbflrofnvZHnu5zlt6XkvZzlrqTvvIjkuKrkvZPlt6Xl
|
||||
lYbmiLfvvIkxCzAJBgNVBAYTAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJ
|
||||
KoZIhvcNAQEBBQADggEPADCCAQoCggEBANceMNVIEsOOHRuxB5DBNx7xPQamGP6c
|
||||
4dhYcaFobFqMqkfmS5sW7Md9M/gI/u73Km+q+oAkFIKNKehnh+P2Z3xRob1icVSw
|
||||
YScZDyonm9dj6XBbIXJIkbDTX1RRTOnyxOXhp5FFDt0qUqY/tRk2xRW/gCLTI/qf
|
||||
l2VGInFhy160vYvTv32hdKDPkQEvxpaZ3L3BjWtT0gHLV7VZSex56+3ZaOQM34tD
|
||||
TrJ/SIYB0MGrXM/1eAOrZ6NOUXqA5RuicYSYgzzReIgNw9yrh8qv++DCeockOF8n
|
||||
ixa647lP6Abn0u81CoSv6dLxNKT31Rrog2JnjcqmiZROBDCDWxUoQgkCAwEAAaOB
|
||||
uTCBtjAJBgNVHRMEAjAAMAsGA1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGK
|
||||
oIGHhoGEaHR0cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9D
|
||||
QT0xQkQ0MjIwRTUwREJDMDRCMDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhB
|
||||
Q0M0NzFCNjU0MjJFMTJCMjdBOUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqG
|
||||
SIb3DQEBCwUAA4IBAQAOPMt0W7remcedNuTJwPgTWM3Lt3rrWb2UuYYwIkSOz0/1
|
||||
eOjJJQDcllg2IrY0gWLDnuuYLjhX4v1tSNwXFJW0GyFr1uRe4cSevRuD+HWQ2mBv
|
||||
qcPrjmPID9ZutQl6TClS39DP6dcBZQq8nMI8DEdsX3pa0v+4kDsVc+rn40K4lgrg
|
||||
sD0+wvW/93pYcXfyEZWSNZ65ZcobR4etVGUbTprwxp1NwcvWwuB2p+5J7CC7O9e6
|
||||
l89XWm4Ald+URaSptxvyD83HNJmDw8VP9XY7xq2h5QzNwOB6jHLj7D9LhIRiY5lx
|
||||
ixV9UdZt/1hVdwZjtsBlmpdHB6deja07hxfTZZiQ
|
||||
-----END CERTIFICATE-----
|
||||
28
app/main/api/etc/merchant/wxpay/apiclient_key.pem
Normal file
28
app/main/api/etc/merchant/wxpay/apiclient_key.pem
Normal file
@@ -0,0 +1,28 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDXHjDVSBLDjh0b
|
||||
sQeQwTce8T0Gphj+nOHYWHGhaGxajKpH5kubFuzHfTP4CP7u9ypvqvqAJBSCjSno
|
||||
Z4fj9md8UaG9YnFUsGEnGQ8qJ5vXY+lwWyFySJGw019UUUzp8sTl4aeRRQ7dKlKm
|
||||
P7UZNsUVv4Ai0yP6n5dlRiJxYctetL2L0799oXSgz5EBL8aWmdy9wY1rU9IBy1e1
|
||||
WUnseevt2WjkDN+LQ06yf0iGAdDBq1zP9XgDq2ejTlF6gOUbonGEmIM80XiIDcPc
|
||||
q4fKr/vgwnqHJDhfJ4sWuuO5T+gG59LvNQqEr+nS8TSk99Ua6INiZ43KpomUTgQw
|
||||
g1sVKEIJAgMBAAECggEASl9TvslWQ2nkwmgoF3HVnssEsEHIrm6K3oNldcpme7/a
|
||||
N1V1mj8IyceNqhliGjg14bmZNahDtwcbEBCLONM94AtRAesBB6ibTispxQdAp+0R
|
||||
DhlTrPFN/XZ2pO4ey1t1m4yypFTd2LUDMhsgf4EiDmzQ3jllXQbEDu16hvyqlSkB
|
||||
QWtxVdP7ztvnaACxZ1Ex0OzIe8ZitWzAXEG/zFFENRiJovSFjsWdKVNyHrjgBqTz
|
||||
o2AK71c0H7rnVLbDWzW9CuuipiM38Ujoc5aSQbPOjP1F7oNTqTXNzLjhlQTSg6fn
|
||||
roHSRcjCjIlqGuhmkJ27FKbAn+XH7fTXDgGowSpVKQKBgQD4OzYY0hQSws1rTzEw
|
||||
BB9/2F1merR2zxtv8MXY5Iu242xd6h0UnTfwe7ZAnfYtuGpwiF3VlJeHUEYCaPoM
|
||||
ab5GCcaO8QFOO4qKvJWtvdnS8nfcfy4oE1RKb1y4cYbaZrPENdi9blwM+hSBk95T
|
||||
MXitDbhcXy4GadQX9x+qTEtVZwKBgQDd2a46h5u8RI5nLp15N/5LENaW4OhoDslr
|
||||
bbCRerXple4+WEEXKDfW5K8YjvUTpE1krA/HUaeqdyc7ZBJy/JWNbgXL33ZuoErN
|
||||
PgPA38cVvLF9j9JtKczkNDqksc4qV00UafAqkEs6Fvs4eaCHngzjkXjJtySifPgA
|
||||
e+gTuh4XDwKBgQCm235YntYZalKUoG3q3cqisDjQSwkFl9/Ulh8X1UDJFgRg+J7F
|
||||
nYzdnPr8YnH5d64sqK2ShMh6j44PzqrOL0JUZ/vNV9lN0h4ldfCTEjvaXVwOnnrT
|
||||
O3L8efD0lnNUWZba/GsNoqJDotKn61KVz3pTsRZNGTmh2/9SgK4LVi+JXwKBgD6P
|
||||
cRtePGOF7aZZNd0GFjay4+CeQct+R/x8bStJMF1Tg2CfYJOYKs71pA7H2YKVdaGr
|
||||
B7QMabyfZzfPS4iTg9TjLs1EEdC2cQGZuFM+h5SwplijIxLXk8jSlar13Q6BmeHk
|
||||
0e4ezKfv7R4K5mL4BehykF5JwBH2LbVtO4+8j1mvAoGBAPE8dUl65+ky+2929P4O
|
||||
JYxICvFOyD+00N3MkrGdMapn61GUWp3rXxdPKJkmgCPLU2JATapY4wRTL392ZD5g
|
||||
wJS/DTFRwnS/KuqPPx2zsahZpzq+VyfFDhk71MfE9kPyZEHPttqddGSqlxUyeDcp
|
||||
n10ngaerHDe8Xhw8Np9tj+yp
|
||||
-----END PRIVATE KEY-----
|
||||
9
app/main/api/etc/merchant/wxpay/pub_key.pem
Normal file
9
app/main/api/etc/merchant/wxpay/pub_key.pem
Normal file
@@ -0,0 +1,9 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwamIS5KioHheN2FuePF0
|
||||
WQyoCKbixwybUZCJCb2rgEgp0slmCnpneLhVwejXYTJT6t2W6683Dj70gfs+g5+P
|
||||
AjxA7UrBIN/IJalNz1m95NSNzg3VnK56p7x+PJpQrfwAOmEdqdxj9IS3wVYMFQnu
|
||||
oCA2K2hnhKdEbaWI6iZM2wweGLeqhVQlhIJXLQJ4/OWVCyZ/fR+g6atuX0Uz6JGX
|
||||
yY+0Is0sj56Lw8gtGNjKoFkEFy/p/eB+C0Rg7WCsZICuB1UZuAZEpS0L55qi9f33
|
||||
s3vdWJHnWj5FKKBLTW1qtUA7uU24uk9aJaKGlWKBUC26QQpTbh2pVEEQa6ZxghDO
|
||||
1QIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
18
app/main/api/etc/merchant/wxpay/璇佷功浣跨敤璇存槑.txt
Normal file
18
app/main/api/etc/merchant/wxpay/璇佷功浣跨敤璇存槑.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
欢迎使用微信支付!
|
||||
附件中的三份文件(证书pkcs12格式、证书pem格式、证书密钥pem格式),为接口中强制要求时需携带的证书文件。
|
||||
证书属于敏感信息,请妥善保管不要泄露和被他人复制。
|
||||
不同开发语言下的证书格式不同,以下为说明指引:
|
||||
证书pkcs12格式(apiclient_cert.p12)
|
||||
包含了私钥信息的证书文件,为p12(pfx)格式,由微信支付签发给您用来标识和界定您的身份
|
||||
部分安全性要求较高的API需要使用该证书来确认您的调用身份
|
||||
windows上可以直接双击导入系统,导入过程中会提示输入证书密码,证书密码默认为您的商户号(如:1900006031)
|
||||
证书pem格式(apiclient_cert.pem)
|
||||
从apiclient_cert.p12中导出证书部分的文件,为pem格式,请妥善保管不要泄漏和被他人复制
|
||||
部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供
|
||||
您也可以使用openssl命令来自己导出:openssl pkcs12 -clcerts -nokeys -in apiclient_cert.p12 -out apiclient_cert.pem
|
||||
证书密钥pem格式(apiclient_key.pem)
|
||||
从apiclient_cert.p12中导出密钥部分的文件,为pem格式
|
||||
部分开发语言和环境,不能直接使用p12文件,而需要使用pem,所以为了方便您使用,已为您直接提供
|
||||
您也可以使用openssl命令来自己导出:openssl pkcs12 -nocerts -in apiclient_cert.p12 -out apiclient_key.pem
|
||||
备注说明:
|
||||
由于绝大部分操作系统已内置了微信支付服务器证书的根CA证书, 2018年3月6日后, 不再提供CA证书文件(rootca.pem)下载
|
||||
131
app/main/api/internal/config/config.go
Normal file
131
app/main/api/internal/config/config.go
Normal file
@@ -0,0 +1,131 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/zeromicro/go-zero/core/stores/cache"
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
rest.RestConf
|
||||
DataSource string
|
||||
CacheRedis cache.CacheConf
|
||||
JwtAuth JwtAuth // JWT 鉴权相关配置
|
||||
VerifyCode VerifyCode
|
||||
Encrypt Encrypt
|
||||
Alipay AlipayConfig
|
||||
Wxpay WxpayConfig
|
||||
Applepay ApplepayConfig
|
||||
Ali AliConfig
|
||||
Tianyuanapi TianyuanapiConfig
|
||||
SystemConfig SystemConfig
|
||||
WechatH5 WechatH5Config
|
||||
Authorization AuthorizationConfig // 授权书配置
|
||||
WechatMini WechatMiniConfig
|
||||
Query QueryConfig
|
||||
AdminConfig AdminConfig
|
||||
AdminPromotion AdminPromotion
|
||||
TaxConfig TaxConfig
|
||||
ExtensionTime int64
|
||||
}
|
||||
|
||||
// JwtAuth 用于 JWT 鉴权配置
|
||||
type JwtAuth struct {
|
||||
AccessSecret string // JWT 密钥,用于签发 Token
|
||||
AccessExpire int64 // Token 过期时间,单位为秒
|
||||
RefreshAfter int64
|
||||
}
|
||||
type VerifyCode struct {
|
||||
AccessKeyID string
|
||||
AccessKeySecret string
|
||||
EndpointURL string
|
||||
SignName string
|
||||
TemplateCode string
|
||||
ValidTime int
|
||||
}
|
||||
type Encrypt struct {
|
||||
SecretKey string
|
||||
}
|
||||
|
||||
type AlipayConfig struct {
|
||||
AppID string
|
||||
PrivateKey string
|
||||
AlipayPublicKey string
|
||||
AppCertPath string // 应用公钥证书路径
|
||||
AlipayCertPath string // 支付宝公钥证书路径
|
||||
AlipayRootCertPath string // 根证书路径
|
||||
IsProduction bool
|
||||
NotifyUrl string
|
||||
ReturnURL string
|
||||
}
|
||||
type WxpayConfig struct {
|
||||
AppID string
|
||||
MchID string
|
||||
MchCertificateSerialNumber string
|
||||
MchApiv3Key string
|
||||
MchPrivateKeyPath string
|
||||
MchPublicKeyID string
|
||||
MchPublicKeyPath string
|
||||
NotifyUrl string
|
||||
RefundNotifyUrl string
|
||||
}
|
||||
type AliConfig struct {
|
||||
Code string
|
||||
}
|
||||
type ApplepayConfig struct {
|
||||
ProductionVerifyURL string
|
||||
SandboxVerifyURL string // 沙盒环境的验证 URL
|
||||
Sandbox bool
|
||||
BundleID string
|
||||
IssuerID string
|
||||
KeyID string
|
||||
LoadPrivateKeyPath string
|
||||
}
|
||||
type WestConfig struct {
|
||||
Url string
|
||||
Key string
|
||||
SecretId string
|
||||
SecretSecondId string
|
||||
}
|
||||
type YushanConfig struct {
|
||||
ApiKey string
|
||||
AcctID string
|
||||
Url string
|
||||
}
|
||||
type SystemConfig struct {
|
||||
ThreeVerify bool // 是否开启三级实名认证
|
||||
CommissionSafeMode bool // 佣金安全防御模式:true-冻结模式(status=1,进入frozen_balance),false-直接结算(status=0,进入balance)
|
||||
}
|
||||
type WechatH5Config struct {
|
||||
AppID string
|
||||
AppSecret string
|
||||
}
|
||||
type WechatMiniConfig struct {
|
||||
AppID string
|
||||
AppSecret string
|
||||
}
|
||||
type QueryConfig struct {
|
||||
ShareLinkExpire int64
|
||||
}
|
||||
type AdminConfig struct {
|
||||
AccessSecret string
|
||||
AccessExpire int64
|
||||
RefreshAfter int64
|
||||
}
|
||||
|
||||
type AdminPromotion struct {
|
||||
URLDomain string
|
||||
}
|
||||
type TaxConfig struct {
|
||||
TaxRate float64
|
||||
TaxExemptionAmount float64
|
||||
}
|
||||
type TianyuanapiConfig struct {
|
||||
AccessID string
|
||||
Key string
|
||||
BaseURL string
|
||||
Timeout int64
|
||||
}
|
||||
|
||||
type AuthorizationConfig struct {
|
||||
FileBaseURL string // 授权书文件访问基础URL
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminBatchUnfreezeAgentCommissionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminBatchUnfreezeAgentCommissionReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminBatchUnfreezeAgentCommissionLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminBatchUnfreezeAgentCommission(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentCommissionDeductionListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentCommissionDeductionListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentCommissionDeductionListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentCommissionDeductionList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentCommissionListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentCommissionListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentCommissionListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentCommissionList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentLinkListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentLinkListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentLinkListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentLinkList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
)
|
||||
|
||||
func AdminGetAgentLinkProductStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentLinkProductStatisticsReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentLinkProductStatisticsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentLinkProductStatistics(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentMembershipConfigListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentMembershipConfigListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentMembershipConfigListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentMembershipConfigList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentMembershipRechargeOrderListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentMembershipRechargeOrderListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentMembershipRechargeOrderListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentMembershipRechargeOrderList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
)
|
||||
|
||||
func AdminGetAgentOrderStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentOrderStatisticsReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentOrderStatisticsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentOrderStatistics(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentPlatformDeductionListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentPlatformDeductionListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentPlatformDeductionListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentPlatformDeductionList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentProductionConfigListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentProductionConfigListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentProductionConfigListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentProductionConfigList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentRewardListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentRewardListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentRewardListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentRewardList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
)
|
||||
|
||||
func AdminGetAgentStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentStatisticsReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentStatisticsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentStatistics(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentWalletHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentWalletReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentWalletLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentWallet(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
)
|
||||
|
||||
func AdminGetAgentWalletTransactionListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentWalletTransactionListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentWalletTransactionListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentWalletTransactionList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentWithdrawalListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentWithdrawalListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentWithdrawalListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentWithdrawalList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/common/result"
|
||||
)
|
||||
|
||||
func AdminGetSystemConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := admin_agent.NewAdminGetSystemConfigLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetSystemConfig()
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetWithdrawalStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetWithdrawalStatisticsReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetWithdrawalStatisticsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetWithdrawalStatistics(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
)
|
||||
|
||||
func AdminReviewBankCardWithdrawalHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminReviewBankCardWithdrawalReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminReviewBankCardWithdrawalLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminReviewBankCardWithdrawal(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateAgentCommissionStatusHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateAgentCommissionStatusReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminUpdateAgentCommissionStatusLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateAgentCommissionStatus(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateAgentMembershipConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateAgentMembershipConfigReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminUpdateAgentMembershipConfigLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateAgentMembershipConfig(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateAgentProductionConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateAgentProductionConfigReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminUpdateAgentProductionConfigLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateAgentProductionConfig(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateAgentWalletBalanceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateAgentWalletBalanceReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminUpdateAgentWalletBalanceLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateAgentWalletBalance(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_agent"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateSystemConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateSystemConfigReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminUpdateSystemConfigLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateSystemConfig(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_api"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminBatchUpdateApiStatusHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminBatchUpdateApiStatusReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_api.NewAdminBatchUpdateApiStatusLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminBatchUpdateApiStatus(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_api"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminCreateApiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminCreateApiReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_api.NewAdminCreateApiLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminCreateApi(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_api"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminDeleteApiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminDeleteApiReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_api.NewAdminDeleteApiLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminDeleteApi(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_api"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetApiDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetApiDetailReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_api.NewAdminGetApiDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetApiDetail(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_api"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetApiListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetApiListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_api.NewAdminGetApiListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetApiList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_api"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateApiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateApiReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_api.NewAdminUpdateApiLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateApi(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_auth"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminLoginReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_auth.NewAdminLoginLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminLogin(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_feature
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_feature"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminConfigFeatureExampleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminConfigFeatureExampleReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_feature.NewAdminConfigFeatureExampleLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminConfigFeatureExample(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_feature
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_feature"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminCreateFeatureHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminCreateFeatureReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_feature.NewAdminCreateFeatureLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminCreateFeature(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_feature
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_feature"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminDeleteFeatureHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminDeleteFeatureReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_feature.NewAdminDeleteFeatureLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminDeleteFeature(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_feature
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_feature"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetFeatureDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetFeatureDetailReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_feature.NewAdminGetFeatureDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetFeatureDetail(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_feature
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_feature"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetFeatureExampleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetFeatureExampleReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_feature.NewAdminGetFeatureExampleLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetFeatureExample(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_feature
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_feature"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetFeatureListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetFeatureListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_feature.NewAdminGetFeatureListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetFeatureList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_feature
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_feature"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateFeatureHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateFeatureReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_feature.NewAdminUpdateFeatureLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateFeature(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_menu
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_menu"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func CreateMenuHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.CreateMenuReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_menu.NewCreateMenuLogic(r.Context(), svcCtx)
|
||||
resp, err := l.CreateMenu(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_menu
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_menu"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func DeleteMenuHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.DeleteMenuReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_menu.NewDeleteMenuLogic(r.Context(), svcCtx)
|
||||
resp, err := l.DeleteMenu(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_menu
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_menu"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetMenuAllHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetMenuAllReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_menu.NewGetMenuAllLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetMenuAll(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_menu
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_menu"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetMenuDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetMenuDetailReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_menu.NewGetMenuDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetMenuDetail(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_menu
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_menu"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetMenuListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetMenuListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_menu.NewGetMenuListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetMenuList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_menu
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_menu"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateMenuHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateMenuReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_menu.NewUpdateMenuLogic(r.Context(), svcCtx)
|
||||
resp, err := l.UpdateMenu(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_notification
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_notification"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminCreateNotificationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminCreateNotificationReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_notification.NewAdminCreateNotificationLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminCreateNotification(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_notification
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_notification"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminDeleteNotificationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminDeleteNotificationReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_notification.NewAdminDeleteNotificationLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminDeleteNotification(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_notification
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_notification"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetNotificationDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetNotificationDetailReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_notification.NewAdminGetNotificationDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetNotificationDetail(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_notification
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_notification"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetNotificationListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetNotificationListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_notification.NewAdminGetNotificationListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetNotificationList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_notification
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_notification"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateNotificationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateNotificationReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_notification.NewAdminUpdateNotificationLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateNotification(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminCreateOrderHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminCreateOrderReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminCreateOrderLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminCreateOrder(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminDeleteOrderHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminDeleteOrderReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminDeleteOrderLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminDeleteOrder(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetOrderDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetOrderDetailReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminGetOrderDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetOrderDetail(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetOrderListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetOrderListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminGetOrderListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetOrderList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetOrderSourceStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetOrderSourceStatisticsReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminGetOrderSourceStatisticsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetOrderSourceStatistics(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
)
|
||||
|
||||
func AdminGetOrderStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetOrderStatisticsReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminGetOrderStatisticsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetOrderStatistics(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
)
|
||||
|
||||
func AdminGetRefundStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetRefundStatisticsReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminGetRefundStatisticsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetRefundStatistics(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetRevenueStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetRevenueStatisticsReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminGetRevenueStatisticsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetRevenueStatistics(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminRefundOrderHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminRefundOrderReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminRefundOrderLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminRefundOrder(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"xingfucha-server/app/main/api/internal/logic/admin_order"
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
"xingfucha-server/common/result"
|
||||
"xingfucha-server/pkg/lzkit/validator"
|
||||
)
|
||||
|
||||
func AdminRetryAgentProcessHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminRetryAgentProcessReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_order.NewAdminRetryAgentProcessLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminRetryAgentProcess(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user