mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #12347 from tb365/bugfix/tb-bugfix-093001
ctyun api updates
This commit is contained in:
@@ -53,8 +53,8 @@ type SInstance struct {
|
||||
Flavor FlavorObj `json:"flavor"`
|
||||
Addresses map[string][]Address `json:"addresses"`
|
||||
UserID string `json:"user_id"`
|
||||
Created int64 `json:"created"`
|
||||
DueDate int64 `json:"dueDate"`
|
||||
Created time.Time `json:"created"`
|
||||
DueDate *time.Time `json:"dueDate"`
|
||||
SecurityGroups []SecurityGroup `json:"security_groups"`
|
||||
OSEXTAZAvailabilityZone string `json:"OS-EXT-AZ:availability_zone"`
|
||||
OSExtendedVolumesVolumesAttached []Volume `json:"os-extended-volumes:volumes_attached"`
|
||||
@@ -106,7 +106,7 @@ type PublicP struct {
|
||||
}
|
||||
|
||||
func (self *SInstance) GetBillingType() string {
|
||||
if self.DueDate > 0 {
|
||||
if self.DueDate != nil {
|
||||
return billing_api.BILLING_TYPE_PREPAID
|
||||
} else {
|
||||
return billing_api.BILLING_TYPE_POSTPAID
|
||||
@@ -114,15 +114,15 @@ func (self *SInstance) GetBillingType() string {
|
||||
}
|
||||
|
||||
func (self *SInstance) GetCreatedAt() time.Time {
|
||||
return time.Unix(self.Created/1000, 0)
|
||||
return self.Created
|
||||
}
|
||||
|
||||
func (self *SInstance) GetExpiredAt() time.Time {
|
||||
if self.DueDate == 0 {
|
||||
if self.DueDate == nil {
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
return time.Unix(self.DueDate/1000, 0)
|
||||
return *self.DueDate
|
||||
}
|
||||
|
||||
func (self *SInstance) GetId() string {
|
||||
|
||||
Reference in New Issue
Block a user