新增index首页服务

This commit is contained in:
2024-10-02 22:10:58 +08:00
parent 30f3ec55c2
commit 9fd6f70630
12 changed files with 357 additions and 0 deletions

42
apps/index/index.api Normal file
View 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)
}