github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/models/publisher.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  // Publisher database model demo
     9  // @def primary                                  ID
    10  // @def unique_index UI_publisher_id   	         PublisherID
    11  // @def unique_index UI_project_id_publisher_key ProjectID Key
    12  //
    13  //go:generate toolkit gen model Publisher --database DB
    14  type Publisher struct {
    15  	datatypes.PrimaryID
    16  	RelProject
    17  	RelPublisher
    18  	PublisherInfo
    19  	datatypes.OperationTimes
    20  }
    21  
    22  type RelPublisher struct {
    23  	PublisherID types.SFID `db:"f_publisher_id" json:"publisherID"`
    24  }
    25  
    26  type PublisherInfo struct {
    27  	Name  string `db:"f_name"             json:"name"`
    28  	Key   string `db:"f_key"              json:"key"` // Key the unique identifier for publisher
    29  	Token string `db:"f_token,default=''" json:"token"`
    30  }