liujiandao
2023-09-20 28240d14942e63d05c06531f04f7f7b5530f04c3
router/router.go
@@ -31,6 +31,16 @@
      organizeAPI.DELETE("department/:id", departmentController.Delete) // 删除部门
   }
   // 公司管理
   companyController := new(controllers.CompanyController)
   companyAPI := r.Group(urlPrefix + "/company")
   {
      companyAPI.GET("company", companyController.List)          // 获取公司列表
      companyAPI.POST("company", companyController.Add)          // 新增公司
      companyAPI.PUT("company/:id", companyController.Update)    // 修改公司
      companyAPI.DELETE("company/:id", companyController.Delete) // 删除公司
   }
   // 仓库管理
   warehouseController := new(controllers.WarehouseController)
   warehouseAPI := r.Group(urlPrefix + "/warehouse")
@@ -41,5 +51,48 @@
      warehouseAPI.DELETE("warehouse/:id", warehouseController.Delete) // 删除仓库
   }
   // 作业类型
   operationTypeController := new(controllers.OperationTypeController)
   operationTypeAPI := r.Group(urlPrefix + "/operationType")
   {
      operationTypeAPI.GET("operationType", operationTypeController.List)          // 获取作业类型列表
      operationTypeAPI.POST("operationType", operationTypeController.Add)          // 新增作业类型
      operationTypeAPI.PUT("operationType/:id", operationTypeController.Update)    // 修改作业类型
      operationTypeAPI.DELETE("operationType/:id", operationTypeController.Delete) // 删除作业类型
   }
   // 入库/出库
   operationController := new(controllers.OperationController)
   operationAPI := r.Group(urlPrefix + "/operation")
   {
      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
}