order

package
v0.0.0-...-7aae7b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 9 Imported by: 0

README

订单管理

统一订单分类

各厂商分类

阿里云: 订单API文档

  • New:新购。
  • Renew:续费。
  • Upgrade:升级。
  • Refund:退款。

腾讯云: 订单对象数据结构

  • modifyNetworkMode 调整带宽模式
  • modifyNetworkSize 调整带宽大小
  • refund 退款
  • downgrade 降配
  • upgrade 升配
  • renew 续费
  • purchase 购买
  • preMoveOut 包年包月迁出资源
  • preMoveIn 包年包月迁入资源
  • preToPost 预付费转后付费
  • postMoveOut 按量计费迁出资源
  • postMoveIn 按量计费迁入资源

华为云: 订单对象order_info

  • 1:开通
  • 2:续订
  • 3:变更
  • 4:退订
  • 11:按需转包年/包月
  • 13:试用
  • 14:转商用
  • 15:费用调整
统一分类
  • purchase 购买
  • renew 续费
  • upgrade 升配
  • downgrade 降配
  • refund 退款
  • modify 费用调整

统一订单状态

各厂商状态

阿里云: 订单API文档

  • Unpaid:未支付。
  • Paid:已支付。
  • Cancelled:已作废。

腾讯云: 腾讯云API文档

  • 1:未支付
  • 2:已支付
  • 3:发货中
  • 4:已发货
  • 5:发货失败
  • 6:已退款
  • 7:已关单
  • 8:订单过期
  • 9:订单已失效
  • 10:产品已失效
  • 11:代付拒绝
  • 12:支付中

华为云: API文档

  • 1:待审核
  • 3:处理中
  • 4:已取消
  • 5:已完成
  • 6:待支付
  • 9:待确认
统一状态
  • 1:未支付
  • 8:订单过期
  • 2:支付中
  • 4: 已取消
  • 5:已支付
  • 6:已退款
  • 7:已关单

资源续费订单

// RegionId实例所属的地域ID // ResourceId查询续费价格的资源ID // Period指定续费时长 // PriceUnit指定续费周期 // ExpectedRenewDay统一到期日

// InstanceIds // Period 购买实例的时长,单位:月。取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36, 48, 60。 / RenewFlag 自动续费标识。取值范围:

  • NOTIFY_AND_AUTO_RENEW:通知过期且自动续费
  • NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费
  • DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费

    默认取值:NOTIFY_AND_MANUAL_RENEW。若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。

  • Documentation

    Index

    Constants

    View Source
    const (
    	AppName = "order"
    )

    Variables

    View Source
    var (
    	ORDER_TYPE_name = map[int32]string{
    		0: "NEW",
    		1: "RENEW",
    		2: "UPGRADE",
    		3: "DOWNGRADE",
    		4: "REFUND",
    		5: "CONVERT",
    		6: "MODIFY",
    	}
    	ORDER_TYPE_value = map[string]int32{
    		"NEW":       0,
    		"RENEW":     1,
    		"UPGRADE":   2,
    		"DOWNGRADE": 3,
    		"REFUND":    4,
    		"CONVERT":   5,
    		"MODIFY":    6,
    	}
    )

    Enum value maps for ORDER_TYPE.

    View Source
    var (
    	ORDER_STATUS_name = map[int32]string{
    		0: "UNPAID",
    		1: "EXPIRED",
    		2: "PAYING",
    		3: "CANCELLED",
    		4: "PAID",
    	}
    	ORDER_STATUS_value = map[string]int32{
    		"UNPAID":    0,
    		"EXPIRED":   1,
    		"PAYING":    2,
    		"CANCELLED": 3,
    		"PAID":      4,
    	}
    )

    Enum value maps for ORDER_STATUS.

    View Source
    var File_apps_order_pb_order_proto protoreflect.FileDescriptor

    Functions

    This section is empty.

    Types

    type Cost

    type Cost struct {
    
    	// 官网价,原价(分)
    	// @gotags: json:"sale_price"
    	SalePrice float64 `protobuf:"fixed64,1,opt,name=sale_price,json=salePrice,proto3" json:"sale_price"`
    	// 折扣率
    	// @gotags: json:"policy"
    	Policy float64 `protobuf:"fixed64,2,opt,name=policy,proto3" json:"policy"`
    	// 单价(分)
    	// @gotags: json:"unit_price"
    	UnitPrice float64 `protobuf:"fixed64,3,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price"`
    	// 购买时长
    	// @gotags: json:"time_span"
    	TimeSpan float64 `protobuf:"fixed64,4,opt,name=time_span,json=timeSpan,proto3" json:"time_span"`
    	// 购买时长
    	// @gotags: json:"time_unit"
    	TimeUnit string `protobuf:"bytes,5,opt,name=time_unit,json=timeUnit,proto3" json:"time_unit"`
    	// 实际支付金额(分)
    	// @gotags: json:"real_cost"
    	RealCost float64 `protobuf:"fixed64,6,opt,name=real_cost,json=realCost,proto3" json:"real_cost"`
    	// 代金券抵扣金额(分)
    	// @gotags: json:"voucher_pay"
    	VoucherPay float64 `protobuf:"fixed64,7,opt,name=voucher_pay,json=voucherPay,proto3" json:"voucher_pay"`
    	// contains filtered or unexported fields
    }

    func (*Cost) Descriptor deprecated

    func (*Cost) Descriptor() ([]byte, []int)

    Deprecated: Use Cost.ProtoReflect.Descriptor instead.

    func (*Cost) GetPolicy

    func (x *Cost) GetPolicy() float64

    func (*Cost) GetRealCost

    func (x *Cost) GetRealCost() float64

    func (*Cost) GetSalePrice

    func (x *Cost) GetSalePrice() float64

    func (*Cost) GetTimeSpan

    func (x *Cost) GetTimeSpan() float64

    func (*Cost) GetTimeUnit

    func (x *Cost) GetTimeUnit() string

    func (*Cost) GetUnitPrice

    func (x *Cost) GetUnitPrice() float64

    func (*Cost) GetVoucherPay

    func (x *Cost) GetVoucherPay() float64

    func (*Cost) ProtoMessage

    func (*Cost) ProtoMessage()

    func (*Cost) ProtoReflect

    func (x *Cost) ProtoReflect() protoreflect.Message

    func (*Cost) Reset

    func (x *Cost) Reset()

    func (*Cost) String

    func (x *Cost) String() string

    type ORDER_STATUS

    type ORDER_STATUS int32
    const (
    	// 未支付
    	ORDER_STATUS_UNPAID ORDER_STATUS = 0
    	// 订单过期
    	ORDER_STATUS_EXPIRED ORDER_STATUS = 1
    	// 支付中
    	ORDER_STATUS_PAYING ORDER_STATUS = 2
    	// 已取消
    	ORDER_STATUS_CANCELLED ORDER_STATUS = 3
    	// 已支付
    	ORDER_STATUS_PAID ORDER_STATUS = 4
    )

    func ParseORDER_STATUSFromString

    func ParseORDER_STATUSFromString(str string) (ORDER_STATUS, error)

    ParseORDER_STATUSFromString Parse ORDER_STATUS from string

    func (ORDER_STATUS) Descriptor

    func (ORDER_STATUS) Enum

    func (x ORDER_STATUS) Enum() *ORDER_STATUS

    func (ORDER_STATUS) EnumDescriptor deprecated

    func (ORDER_STATUS) EnumDescriptor() ([]byte, []int)

    Deprecated: Use ORDER_STATUS.Descriptor instead.

    func (ORDER_STATUS) Equal

    func (t ORDER_STATUS) Equal(target ORDER_STATUS) bool

    Equal type compare

    func (ORDER_STATUS) IsIn

    func (t ORDER_STATUS) IsIn(targets ...ORDER_STATUS) bool

    IsIn todo

    func (ORDER_STATUS) MarshalJSON

    func (t ORDER_STATUS) MarshalJSON() ([]byte, error)

    MarshalJSON todo

    func (ORDER_STATUS) Number

    func (ORDER_STATUS) String

    func (x ORDER_STATUS) String() string

    func (ORDER_STATUS) Type

    func (*ORDER_STATUS) UnmarshalJSON

    func (t *ORDER_STATUS) UnmarshalJSON(b []byte) error

    UnmarshalJSON todo

    type ORDER_TYPE

    type ORDER_TYPE int32
    const (
    	// 资源新增订单
    	ORDER_TYPE_NEW ORDER_TYPE = 0
    	// 续费。
    	ORDER_TYPE_RENEW ORDER_TYPE = 1
    	// 升级。
    	ORDER_TYPE_UPGRADE ORDER_TYPE = 2
    	// 降配
    	ORDER_TYPE_DOWNGRADE ORDER_TYPE = 3
    	// 退款
    	ORDER_TYPE_REFUND ORDER_TYPE = 4
    	// 付费方式转换
    	ORDER_TYPE_CONVERT ORDER_TYPE = 5
    	// 配置调整
    	ORDER_TYPE_MODIFY ORDER_TYPE = 6
    )

    func ParseORDER_TYPEFromString

    func ParseORDER_TYPEFromString(str string) (ORDER_TYPE, error)

    ParseORDER_TYPEFromString Parse ORDER_TYPE from string

    func (ORDER_TYPE) Descriptor

    func (ORDER_TYPE) Descriptor() protoreflect.EnumDescriptor

    func (ORDER_TYPE) Enum

    func (x ORDER_TYPE) Enum() *ORDER_TYPE

    func (ORDER_TYPE) EnumDescriptor deprecated

    func (ORDER_TYPE) EnumDescriptor() ([]byte, []int)

    Deprecated: Use ORDER_TYPE.Descriptor instead.

    func (ORDER_TYPE) Equal

    func (t ORDER_TYPE) Equal(target ORDER_TYPE) bool

    Equal type compare

    func (ORDER_TYPE) IsIn

    func (t ORDER_TYPE) IsIn(targets ...ORDER_TYPE) bool

    IsIn todo

    func (ORDER_TYPE) MarshalJSON

    func (t ORDER_TYPE) MarshalJSON() ([]byte, error)

    MarshalJSON todo

    func (ORDER_TYPE) Number

    func (x ORDER_TYPE) Number() protoreflect.EnumNumber

    func (ORDER_TYPE) String

    func (x ORDER_TYPE) String() string

    func (ORDER_TYPE) Type

    func (*ORDER_TYPE) UnmarshalJSON

    func (t *ORDER_TYPE) UnmarshalJSON(b []byte) error

    UnmarshalJSON todo

    type Order

    type Order struct {
    
    	// 本次账单同步关联的任务Id
    	// @gotags: json:"task_id"
    	TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id"`
    	// 厂商
    	// @gotags: json:"vendor"
    	Vendor resource.VENDOR `protobuf:"varint,2,opt,name=vendor,proto3,enum=infraboard.cmdb.resource.VENDOR" json:"vendor"`
    	// 大订单号
    	// @gotags: json:"big_order_id"
    	BigOrderId string `protobuf:"bytes,3,opt,name=big_order_id,json=bigOrderId,proto3" json:"big_order_id"`
    	// 订单Id
    	// @gotags: json:"id"
    	Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id"`
    	// 订单类型
    	// @gotags: json:"order_type"
    	OrderType string `protobuf:"bytes,5,opt,name=order_type,json=orderType,proto3" json:"order_type"`
    	// 订单状态
    	// @gotags: json:"status"
    	Status string `protobuf:"bytes,6,opt,name=status,proto3" json:"status"`
    	// 支付者
    	// @gotags: json:"payer"
    	Payer string `protobuf:"bytes,7,opt,name=payer,proto3" json:"payer"`
    	// 创建时间
    	// @gotags: json:"create_at"
    	CreateAt int64 `protobuf:"varint,8,opt,name=create_at,json=createAt,proto3" json:"create_at"`
    	// 支付时间
    	// @gotags: json:"pay_at"
    	PayAt int64 `protobuf:"varint,9,opt,name=pay_at,json=payAt,proto3" json:"pay_at"`
    	// 创建人
    	// @gotags: json:"create_by"
    	CreateBy string `protobuf:"bytes,10,opt,name=create_by,json=createBy,proto3" json:"create_by"`
    	// 计费方式,比如:月95,日均峰值
    	// @gotags: json:"pay_mode"
    	PayMode resource.PAY_MODE `protobuf:"varint,11,opt,name=pay_mode,json=payMode,proto3,enum=infraboard.cmdb.resource.PAY_MODE" json:"pay_mode"`
    	// 定义费用
    	// @gotags: json:"cost"
    	Cost *Cost `protobuf:"bytes,12,opt,name=cost,proto3" json:"cost"`
    	// 产品编码
    	// @gotags: json:"product_code"
    	ProductCode string `protobuf:"bytes,13,opt,name=product_code,json=productCode,proto3" json:"product_code"`
    	// 产品编码中文名称
    	// @gotags: json:"product_name"
    	ProductName string `protobuf:"bytes,14,opt,name=product_name,json=productName,proto3" json:"product_name"`
    	// 子产品编码
    	// @gotags: json:"sub_product_code"
    	SubProductCode string `protobuf:"bytes,15,opt,name=sub_product_code,json=subProductCode,proto3" json:"sub_product_code"`
    	// 子产品编码中文名称
    	// @gotags: json:"sub_product_name"
    	SubProductName string `protobuf:"bytes,16,opt,name=sub_product_name,json=subProductName,proto3" json:"sub_product_name"`
    	// 购买产品详情
    	// @gotags: json:"product_info"
    	ProductInfo string `protobuf:"bytes,17,opt,name=product_info,json=productInfo,proto3" json:"product_info"`
    	// 订单对应的资源id
    	// @gotags: json:"resource_id"
    	ResourceId []string `protobuf:"bytes,18,rep,name=resource_id,json=resourceId,proto3" json:"resource_id"`
    	// contains filtered or unexported fields
    }

    func NewDefaultOrder

    func NewDefaultOrder() *Order

    func (*Order) Descriptor deprecated

    func (*Order) Descriptor() ([]byte, []int)

    Deprecated: Use Order.ProtoReflect.Descriptor instead.

    func (*Order) GetBigOrderId

    func (x *Order) GetBigOrderId() string

    func (*Order) GetCost

    func (x *Order) GetCost() *Cost

    func (*Order) GetCreateAt

    func (x *Order) GetCreateAt() int64

    func (*Order) GetCreateBy

    func (x *Order) GetCreateBy() string

    func (*Order) GetId

    func (x *Order) GetId() string

    func (*Order) GetOrderType

    func (x *Order) GetOrderType() string

    func (*Order) GetPayAt

    func (x *Order) GetPayAt() int64

    func (*Order) GetPayMode

    func (x *Order) GetPayMode() resource.PAY_MODE

    func (*Order) GetPayer

    func (x *Order) GetPayer() string

    func (*Order) GetProductCode

    func (x *Order) GetProductCode() string

    func (*Order) GetProductInfo

    func (x *Order) GetProductInfo() string

    func (*Order) GetProductName

    func (x *Order) GetProductName() string

    func (*Order) GetResourceId

    func (x *Order) GetResourceId() []string

    func (*Order) GetStatus

    func (x *Order) GetStatus() string

    func (*Order) GetSubProductCode

    func (x *Order) GetSubProductCode() string

    func (*Order) GetSubProductName

    func (x *Order) GetSubProductName() string

    func (*Order) GetTaskId

    func (x *Order) GetTaskId() string

    func (*Order) GetVendor

    func (x *Order) GetVendor() resource.VENDOR

    func (*Order) ProtoMessage

    func (*Order) ProtoMessage()

    func (*Order) ProtoReflect

    func (x *Order) ProtoReflect() protoreflect.Message

    func (*Order) Reset

    func (x *Order) Reset()

    func (*Order) String

    func (x *Order) String() string

    func (*Order) ToJsonString

    func (o *Order) ToJsonString() string

    type OrderSet

    type OrderSet struct {
    
    	// 总数量
    	// @gotags: json:"total"
    	Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
    	// 列表项
    	// @gotags: json:"items"
    	Items []*Order `protobuf:"bytes,2,rep,name=items,proto3" json:"items"`
    	// contains filtered or unexported fields
    }

    func NewOrderSet

    func NewOrderSet() *OrderSet

    func (*OrderSet) Add

    func (s *OrderSet) Add(items ...any)

    func (*OrderSet) Descriptor deprecated

    func (*OrderSet) Descriptor() ([]byte, []int)

    Deprecated: Use OrderSet.ProtoReflect.Descriptor instead.

    func (*OrderSet) GetItems

    func (x *OrderSet) GetItems() []*Order

    func (*OrderSet) GetOrderById

    func (s *OrderSet) GetOrderById(orderId string) *Order

    func (*OrderSet) GetTotal

    func (x *OrderSet) GetTotal() int64

    func (*OrderSet) Length

    func (s *OrderSet) Length() int64

    func (*OrderSet) ProtoMessage

    func (*OrderSet) ProtoMessage()

    func (*OrderSet) ProtoReflect

    func (x *OrderSet) ProtoReflect() protoreflect.Message

    func (*OrderSet) Reset

    func (x *OrderSet) Reset()

    func (*OrderSet) String

    func (x *OrderSet) String() string

    func (*OrderSet) ToAny

    func (s *OrderSet) ToAny() (items []any)

    Directories

    Path Synopsis

    Jump to

    Keyboard shortcuts

    ? : This menu
    / : Search site
    f or F : Jump to
    y or Y : Canonical URL