diff --git a/server/inventory/etc/inventory.yaml b/server/inventory/etc/inventory.yaml index a8195506..3633f1b0 100644 --- a/server/inventory/etc/inventory.yaml +++ b/server/inventory/etc/inventory.yaml @@ -1,6 +1,7 @@ Name: inventory Host: 0.0.0.0 Port: 9905 + SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/inventory/internal/handler/routes.go b/server/inventory/internal/handler/routes.go index 3809a2cb..4368a379 100644 --- a/server/inventory/internal/handler/routes.go +++ b/server/inventory/internal/handler/routes.go @@ -18,7 +18,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Handler: TakeHandler(serverCtx), }, { - Method: http.MethodGet, + Method: http.MethodPost, Path: "/api/inventory/list", Handler: GetCloudListHandler(serverCtx), }, diff --git a/server/inventory/internal/types/types.go b/server/inventory/internal/types/types.go index 480970e8..e31a945f 100644 --- a/server/inventory/internal/types/types.go +++ b/server/inventory/internal/types/types.go @@ -16,9 +16,9 @@ type TakeForm struct { } type GetCloudListReq struct { - Page int `form:"page"` - PageSize int `form:"page_size"` - Size int64 `form:"size"` + Page int `json:"page"` + PageSize int `json:"page_size"` + Size int64 `json:"size"` } type GetCloudListRsp struct { diff --git a/server/inventory/inventory_test.go b/server/inventory/inventory_test.go new file mode 100644 index 00000000..d035c13a --- /dev/null +++ b/server/inventory/inventory_test.go @@ -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() +} diff --git a/server_api/inventory.api b/server_api/inventory.api index 33ddd65f..0700842f 100644 --- a/server_api/inventory.api +++ b/server_api/inventory.api @@ -14,7 +14,7 @@ service inventory { post /api/inventory/take(TakeReq) returns (response); //获取云仓库存列表 @handler GetCloudListHandler - get /api/inventory/list(GetCloudListReq) returns (response); + post /api/inventory/list(GetCloudListReq) returns (response); //云仓补货 @handler SupplementHandler post /api/inventory/supplement(SupplementReq) returns (response); @@ -34,9 +34,9 @@ type TakeForm { } //获取云仓库存列表 type GetCloudListReq { - Page int `form:"page"` - PageSize int `form:"page_size"` - Size int64 `form:"size"` + Page int `json:"page"` + PageSize int `json:"page_size"` + Size int64 `json:"size"` } type GetCloudListRsp { WarehouseBoxes int64 `json:"warehouse_boxes"`