From cfb6fbce3687230ccb4704dbc0c87fd411b39af1 Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期三, 20 九月 2023 17:37:22 +0800 Subject: [PATCH] 仓库字段添加与功能修改 --- router/router.go | 36 +++++++++++++++++++++++++++++++----- 1 files changed, 31 insertions(+), 5 deletions(-) diff --git a/router/router.go b/router/router.go index 6da897f..a566a15 100644 --- a/router/router.go +++ b/router/router.go @@ -45,10 +45,11 @@ warehouseController := new(controllers.WarehouseController) warehouseAPI := r.Group(urlPrefix + "/warehouse") { - warehouseAPI.GET("warehouse", warehouseController.List) // 鑾峰彇浠撳簱鍒楄〃 - warehouseAPI.POST("warehouse", warehouseController.Add) // 鏂板浠撳簱 - warehouseAPI.PUT("warehouse/:id", warehouseController.Update) // 淇敼浠撳簱 - warehouseAPI.DELETE("warehouse/:id", warehouseController.Delete) // 鍒犻櫎浠撳簱 + warehouseAPI.GET("warehouse", warehouseController.List) // 鑾峰彇浠撳簱鍒楄〃 + warehouseAPI.POST("warehouse", warehouseController.Add) // 鏂板浠撳簱 + warehouseAPI.POST("updateWarehouse", warehouseController.UpdateWarehouse) // 淇敼浠撳簱 + warehouseAPI.DELETE("warehouse/:id", warehouseController.Delete) // 鍒犻櫎浠撳簱 + warehouseAPI.GET("getWarehouseDetails/:id", warehouseController.GetWarehouseDetails) // 鑾峰彇浠撳簱璇︽儏 } // 浣滀笟绫诲瀷 @@ -65,8 +66,33 @@ operationController := new(controllers.OperationController) operationAPI := r.Group(urlPrefix + "/operation") { - //operationAPI.GET() + operationAPI.GET("operation", operationController.List) operationAPI.POST("operation", operationController.Add) + operationAPI.PUT("operation/:id", operationController.Update) + operationAPI.DELETE("operation/:id", operationController.Delete) + } + + //浜у搧 + productController := new(controllers.ProductController) + productAPI := r.Group(urlPrefix + "/product") + { + productAPI.POST("addProduct", productController.AddProduct) // 鏂板浜у搧 + productAPI.POST("getProductList", productController.GetProductList) // 鑾峰彇浜у搧鍒楄〃 + productAPI.GET("getProductDetails/:id", productController.GetProductDetails) // 鑾峰彇浜у搧璇︽儏 + productAPI.POST("updateProduct", productController.UpdateProduct) // 淇敼浜у搧璇︽儏 + productAPI.DELETE("deleteProduct/:id", productController.DeleteProduct) // 鍒犻櫎浜у搧 + + productAPI.POST("addProductCategory", productController.AddProductCategory) //娣诲姞浜у搧绫诲瀷 + productAPI.POST("getProductCategoryList", productController.GetProductCategoryList) //鑾峰彇浜у搧绫诲瀷鍒楄〃 + productAPI.GET("getProductCategoryDetails/:id", productController.GetProductCategoryDetails) //鑾峰彇浜у搧绫诲瀷璇︽儏 + productAPI.POST("updateProductCategory", productController.UpdateProductCategory) //淇敼浜у搧绫诲瀷 + productAPI.DELETE("deleteProductCategory/:id", productController.DeleteProductCategory) //鍒犻櫎浜у搧绫诲瀷 + } + + locationController := new(controllers.LocationController) + locationAPI := r.Group(urlPrefix + "/location") + { + locationAPI.POST("listByType", locationController.ListLocationByType) } return r -- Gitblit v1.8.0