fix:接口调整

This commit is contained in:
Hiven 2023-08-03 18:27:52 +08:00
parent 2c427662a8
commit 56acf68393
5 changed files with 21 additions and 8 deletions

View File

@ -1,6 +1,7 @@
Name: inventory Name: inventory
Host: 0.0.0.0 Host: 0.0.0.0
Port: 9905 Port: 9905
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth: Auth:
AccessSecret: fusen2023 AccessSecret: fusen2023

View File

@ -18,7 +18,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Handler: TakeHandler(serverCtx), Handler: TakeHandler(serverCtx),
}, },
{ {
Method: http.MethodGet, Method: http.MethodPost,
Path: "/api/inventory/list", Path: "/api/inventory/list",
Handler: GetCloudListHandler(serverCtx), Handler: GetCloudListHandler(serverCtx),
}, },

View File

@ -16,9 +16,9 @@ type TakeForm struct {
} }
type GetCloudListReq struct { type GetCloudListReq struct {
Page int `form:"page"` Page int `json:"page"`
PageSize int `form:"page_size"` PageSize int `json:"page_size"`
Size int64 `form:"size"` Size int64 `json:"size"`
} }
type GetCloudListRsp struct { type GetCloudListRsp struct {

View File

@ -0,0 +1,12 @@
package main
import (
"testing"
)
// var configFile = flag.String("f", "etc/home-user-auth.yaml", "the config file")
func TestMain(t *testing.T) {
// log.Println(model.RawFieldNames[FsCanteenType]())
main()
}

View File

@ -14,7 +14,7 @@ service inventory {
post /api/inventory/take(TakeReq) returns (response); post /api/inventory/take(TakeReq) returns (response);
//获取云仓库存列表 //获取云仓库存列表
@handler GetCloudListHandler @handler GetCloudListHandler
get /api/inventory/list(GetCloudListReq) returns (response); post /api/inventory/list(GetCloudListReq) returns (response);
//云仓补货 //云仓补货
@handler SupplementHandler @handler SupplementHandler
post /api/inventory/supplement(SupplementReq) returns (response); post /api/inventory/supplement(SupplementReq) returns (response);
@ -34,9 +34,9 @@ type TakeForm {
} }
//获取云仓库存列表 //获取云仓库存列表
type GetCloudListReq { type GetCloudListReq {
Page int `form:"page"` Page int `json:"page"`
PageSize int `form:"page_size"` PageSize int `json:"page_size"`
Size int64 `form:"size"` Size int64 `json:"size"`
} }
type GetCloudListRsp { type GetCloudListRsp {
WarehouseBoxes int64 `json:"warehouse_boxes"` WarehouseBoxes int64 `json:"warehouse_boxes"`