first commit
This commit is contained in:
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"]
|
||||
108
app/main/api/desc/admin/admin_feature.api
Normal file
108
app/main/api/desc/admin/admin_feature.api
Normal file
@@ -0,0 +1,108 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "后台功能管理服务"
|
||||
desc: "后台功能管理相关接口"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 功能管理接口
|
||||
@server(
|
||||
prefix: /api/v1/admin/feature
|
||||
group: admin_feature
|
||||
)
|
||||
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)
|
||||
}
|
||||
|
||||
type (
|
||||
// 创建功能请求
|
||||
AdminCreateFeatureReq {
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 描述
|
||||
}
|
||||
|
||||
// 创建功能响应
|
||||
AdminCreateFeatureResp {
|
||||
Id int64 `json:"id"` // 功能ID
|
||||
}
|
||||
|
||||
// 更新功能请求
|
||||
AdminUpdateFeatureReq {
|
||||
Id int64 `path:"id"` // 功能ID
|
||||
ApiId *string `json:"api_id,optional"` // API标识
|
||||
Name *string `json:"name,optional"` // 描述
|
||||
}
|
||||
|
||||
// 更新功能响应
|
||||
AdminUpdateFeatureResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除功能请求
|
||||
AdminDeleteFeatureReq {
|
||||
Id int64 `path:"id"` // 功能ID
|
||||
}
|
||||
|
||||
// 删除功能响应
|
||||
AdminDeleteFeatureResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 获取功能列表请求
|
||||
AdminGetFeatureListReq {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
ApiId *string `form:"api_id,optional"` // API标识
|
||||
Name *string `form:"name,optional"` // 描述
|
||||
}
|
||||
|
||||
// 功能列表项
|
||||
FeatureListItem {
|
||||
Id int64 `json:"id"` // 功能ID
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 描述
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
// 获取功能列表响应
|
||||
AdminGetFeatureListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []FeatureListItem `json:"items"` // 列表数据
|
||||
}
|
||||
|
||||
// 获取功能详情请求
|
||||
AdminGetFeatureDetailReq {
|
||||
Id int64 `path:"id"` // 功能ID
|
||||
}
|
||||
|
||||
// 获取功能详情响应
|
||||
AdminGetFeatureDetailResp {
|
||||
Id int64 `json:"id"` // 功能ID
|
||||
ApiId string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 描述
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
)
|
||||
175
app/main/api/desc/admin/admin_product.api
Normal file
175
app/main/api/desc/admin/admin_product.api
Normal file
@@ -0,0 +1,175 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "后台产品管理服务"
|
||||
desc: "后台产品管理相关接口"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 产品管理接口
|
||||
@server(
|
||||
prefix: /api/v1/admin/product
|
||||
group: admin_product
|
||||
)
|
||||
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"` // 是否成功
|
||||
}
|
||||
)
|
||||
135
app/main/api/desc/admin/admin_query.api
Normal file
135
app/main/api/desc/admin/admin_query.api
Normal file
@@ -0,0 +1,135 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "查询服务"
|
||||
desc: "查询服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/query
|
||||
group: admin_query
|
||||
jwt: JwtAuth
|
||||
)
|
||||
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"` // 是否成功
|
||||
}
|
||||
131
app/main/api/desc/admin/admin_user.api
Normal file
131
app/main/api/desc/admin/admin_user.api
Normal file
@@ -0,0 +1,131 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "后台用户中心服务"
|
||||
desc: "后台用户中心服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/user
|
||||
group: admin_user
|
||||
jwt: JwtAuth
|
||||
)
|
||||
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)
|
||||
}
|
||||
|
||||
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"` // 角色编码列表
|
||||
}
|
||||
)
|
||||
34
app/main/api/desc/admin/auth.api
Normal file
34
app/main/api/desc/admin/auth.api
Normal file
@@ -0,0 +1,34 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "认证中心服务"
|
||||
desc: "认证中心服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
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"`
|
||||
}
|
||||
)
|
||||
149
app/main/api/desc/admin/menu.api
Normal file
149
app/main/api/desc/admin/menu.api
Normal file
@@ -0,0 +1,149 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "菜单中心服务"
|
||||
desc: "菜单中心服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/menu
|
||||
group: admin_menu
|
||||
jwt: JwtAuth
|
||||
)
|
||||
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"`
|
||||
}
|
||||
)
|
||||
127
app/main/api/desc/admin/notification.api
Normal file
127
app/main/api/desc/admin/notification.api
Normal file
@@ -0,0 +1,127 @@
|
||||
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
|
||||
)
|
||||
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)
|
||||
}
|
||||
164
app/main/api/desc/admin/order.api
Normal file
164
app/main/api/desc/admin/order.api
Normal file
@@ -0,0 +1,164 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "订单服务"
|
||||
desc: "订单服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/order
|
||||
group: admin_order
|
||||
jwt: JwtAuth
|
||||
)
|
||||
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)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
AdminGetOrderListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
OrderNo string `form:"order_no,optional"` // 商户订单号
|
||||
PlatformOrderId string `form:"platform_order_id,optional"` // 支付订单号
|
||||
ProductName string `form:"product_name,optional"` // 产品名称
|
||||
PaymentPlatform string `form:"payment_platform,optional"` // 支付方式
|
||||
PaymentScene string `form:"payment_scene,optional"` // 支付平台
|
||||
Amount float64 `form:"amount,optional"` // 金额
|
||||
Status string `form:"status,optional"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
CreateTimeStart string `form:"create_time_start,optional"` // 创建时间开始
|
||||
CreateTimeEnd string `form:"create_time_end,optional"` // 创建时间结束
|
||||
PayTimeStart string `form:"pay_time_start,optional"` // 支付时间开始
|
||||
PayTimeEnd string `form:"pay_time_end,optional"` // 支付时间结束
|
||||
RefundTimeStart string `form:"refund_time_start,optional"` // 退款时间开始
|
||||
RefundTimeEnd string `form:"refund_time_end,optional"` // 退款时间结束
|
||||
}
|
||||
|
||||
// 列表响应
|
||||
AdminGetOrderListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []OrderListItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
// 列表项
|
||||
OrderListItem {
|
||||
Id 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"` // 金额
|
||||
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"` // 退款时间
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
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"` // 金额
|
||||
Status string `json:"status"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
QueryState string `json:"query_state"` // 查询状态:pending-待查询,success-查询成功,failed-查询失败 processing-查询中
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
PayTime string `json:"pay_time"` // 支付时间
|
||||
RefundTime string `json:"refund_time"` // 退款时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
AdminCreateOrderReq {
|
||||
OrderNo string `json:"order_no"` // 商户订单号
|
||||
PlatformOrderId string `json:"platform_order_id"` // 支付订单号
|
||||
ProductName string `json:"product_name"` // 产品名称
|
||||
PaymentPlatform string `json:"payment_platform"` // 支付方式
|
||||
PaymentScene string `json:"payment_scene"` // 支付平台
|
||||
Amount float64 `json:"amount"` // 金额
|
||||
Status string `json:"status,default=pending"` // 支付状态:pending-待支付,paid-已支付,refunded-已退款,closed-已关闭,failed-支付失败
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
AdminCreateOrderResp {
|
||||
Id 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"` // 退款时间
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
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"` // 退款金额
|
||||
}
|
||||
)
|
||||
124
app/main/api/desc/admin/platform_user.api
Normal file
124
app/main/api/desc/admin/platform_user.api
Normal file
@@ -0,0 +1,124 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "平台用户管理"
|
||||
desc: "平台用户管理"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 平台用户管理接口
|
||||
@server(
|
||||
prefix: /api/v1/admin/platform_user
|
||||
group: admin_platform_user
|
||||
jwt: JwtAuth
|
||||
)
|
||||
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"` // 是否成功
|
||||
}
|
||||
)
|
||||
124
app/main/api/desc/admin/role.api
Normal file
124
app/main/api/desc/admin/role.api
Normal file
@@ -0,0 +1,124 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "角色服务"
|
||||
desc: "角色服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/role
|
||||
group: admin_role
|
||||
jwt: JwtAuth
|
||||
)
|
||||
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"` // 是否成功
|
||||
}
|
||||
)
|
||||
39
app/main/api/desc/front/app.api
Normal file
39
app/main/api/desc/front/app.api
Normal file
@@ -0,0 +1,39 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "APP服务"
|
||||
desc: "APP服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
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"`
|
||||
}
|
||||
)
|
||||
73
app/main/api/desc/front/pay.api
Normal file
73
app/main/api/desc/front/pay.api
Normal file
@@ -0,0 +1,73 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "支付服务"
|
||||
desc: "支付服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
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"`
|
||||
}
|
||||
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"`
|
||||
}
|
||||
)
|
||||
59
app/main/api/desc/front/product.api
Normal file
59
app/main/api/desc/front/product.api
Normal file
@@ -0,0 +1,59 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品服务"
|
||||
desc: "产品服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
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
|
||||
jwt: JwtAuth
|
||||
middleware: UserAuthInterceptor
|
||||
|
||||
)
|
||||
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)
|
||||
}
|
||||
224
app/main/api/desc/front/query.api
Normal file
224
app/main/api/desc/front/query.api
Normal file
@@ -0,0 +1,224 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品查询服务"
|
||||
desc: "产品查询服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
//============================> query v1 <============================
|
||||
// 查询基本类型定义
|
||||
type Query {
|
||||
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 []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
|
||||
}
|
||||
|
||||
|
||||
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"`
|
||||
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"`
|
||||
}
|
||||
|
||||
164
app/main/api/desc/front/user.api
Normal file
164
app/main/api/desc/front/user.api
Normal file
@@ -0,0 +1,164 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "用户中心服务"
|
||||
desc: "用户中心服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
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)
|
||||
}
|
||||
|
||||
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"`
|
||||
Platform string `json:"platform,optional,default=tyc"`
|
||||
}
|
||||
WXMiniAuthResp {
|
||||
AccessToken string `json:"accessToken"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
RefreshAfter int64 `json:"refreshAfter"`
|
||||
}
|
||||
)
|
||||
|
||||
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 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"` // 总记录数
|
||||
}
|
||||
)
|
||||
27
app/main/api/desc/main.api
Normal file
27
app/main/api/desc/main.api
Normal file
@@ -0,0 +1,27 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "单体服务中心"
|
||||
desc: "单体服务中心"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// 前台
|
||||
import "./front/user.api"
|
||||
import "./front/query.api"
|
||||
import "./front/pay.api"
|
||||
import "./front/product.api"
|
||||
import "./front/app.api"
|
||||
// 后台
|
||||
import "./admin/auth.api"
|
||||
import "./admin/menu.api"
|
||||
import "./admin/role.api"
|
||||
import "./admin/order.api"
|
||||
import "./admin/admin_user.api"
|
||||
import "./admin/platform_user.api"
|
||||
import "./admin/notification.api"
|
||||
import "./admin/admin_product.api"
|
||||
import "./admin/admin_feature.api"
|
||||
import "./admin/admin_query.api"
|
||||
66
app/main/api/etc/main.dev.yaml
Normal file
66
app/main/api/etc/main.dev.yaml
Normal file
@@ -0,0 +1,66 @@
|
||||
Name: main
|
||||
Host: 0.0.0.0
|
||||
Port: 8888
|
||||
DataSource: "aedata:6bV4kPqR1sXe@tcp(127.0.0.1:21001)/aedata?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
CacheRedis:
|
||||
- Host: "127.0.0.1:21002"
|
||||
Pass: "8nT5yQwL2zXr" # Redis 密码,如果未设置则留空
|
||||
Type: "node" # 单节点模式
|
||||
JwtAuth:
|
||||
AccessSecret: "WUvoIwL-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: "2021005113664540"
|
||||
PrivateKey: "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCA1mtTVZmB/7/wWV37Z8hUXEXFs0Gn1/Ie7c6rPQQRUlPHyJGcPAZvDii+ySC1/bplneMENRAjCuoJEM1z4X1FMt8rLggCqnF1xzUN2p9fdXUwcRPmSV4yi9ggMiFXldm0/eyaobV2fj0/VSLED2Qc8xBStM9pqkfszwf2rsAAKL15WQXOUiQw0s25s+Du18H4+YgkQ0HBr0+VPfhL4QoOvsE34ZYP0TuTwxVheYNkvSOPXFXmtE3z/b+75y2n2msa9S4HItNVYpOkB7z3GDB+0/rvX+Q+GvYI9BSBbgJwEuqiMN2SwQyAjH608JBoAUGnk0ygfG8juF77shBxzr/vAgMBAAECggEAQTlL2E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5Iqq4E40xmDO3rUysrH8Zj7MN47ykZI0SlwA9B6hqliRLLJXkzhaAamecWb1RNJFDWfcg4bIyew4ukRbYB07RI+l0DXEgOxxTBcvN6BNUoIiQSEKXkOv+xt7Ez2TBoDm67xD58vwSXT4aPt4qxnd4i7Ves"
|
||||
AlipayPublicKey: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0kkRL7lgKYs7f8Xi4DNKzp2ggjwy4By7RunwT4Ur4A71HVOqRQed9r45a6/W4JPuVv51tiHMojZifEKX7ixSlDG6be677RiNslMJ5G3mjw/+Ku01tV9Qzw5YyhvxbqmS8Qp9vgL8VPYhxqTxKO6WW+xiyVvxko+mrU+dbSFIVbBjp88NVVcquu+vZT/uwtjriKSwsesAm8DkKT6mTqY5P/JroMzTU7xa3/ErAMte6t2dOsxPS7kqWjJyoLBHRk+AH87X5lNBEjLgYPk1ADU7zFsLdC+nv4fm7nihYre7fCrdCTVKguXmPCEFBjqwSkag7BSIxRQjS3qHxi+DUMst7wIDAQAB"
|
||||
AppCertPath: "etc/merchant/appCertPublicKey_2021005113664540.crt"
|
||||
AlipayCertPath: "etc/merchant/alipayCertPublicKey_RSA2.crt"
|
||||
AlipayRootCertPath: "etc/merchant/alipayRootCert.crt"
|
||||
IsProduction: true
|
||||
NotifyUrl: "https://6m4685017o.goho.co/api/v1/pay/alipay/callback"
|
||||
ReturnURL: "http://localhost:5678/inquire"
|
||||
|
||||
Wxpay:
|
||||
AppID: "wxa581992dc74d860e"
|
||||
MchID: "1704330055"
|
||||
MchCertificateSerialNumber: "749065854D0CECCE8F98EAFEA55AD4FB17F868C4"
|
||||
MchApiv3Key: "A9f3G7kL2mP5sQ8tV1xY4zB6nC0dE3hJ"
|
||||
MchPrivateKeyPath: "etc/merchant/apiclient_key.pem"
|
||||
MchPublicKeyID: "PUB_KEY_ID_0117043300552025010900447500000187"
|
||||
MchPublicKeyPath: "etc/merchant/pub_key.pem"
|
||||
NotifyUrl: "https://6m4685017o.goho.co/api/v1/pay/wechat/callback"
|
||||
RefundNotifyUrl: "https://6m4685017o.goho.co/api/v1/wechat/refund_callback"
|
||||
|
||||
Ali:
|
||||
Code: "d55b58829efb41c8aa8e86769cba4844"
|
||||
SystemConfig:
|
||||
ThreeVerify: false
|
||||
WechatH5:
|
||||
AppID: "wxa581992dc74d860e"
|
||||
AppSecret: "4de1fbf521712247542d49907fcd5dbf"
|
||||
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
|
||||
Tianyuanapi:
|
||||
AccessID: "2974d99ddf0b91a7"
|
||||
Key: "c701a573200f64d4ab38b0aa03ae56d2"
|
||||
BaseURL: "https://api.tianyuanapi.com"
|
||||
Timeout: 60
|
||||
67
app/main/api/etc/main.yaml
Normal file
67
app/main/api/etc/main.yaml
Normal file
@@ -0,0 +1,67 @@
|
||||
Name: main
|
||||
Host: 0.0.0.0
|
||||
Port: 8888
|
||||
DataSource: "aedata:5vg67b3UNHu8@tcp(aedata_mysql:3306)/aedata?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
CacheRedis:
|
||||
- Host: "aedata_redis:6379"
|
||||
Pass: "3m3WsgyCKWqz" # Redis 密码,如果未设置则留空
|
||||
Type: "node" # 单节点模式
|
||||
|
||||
JwtAuth:
|
||||
AccessSecret: "WUvoIwL-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: "2021005113664540"
|
||||
PrivateKey: "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCA1mtTVZmB/7/wWV37Z8hUXEXFs0Gn1/Ie7c6rPQQRUlPHyJGcPAZvDii+ySC1/bplneMENRAjCuoJEM1z4X1FMt8rLggCqnF1xzUN2p9fdXUwcRPmSV4yi9ggMiFXldm0/eyaobV2fj0/VSLED2Qc8xBStM9pqkfszwf2rsAAKL15WQXOUiQw0s25s+Du18H4+YgkQ0HBr0+VPfhL4QoOvsE34ZYP0TuTwxVheYNkvSOPXFXmtE3z/b+75y2n2msa9S4HItNVYpOkB7z3GDB+0/rvX+Q+GvYI9BSBbgJwEuqiMN2SwQyAjH608JBoAUGnk0ygfG8juF77shBxzr/vAgMBAAECggEAQTlL2EJrlm59IxZ7B72Ao4SbJf0b7fba8mF90R7wojxFgcy+OpQAxdQrOHrl/nxXEv6dYRHj+3mZBcHl4RZ0rsWUSW3iTEcxbWjOKRdWu6LhEwcMBfd6oqg9X/9A9fA86O3sDFR1Y2mBZECbexo3mphK2TQEFQBJrU8aPv404V784u0wTh1oLO0Z3NjgvXOAy3ZsM64oZROVCkObXnZGyrY8Hf6W+YLmCoI7eajOQ9QTFy1x24fm8LFdWNizG9/DFa4EC7ZjiYzFhGpfpKb4964QnN3Krlf18Ryhgf3PO6IDO04JOdnHLKhR8+kHIN5m6AMIyKxbZ/vKw4X09Z8XoQKBgQD7jNHzEhIo4IOmRzgdoGxSCLXe1c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vxko+mrU+dbSFIVbBjp88NVVcquu+vZT/uwtjriKSwsesAm8DkKT6mTqY5P/JroMzTU7xa3/ErAMte6t2dOsxPS7kqWjJyoLBHRk+AH87X5lNBEjLgYPk1ADU7zFsLdC+nv4fm7nihYre7fCrdCTVKguXmPCEFBjqwSkag7BSIxRQjS3qHxi+DUMst7wIDAQAB"
|
||||
AppCertPath: "etc/merchant/appCertPublicKey_2021005113664540.crt"
|
||||
AlipayCertPath: "etc/merchant/alipayCertPublicKey_RSA2.crt"
|
||||
AlipayRootCertPath: "etc/merchant/alipayRootCert.crt"
|
||||
IsProduction: true
|
||||
NotifyUrl: "https://www.tianyuandb.com/api/v1/pay/alipay/callback"
|
||||
ReturnURL: "https://www.tianyuandb.com/payment/result"
|
||||
Wxpay:
|
||||
AppID: "wxa581992dc74d860e"
|
||||
MchID: "1704330055"
|
||||
MchCertificateSerialNumber: "749065854D0CECCE8F98EAFEA55AD4FB17F868C4"
|
||||
MchApiv3Key: "A9f3G7kL2mP5sQ8tV1xY4zB6nC0dE3hJ"
|
||||
MchPrivateKeyPath: "etc/merchant/apiclient_key.pem"
|
||||
MchPublicKeyID: "PUB_KEY_ID_0117043300552025010900447500000187"
|
||||
MchPublicKeyPath: "etc/merchant/pub_key.pem"
|
||||
NotifyUrl: "https://www.tianyuandb.com/api/v1/pay/wechat/callback"
|
||||
RefundNotifyUrl: "https://www.tianyuandb.com/api/v1/wechat/refund_callback"
|
||||
Ali:
|
||||
Code: "d55b58829efb41c8aa8e86769cba4844"
|
||||
SystemConfig:
|
||||
ThreeVerify: true
|
||||
WechatH5:
|
||||
AppID: "wxa581992dc74d860e"
|
||||
AppSecret: "4de1fbf521712247542d49907fcd5dbf"
|
||||
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
|
||||
Tianyuanapi:
|
||||
AccessID: "2974d99ddf0b91a7"
|
||||
Key: "c701a573200f64d4ab38b0aa03ae56d2"
|
||||
BaseURL: "https://api.tianyuanapi.com"
|
||||
Timeout: 60
|
||||
6
app/main/api/etc/merchant/AuthKey_LAY65829DQ.p8
Normal file
6
app/main/api/etc/merchant/AuthKey_LAY65829DQ.p8
Normal file
@@ -0,0 +1,6 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgkidSHV1OeJN84sDD
|
||||
xWLGIVjTyhn6sAQDyHfqKW6lxnGgCgYIKoZIzj0DAQehRANCAAQSAlAcuuuRNFqk
|
||||
aMPVpXxsiR/pwhyM62tFhdFsbULq1C7MItQxKVMKCiwz3r5rZZy7HcbkqL47LPZ1
|
||||
q6V8Wyop
|
||||
-----END PRIVATE KEY-----
|
||||
43
app/main/api/etc/merchant/alipayCertPublicKey_RSA2.crt
Normal file
43
app/main/api/etc/merchant/alipayCertPublicKey_RSA2.crt
Normal file
@@ -0,0 +1,43 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDtTCCAp2gAwIBAgIQICUDBjgAYvSDOiVZlr/A9zANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE
|
||||
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0
|
||||
aG9yaXR5MTkwNwYDVQQDDDBBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IENs
|
||||
YXNzIDIgUjEwHhcNMjUwMz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
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/alipayRootCert.crt
Normal file
88
app/main/api/etc/merchant/alipayRootCert.crt
Normal file
@@ -0,0 +1,88 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIBszCCAVegAwIBAgIIaeL+wBcKxnswDAYIKoEcz1UBg3UFADAuMQswCQYDVQQG
|
||||
EwJDTjEOMAwGA1UECgwFTlJDQUMxDzANBgNVBAMMBlJPT1RDQTAeF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JKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOPPShpV
|
||||
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-----
|
||||
28
app/main/api/etc/merchant/apiclient_key.pem
Normal file
28
app/main/api/etc/merchant/apiclient_key.pem
Normal file
@@ -0,0 +1,28 @@
|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Ib3DQEBCwUAA4IBAQC5j9d26HpXXf/eC40ejQ8E/r5PwN87129jfdDpCQGVJopL
|
||||
ZyrJzxAHoPW+pG5lbDGmlDC9g8CRgeVcpNNkKDshyDAjlAoKbedTSaI8Bacly6fKPlCwAipepiy3
|
||||
fBTovcQYgPNl4aw3spi/0ZsnoTJ3Ye8n7KD4j3j3iBwptXdWFDVSQCJFSdC5tSMQSnm6WUgW3Duw
|
||||
UalPi2I5CjxCZK35Pbk0GFP5dJwtz4h3YGkLX20TP18HZi0hVrxOErH5U2mP+dlq72DclJEZZZj0
|
||||
PPMyOLUqmcQRWMmaVmGhDKpkcx81jSowFKuPlSQfU0dCXZGdqpnXVnAYlLMuMAILQqE+
|
||||
-----END CERTIFICATE-----
|
||||
9
app/main/api/etc/merchant/pub_key.pem
Normal file
9
app/main/api/etc/merchant/pub_key.pem
Normal file
@@ -0,0 +1,9 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsNH2kztg9gybkuulreL+
|
||||
BMyakxmKTFqrujYLm+S40v64KbNH3+sWdf1XR59vWjSvGWo+BAbuSIHNmIIFMFKE
|
||||
sUxqHAYbta4oD9Ogr0+88drnXv+AA6vxQML0KaaTuHessvUhGC5GEUxa+TFefO9/
|
||||
EjbwL1E/XQ8oBkxHJO6RjKevuts39RjEyocnNhV7m8RP6WIBQeJDXhbfO1etcwdJ
|
||||
B2yQ1eoPK9kGAqQ7wL4pDXrLXMfS1DXlNHsLf4if7rwu3fibk/qfkKdtmqvUw39f
|
||||
tCKZRiexIq6ad9kTTjouXUU5EMRAn3ocRvNzCD4RaW1qVYMxFQ8AraQ8W3MXlPeL
|
||||
EQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
100
app/main/api/internal/config/config.go
Normal file
100
app/main/api/internal/config/config.go
Normal file
@@ -0,0 +1,100 @@
|
||||
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
|
||||
Ali AliConfig
|
||||
Tianyuanapi TianyuanapiConfig
|
||||
SystemConfig SystemConfig
|
||||
WechatH5 WechatH5Config
|
||||
WechatMini WechatMiniConfig
|
||||
Query QueryConfig
|
||||
AdminConfig AdminConfig
|
||||
}
|
||||
|
||||
// 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 SystemConfig struct {
|
||||
ThreeVerify bool
|
||||
}
|
||||
type WechatH5Config struct {
|
||||
AppID string
|
||||
AppSecret string
|
||||
}
|
||||
type WechatMiniConfig struct {
|
||||
AppID string
|
||||
AppSecret string
|
||||
TycAppID string
|
||||
TycAppSecret string
|
||||
}
|
||||
type QueryConfig struct {
|
||||
ShareLinkExpire int64
|
||||
}
|
||||
type AdminConfig struct {
|
||||
AccessSecret string
|
||||
AccessExpire int64
|
||||
RefreshAfter int64
|
||||
}
|
||||
|
||||
type TaxConfig struct {
|
||||
TaxRate float64
|
||||
TaxExemptionAmount float64
|
||||
}
|
||||
type TianyuanapiConfig struct {
|
||||
AccessID string
|
||||
Key string
|
||||
BaseURL string
|
||||
Timeout int64
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_auth"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_feature"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_feature"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_feature"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_feature"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_feature"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_menu"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_menu"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_menu"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_menu"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_menu"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_menu"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_notification"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_notification"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_notification"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_notification"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_notification"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_order"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_order"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_order"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_order"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_order"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-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,30 @@
|
||||
package admin_order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_order"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateOrderHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateOrderReq
|
||||
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.NewAdminUpdateOrderLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateOrder(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_platform_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_platform_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminCreatePlatformUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminCreatePlatformUserReq
|
||||
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_platform_user.NewAdminCreatePlatformUserLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminCreatePlatformUser(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_platform_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_platform_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminDeletePlatformUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminDeletePlatformUserReq
|
||||
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_platform_user.NewAdminDeletePlatformUserLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminDeletePlatformUser(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_platform_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_platform_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetPlatformUserDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetPlatformUserDetailReq
|
||||
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_platform_user.NewAdminGetPlatformUserDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetPlatformUserDetail(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_platform_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_platform_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetPlatformUserListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetPlatformUserListReq
|
||||
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_platform_user.NewAdminGetPlatformUserListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetPlatformUserList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_platform_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_platform_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdatePlatformUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdatePlatformUserReq
|
||||
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_platform_user.NewAdminUpdatePlatformUserLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdatePlatformUser(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminCreateProductHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminCreateProductReq
|
||||
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_product.NewAdminCreateProductLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminCreateProduct(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminDeleteProductHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminDeleteProductReq
|
||||
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_product.NewAdminDeleteProductLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminDeleteProduct(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetProductDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetProductDetailReq
|
||||
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_product.NewAdminGetProductDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetProductDetail(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetProductFeatureListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetProductFeatureListReq
|
||||
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_product.NewAdminGetProductFeatureListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetProductFeatureList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetProductListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetProductListReq
|
||||
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_product.NewAdminGetProductListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetProductList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateProductFeaturesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateProductFeaturesReq
|
||||
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_product.NewAdminUpdateProductFeaturesLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateProductFeatures(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateProductHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateProductReq
|
||||
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_product.NewAdminUpdateProductLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateProduct(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetQueryCleanupConfigListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetQueryCleanupConfigListReq
|
||||
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_query.NewAdminGetQueryCleanupConfigListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetQueryCleanupConfigList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetQueryCleanupDetailListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetQueryCleanupDetailListReq
|
||||
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_query.NewAdminGetQueryCleanupDetailListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetQueryCleanupDetailList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetQueryCleanupLogListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetQueryCleanupLogListReq
|
||||
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_query.NewAdminGetQueryCleanupLogListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetQueryCleanupLogList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetQueryDetailByOrderIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetQueryDetailByOrderIdReq
|
||||
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_query.NewAdminGetQueryDetailByOrderIdLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetQueryDetailByOrderId(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateQueryCleanupConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateQueryCleanupConfigReq
|
||||
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_query.NewAdminUpdateQueryCleanupConfigLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateQueryCleanupConfig(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_role
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_role"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func CreateRoleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.CreateRoleReq
|
||||
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_role.NewCreateRoleLogic(r.Context(), svcCtx)
|
||||
resp, err := l.CreateRole(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_role
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_role"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func DeleteRoleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.DeleteRoleReq
|
||||
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_role.NewDeleteRoleLogic(r.Context(), svcCtx)
|
||||
resp, err := l.DeleteRole(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_role
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_role"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetRoleDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetRoleDetailReq
|
||||
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_role.NewGetRoleDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetRoleDetail(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_role
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_role"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetRoleListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetRoleListReq
|
||||
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_role.NewGetRoleListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetRoleList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_role
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_role"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateRoleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateRoleReq
|
||||
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_role.NewUpdateRoleLogic(r.Context(), svcCtx)
|
||||
resp, err := l.UpdateRole(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminCreateUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminCreateUserReq
|
||||
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_user.NewAdminCreateUserLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminCreateUser(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminDeleteUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminDeleteUserReq
|
||||
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_user.NewAdminDeleteUserLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminDeleteUser(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetUserDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetUserDetailReq
|
||||
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_user.NewAdminGetUserDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetUserDetail(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetUserListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetUserListReq
|
||||
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_user.NewAdminGetUserListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetUserList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUpdateUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateUserReq
|
||||
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_user.NewAdminUpdateUserLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUpdateUser(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package admin_user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/admin_user"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUserInfoReq
|
||||
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_user.NewAdminUserInfoLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminUserInfo(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
17
app/main/api/internal/handler/app/getappversionhandler.go
Normal file
17
app/main/api/internal/handler/app/getappversionhandler.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/app"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/common/result"
|
||||
)
|
||||
|
||||
func GetAppVersionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := app.NewGetAppVersionLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetAppVersion()
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
17
app/main/api/internal/handler/app/healthcheckhandler.go
Normal file
17
app/main/api/internal/handler/app/healthcheckhandler.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/app"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/common/result"
|
||||
)
|
||||
|
||||
func HealthCheckHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := app.NewHealthCheckLogic(r.Context(), svcCtx)
|
||||
resp, err := l.HealthCheck()
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
30
app/main/api/internal/handler/auth/sendsmshandler.go
Normal file
30
app/main/api/internal/handler/auth/sendsmshandler.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/auth"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func SendSmsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.SendSmsReq
|
||||
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 := auth.NewSendSmsLogic(r.Context(), svcCtx)
|
||||
err := l.SendSms(&req)
|
||||
result.HttpResult(r, w, nil, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package notification
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/notification"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/common/result"
|
||||
)
|
||||
|
||||
func GetNotificationsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := notification.NewGetNotificationsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetNotifications()
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
17
app/main/api/internal/handler/pay/alipaycallbackhandler.go
Normal file
17
app/main/api/internal/handler/pay/alipaycallbackhandler.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/pay"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/common/result"
|
||||
)
|
||||
|
||||
func AlipayCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := pay.NewAlipayCallbackLogic(r.Context(), svcCtx)
|
||||
err := l.AlipayCallback(w, r)
|
||||
result.HttpResult(r, w, nil, err)
|
||||
}
|
||||
}
|
||||
30
app/main/api/internal/handler/pay/iapcallbackhandler.go
Normal file
30
app/main/api/internal/handler/pay/iapcallbackhandler.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/pay"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func IapCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.IapCallbackReq
|
||||
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 := pay.NewIapCallbackLogic(r.Context(), svcCtx)
|
||||
err := l.IapCallback(&req)
|
||||
result.HttpResult(r, w, nil, err)
|
||||
}
|
||||
}
|
||||
30
app/main/api/internal/handler/pay/paymentcheckhandler.go
Normal file
30
app/main/api/internal/handler/pay/paymentcheckhandler.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/pay"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func PaymentCheckHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.PaymentCheckReq
|
||||
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 := pay.NewPaymentCheckLogic(r.Context(), svcCtx)
|
||||
resp, err := l.PaymentCheck(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
30
app/main/api/internal/handler/pay/paymenthandler.go
Normal file
30
app/main/api/internal/handler/pay/paymenthandler.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/pay"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func PaymentHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.PaymentReq
|
||||
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 := pay.NewPaymentLogic(r.Context(), svcCtx)
|
||||
resp, err := l.Payment(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/pay"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/common/result"
|
||||
)
|
||||
|
||||
func WechatPayCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := pay.NewWechatPayCallbackLogic(r.Context(), svcCtx)
|
||||
err := l.WechatPayCallback(w, r)
|
||||
result.HttpResult(r, w, nil, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/pay"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/common/result"
|
||||
)
|
||||
|
||||
func WechatPayRefundCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := pay.NewWechatPayRefundCallbackLogic(r.Context(), svcCtx)
|
||||
err := l.WechatPayRefundCallback(w, r)
|
||||
result.HttpResult(r, w, nil, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetProductAppByEnHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetProductByEnRequest
|
||||
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 := product.NewGetProductAppByEnLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetProductAppByEn(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetProductByEnHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetProductByEnRequest
|
||||
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 := product.NewGetProductByEnLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetProductByEn(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package product
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/product"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetProductByIDHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetProductByIDRequest
|
||||
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 := product.NewGetProductByIDLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetProductByID(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryDetailByOrderIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryDetailByOrderIdReq
|
||||
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 := query.NewQueryDetailByOrderIdLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryDetailByOrderId(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryDetailByOrderNoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryDetailByOrderNoReq
|
||||
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 := query.NewQueryDetailByOrderNoLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryDetailByOrderNo(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
30
app/main/api/internal/handler/query/queryexamplehandler.go
Normal file
30
app/main/api/internal/handler/query/queryexamplehandler.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryExampleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryExampleReq
|
||||
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 := query.NewQueryExampleLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryExample(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryGenerateShareLinkHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryGenerateShareLinkReq
|
||||
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 := query.NewQueryGenerateShareLinkLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryGenerateShareLink(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
30
app/main/api/internal/handler/query/querylisthandler.go
Normal file
30
app/main/api/internal/handler/query/querylisthandler.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryListReq
|
||||
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 := query.NewQueryListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryList(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryProvisionalOrderHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryProvisionalOrderReq
|
||||
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 := query.NewQueryProvisionalOrderLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryProvisionalOrder(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
30
app/main/api/internal/handler/query/queryretryhandler.go
Normal file
30
app/main/api/internal/handler/query/queryretryhandler.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryRetryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryRetryReq
|
||||
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 := query.NewQueryRetryLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryRetry(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryServiceAppHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryServiceReq
|
||||
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 := query.NewQueryServiceLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryService(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
25
app/main/api/internal/handler/query/queryservicehandler.go
Normal file
25
app/main/api/internal/handler/query/queryservicehandler.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryServiceReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := query.NewQueryServiceLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryService(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"aedata-server/app/main/api/internal/logic/query"
|
||||
"aedata-server/app/main/api/internal/svc"
|
||||
"aedata-server/app/main/api/internal/types"
|
||||
"aedata-server/common/result"
|
||||
"aedata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func QueryShareDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.QueryShareDetailReq
|
||||
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 := query.NewQueryShareDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.QueryShareDetail(&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