| 
														
															@@ -25,7 +25,7 @@ type RuleChainService interface { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Update(*models.RuleChainParams) error 
														 | 
														
														 | 
														
															 	Update(*models.RuleChainParams) error 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Query(int, int, string) ([]models.RuleChain, int, error) 
														 | 
														
														 | 
														
															 	Query(int, int, string) ([]models.RuleChain, int, error) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	Get(vendorId, recordId string) (models.RuleChain, error) 
														 | 
														
														 | 
														
															 	Get(vendorId, recordId string) (models.RuleChain, error) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	UpdateChainRoot(*models.RuleChain) error 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	UpdateChainRoot(*models.ChangeRootParams) error 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 type ruleChainService struct { 
														 | 
														
														 | 
														
															 type ruleChainService struct { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	model *model.All 
														 | 
														
														 | 
														
															 	model *model.All 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -232,12 +232,12 @@ func (a ruleChainService) Update(params *models.RuleChainParams) error { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	return nil 
														 | 
														
														 | 
														
															 	return nil 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-func (a ruleChainService) UpdateChainRoot(ruleChain *models.RuleChain) error { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+func (a ruleChainService) UpdateChainRoot(params *models.ChangeRootParams) error { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	var isRoot int = 0 
														 | 
														
														 | 
														
															 	var isRoot int = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	if ruleChain.Root { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	if params.Root { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		isRoot = 1 
														 | 
														
														 | 
														
															 		isRoot = 1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} 
														 | 
														
														 | 
														
															 	} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	_, err := a.model.RuleChain.UpdateChainRoot(ruleChain.VendorID, ruleChain.RecordId, isRoot) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	_, err := a.model.RuleChain.UpdateChainRoot(params.VendorId, params.RecordId, isRoot) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	if err != nil { 
														 | 
														
														 | 
														
															 	if err != nil { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		return err 
														 | 
														
														 | 
														
															 		return err 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} 
														 | 
														
														 | 
														
															 	} 
														 |