diff --git a/pkg/compute/models/loadbalancers.go b/pkg/compute/models/loadbalancers.go index 68e13b48b9..2116ccb4d2 100644 --- a/pkg/compute/models/loadbalancers.go +++ b/pkg/compute/models/loadbalancers.go @@ -112,7 +112,7 @@ type SLoadbalancer struct { SLoadbalancerClusterResourceBase // 计费类型 - ChargeType string `list:"user" get:"user" create:"optional" update:"user" json:"charge_type"` + SBillingChargeTypeBase // 套餐名称 LoadbalancerSpec string `list:"user" get:"user" list:"user" create:"optional" json:"loadbalancer_spec"` @@ -1138,7 +1138,7 @@ func (region *SCloudregion) newFromCloudLoadbalancer(ctx context.Context, userCr lb.Status = ext.GetStatus() lb.LoadbalancerSpec = ext.GetLoadbalancerSpec() - lb.ChargeType = ext.GetChargeType() + lb.ChargeType = billing_api.ParseNetChargeType(ext.GetChargeType()) lb.EgressMbps = ext.GetEgressMbps() lb.ExternalId = ext.GetGlobalId() lbNetworkIds := getExtLbNetworkIds(ext, lb.ManagerId) @@ -1458,7 +1458,7 @@ func (lb *SLoadbalancer) syncWithCloudLoadbalancer(ctx context.Context, userCred lb.Status = ext.GetStatus() lb.LoadbalancerSpec = ext.GetLoadbalancerSpec() lb.EgressMbps = ext.GetEgressMbps() - lb.ChargeType = ext.GetChargeType() + lb.ChargeType = billing_api.ParseNetChargeType(ext.GetChargeType()) lbNetworkIds := getExtLbNetworkIds(ext, lb.ManagerId) lb.NetworkId = strings.Join(lbNetworkIds, ",") if len(lb.VpcId) == 0 { diff --git a/pkg/compute/regiondrivers/managedvirtual.go b/pkg/compute/regiondrivers/managedvirtual.go index c628434d92..cdf3c04b06 100644 --- a/pkg/compute/regiondrivers/managedvirtual.go +++ b/pkg/compute/regiondrivers/managedvirtual.go @@ -143,7 +143,7 @@ func (self *SManagedVirtualizationRegionDriver) RequestCreateLoadbalancerInstanc Desc: lb.Description, Address: lb.Address, AddressType: lb.AddressType, - ChargeType: lb.ChargeType, + ChargeType: string(lb.ChargeType), EgressMbps: lb.EgressMbps, LoadbalancerSpec: lb.LoadbalancerSpec, }