fix platform workflow integrity and permissions
This commit is contained in:
@@ -82,6 +82,9 @@ func registerGasorderRoute(group *gin.RouterGroup) {
|
||||
order.POST("/:identity/assign", gasorder.AssignGasorderBasic)
|
||||
order.POST("/:identity/filling", gasorder.GasorderStartFilling)
|
||||
order.POST("/:identity/ready", gasorder.GasorderReady)
|
||||
order.POST("/:identity/delivering", gasorder.GasorderStartDelivering)
|
||||
order.POST("/:identity/awaiting-confirmation", gasorder.GasorderAwaitingConfirmation)
|
||||
order.POST("/:identity/complete", gasorder.GasorderComplete)
|
||||
order.POST("/:identity/exception", gasorder.GasorderException)
|
||||
order.POST("/:identity/recover", gasorder.GasorderRecover)
|
||||
order.POST("/:identity/cancel", gasorder.GasorderCancel)
|
||||
@@ -119,16 +122,9 @@ func registerProductRoute(group *gin.RouterGroup) {
|
||||
)
|
||||
registerNoDeleteResource(group, "/product_repair", repairList, repairCreate, repairGet, repairUpdate, &models.ProductRepair{})
|
||||
|
||||
ownerList, ownerCreate, ownerGet := product.ProductOwnerHandlers(
|
||||
requiredRelation("product_info_identity", "product_info_id", &models.ProductInfo{}),
|
||||
optionalRelation("warehouse_identity", "warehouse_id", &models.ProductWarehouse{}),
|
||||
optionalRelation("gas_basic_identity", "gas_basic_id", &models.GasBasic{}),
|
||||
optionalRelation("delivery_basic_identity", "delivery_basic_id", &models.DeliveryBasic{}),
|
||||
optionalRelation("user_account_identity", "user_account_id", &models.UserAccount{}),
|
||||
)
|
||||
ownerList, ownerGet := product.ProductOwnerHandlers()
|
||||
owner := group.Group("/product_owner")
|
||||
owner.GET("", ownerList)
|
||||
owner.POST("", ownerCreate)
|
||||
owner.GET("/:identity", ownerGet)
|
||||
}
|
||||
|
||||
@@ -164,9 +160,7 @@ func registerWalletRoute(group *gin.RouterGroup) {
|
||||
}
|
||||
|
||||
func registerCommerceRoute(group *gin.RouterGroup) {
|
||||
categoryRelations := []common.ResourceRelation{optionalRelation("parent_identity", "parent_id", &models.EcCategory{})}
|
||||
_, categoryCreate, _, categoryUpdate := common.ResourceHandlers(&models.EcCategory{}, []string{"name", "sort_no"}, []string{"name", "sort_no"}, categoryRelations...)
|
||||
registerWritableResource(group, "/ec_category", ec.ListEcCategory, categoryCreate, ec.GetEcCategory, categoryUpdate, &models.EcCategory{})
|
||||
registerWritableResource(group, "/ec_category", ec.ListEcCategory, ec.CreateEcCategory, ec.GetEcCategory, ec.UpdateEcCategory, &models.EcCategory{})
|
||||
registerRestrictedWritableResource(group, "/ec_product", &models.EcProduct{}, []string{"product_code", "name", "price_amount", "stock_quantity"}, requiredRelation("ec_category_identity", "ec_category_id", &models.EcCategory{}))
|
||||
registerRestrictedWritableResource(group, "/ec_product_attribute", &models.EcProductAttribute{}, []string{"name", "value", "sort_no"}, requiredRelation("ec_product_identity", "ec_product_id", &models.EcProduct{}))
|
||||
registerRestrictedWritableResource(group, "/ec_product_image", &models.EcProductImage{}, []string{"image_uri", "sort_no", "is_cover"}, requiredRelation("ec_product_identity", "ec_product_id", &models.EcProduct{}))
|
||||
|
||||
Reference in New Issue
Block a user