github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/models/applet.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  )
     7  
     8  // Applet database model applet
     9  // @def primary                          ID
    10  // @def unique_index UI_applet_id        AppletID
    11  // @def unique_index UI_project_name     ProjectID Name
    12  //
    13  //go:generate toolkit gen model Applet --database DB
    14  type Applet struct {
    15  	datatypes.PrimaryID
    16  	RelProject
    17  	RelApplet
    18  	RelResource
    19  	AppletInfo
    20  	datatypes.OperationTimes
    21  }
    22  
    23  type RelApplet struct {
    24  	AppletID types.SFID `db:"f_applet_id" json:"appletID"`
    25  }
    26  
    27  type AppletInfo struct {
    28  	Name string `db:"f_name" json:"name"`
    29  }