feat(all): v1.0
This commit is contained in:
@@ -10,7 +10,7 @@ info (
|
||||
type (
|
||||
sendSmsReq {
|
||||
Mobile string `json:"mobile" validate:"required,mobile"`
|
||||
ActionType string `json:"actionType" validate:"required,oneof=loginCode registerCode QueryCode"`
|
||||
ActionType string `json:"actionType" validate:"required,oneof=login register query"`
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
14
app/user/cmd/api/desc/main.api
Normal file
14
app/user/cmd/api/desc/main.api
Normal file
@@ -0,0 +1,14 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "单体服务中心"
|
||||
desc: "单体服务中心"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
import "user.api"
|
||||
import "query.api"
|
||||
import "pay.api"
|
||||
import "product.api"
|
||||
28
app/user/cmd/api/desc/pay.api
Normal file
28
app/user/cmd/api/desc/pay.api
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
}
|
||||
|
||||
25
app/user/cmd/api/desc/product.api
Normal file
25
app/user/cmd/api/desc/product.api
Normal file
@@ -0,0 +1,25 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品服务"
|
||||
desc: "产品服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
import (
|
||||
"product/product.api"
|
||||
)
|
||||
@server (
|
||||
prefix: api/v1/product
|
||||
group: product
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@handler GetProductByID
|
||||
get /:id (GetProductByIDRequest) returns (ProductResponse)
|
||||
|
||||
@handler GetProductByEn
|
||||
get /en/:product_en (GetProductByEnRequest) returns (ProductResponse)
|
||||
}
|
||||
|
||||
36
app/user/cmd/api/desc/product/product.api
Normal file
36
app/user/cmd/api/desc/product/product.api
Normal file
@@ -0,0 +1,36 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品查询服务"
|
||||
desc: "产品查询服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
)
|
||||
|
||||
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"` // 关联功能列表
|
||||
}
|
||||
|
||||
type Feature {
|
||||
ID int64 `json:"id"` // 功能ID
|
||||
ApiID string `json:"api_id"` // API标识
|
||||
Name string `json:"name"` // 功能描述
|
||||
}
|
||||
|
||||
type GetProductByIDRequest {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
type GetProductByEnRequest {
|
||||
ProductEn string `path:"product_en"`
|
||||
}
|
||||
|
||||
type ProductResponse {
|
||||
Product
|
||||
}
|
||||
|
||||
84
app/user/cmd/api/desc/query.api
Normal file
84
app/user/cmd/api/desc/query.api
Normal file
@@ -0,0 +1,84 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品查询服务"
|
||||
desc: "产品查询服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
import (
|
||||
"query/query.api"
|
||||
)
|
||||
|
||||
//============================> query v1 <============================
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: query
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@doc "query marriage"
|
||||
@handler marriage
|
||||
post /query/marriage (QueryReq) returns (QueryResp)
|
||||
|
||||
// 家政服务查询
|
||||
@doc "query home service"
|
||||
@handler homeService
|
||||
post /query/homeService (QueryReq) returns (QueryResp)
|
||||
|
||||
// 风险评估查询
|
||||
@doc "query risk assessment"
|
||||
@handler riskAssessment
|
||||
post /query/riskAssessment (QueryReq) returns (QueryResp)
|
||||
|
||||
// 企业信息查询
|
||||
@doc "query company info"
|
||||
@handler companyInfo
|
||||
post /query/companyInfo (QueryReq) returns (QueryResp)
|
||||
|
||||
// 租赁信息查询
|
||||
@doc "query rental info"
|
||||
@handler rentalInfo
|
||||
post /query/rentalInfo (QueryReq) returns (QueryResp)
|
||||
|
||||
// 贷前背景调查
|
||||
@doc "query pre-loan background check"
|
||||
@handler preLoanBackgroundCheck
|
||||
post /query/preLoanBackgroundCheck (QueryReq) returns (QueryResp)
|
||||
|
||||
// 一般背景调查
|
||||
@doc "query general background check"
|
||||
@handler backgroundCheck
|
||||
post /query/backgroundCheck (QueryReq) returns (QueryResp)
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1
|
||||
group: query
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@doc "查询示例"
|
||||
@handler queryExample
|
||||
get /query/example (QueryExampleReq) returns (QueryExampleResp)
|
||||
|
||||
@doc "查询列表"
|
||||
@handler queryList
|
||||
get /query/list (QueryListReq) returns (QueryListResp)
|
||||
|
||||
@doc "查询详情 按订单号 付款查询时"
|
||||
@handler queryDetailByOrderId
|
||||
get /query/orderId/:order_id (QueryDetailByOrderIdReq) returns (QueryDetailByOrderIdResp)
|
||||
|
||||
@doc "查询详情"
|
||||
@handler queryDetail
|
||||
get /query/:id (QueryDetailReq) returns (QueryDetailResp)
|
||||
|
||||
@doc "重试查询"
|
||||
@handler queryRetry
|
||||
post /query/retry/:id (QueryRetryReq) returns (QueryRetryResp)
|
||||
|
||||
|
||||
}
|
||||
75
app/user/cmd/api/desc/query/query.api
Normal file
75
app/user/cmd/api/desc/query/query.api
Normal file
@@ -0,0 +1,75 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品查询服务"
|
||||
desc: "产品查询服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
)
|
||||
|
||||
type (
|
||||
QueryReq {
|
||||
Data string `json:"data" validate:"required"`
|
||||
}
|
||||
QueryResp {
|
||||
prepayID string `json:"prepay_id"`
|
||||
OrderID int64 `json:"order_id"`
|
||||
}
|
||||
)
|
||||
|
||||
type Query {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
OrderId int64 `json:"order_id"` // 订单ID
|
||||
UserId int64 `json:"user_id"` // 用户ID
|
||||
ProductId int64 `json:"product_id"` // 产品ID
|
||||
QueryData []map[string]interface{} `json:"query_data"`
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
QueryState string `json:"query_state"` // 查询状态
|
||||
}
|
||||
|
||||
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 (
|
||||
QueryDetailReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
QueryDetailResp {
|
||||
Query
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryDetailByOrderIdReq {
|
||||
OrderId int64 `path:"order_id"`
|
||||
}
|
||||
QueryDetailByOrderIdResp {
|
||||
Query
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
QueryRetryReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
QueryRetryResp {}
|
||||
)
|
||||
|
||||
@@ -16,10 +16,10 @@ import (
|
||||
//============================> user v1 <============================
|
||||
//no need login
|
||||
@server (
|
||||
prefix: user/v1
|
||||
prefix: api/v1
|
||||
group: user
|
||||
)
|
||||
service user {
|
||||
service main {
|
||||
@doc "register"
|
||||
@handler register
|
||||
post /user/register (RegisterReq) returns (RegisterResp)
|
||||
@@ -35,14 +35,14 @@ service user {
|
||||
|
||||
//need login
|
||||
@server (
|
||||
prefix: user/v1
|
||||
prefix: api/v1
|
||||
group: user
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service user {
|
||||
service main {
|
||||
@doc "get user info"
|
||||
@handler detail
|
||||
post /user/detail (UserInfoReq) returns (UserInfoResp)
|
||||
get /user/detail returns (UserInfoResp)
|
||||
|
||||
@doc "wechat mini auth"
|
||||
@handler wxMiniAuth
|
||||
@@ -51,10 +51,10 @@ service user {
|
||||
|
||||
//============================> auth v1 <============================
|
||||
@server (
|
||||
prefix: auth/v1
|
||||
prefix: api/v1
|
||||
group: auth
|
||||
)
|
||||
service user {
|
||||
service main {
|
||||
@doc "get mobile verify code"
|
||||
@handler sendSms
|
||||
post /auth/sendSms (sendSmsReq)
|
||||
|
||||
@@ -64,7 +64,6 @@ type (
|
||||
)
|
||||
|
||||
type (
|
||||
UserInfoReq {}
|
||||
UserInfoResp {
|
||||
UserInfo User `json:"userInfo"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user