github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/models/instance.go (about)

     1  package models
     2  
     3  import (
     4  	"github.com/machinefi/w3bstream/pkg/depends/base/types"
     5  	"github.com/machinefi/w3bstream/pkg/depends/kit/sqlx/datatypes"
     6  	"github.com/machinefi/w3bstream/pkg/enums"
     7  )
     8  
     9  // Instance database model instance
    10  // @def primary                     ID
    11  // @def unique_index UI_instance_id InstanceID
    12  // @def unique_index UI_applet_id   AppletID
    13  //
    14  //go:generate toolkit gen model Instance --database DB
    15  type Instance struct {
    16  	datatypes.PrimaryID
    17  	RelInstance
    18  	RelApplet
    19  	InstanceInfo
    20  	datatypes.OperationTimes
    21  }
    22  
    23  type RelInstance struct {
    24  	InstanceID types.SFID `db:"f_instance_id" json:"instanceID"`
    25  }
    26  
    27  type InstanceInfo struct {
    28  	State enums.InstanceState `db:"f_state" json:"state"`
    29  }