新增index首页服务
This commit is contained in:
42
apps/index/index.api
Normal file
42
apps/index/index.api
Normal file
@@ -0,0 +1,42 @@
|
||||
syntax = "v1"
|
||||
|
||||
type (
|
||||
GetProductByIdReq {
|
||||
ProductId int64 `path:"productId"`
|
||||
}
|
||||
GetProductByIdResp {
|
||||
ProductItem
|
||||
}
|
||||
GetProductListReq {
|
||||
Page int64 `form:"page"`
|
||||
PageSize int64 `form:"pageSize"`
|
||||
}
|
||||
GetProductListResp {
|
||||
Total int64 `json:"total"`
|
||||
List []ProductItem `json:"list"`
|
||||
}
|
||||
ProductItem {
|
||||
ProductId int64 `json:"productId"`
|
||||
ProductName string `json:"productName"`
|
||||
ProductCode string `json:"productCode"`
|
||||
ProductDescription string `json:"productDescription"`
|
||||
ProductContent string `json:"productContent"`
|
||||
ProductGroup string `json:"productGroup"`
|
||||
ProductPrice float64 `json:"productPrice"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
group: product
|
||||
prefix: /api/index/product
|
||||
)
|
||||
service index-api {
|
||||
@handler getProductById
|
||||
get /:productId (GetProductByIdReq) returns (GetProductByIdResp)
|
||||
|
||||
@handler getProductList
|
||||
get /list (GetProductListReq) returns (GetProductListResp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user