github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/models/account_password.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  // AccountPassword account password
    10  // @def primary                          PasswordID
    11  // @def unique_index ui_account_password AccountID Type DeletedAt
    12  //
    13  //go:generate toolkit gen model AccountPassword --database DB
    14  type AccountPassword struct {
    15  	RelAccount
    16  	RelAccountPassword
    17  	AccountPasswordData
    18  	datatypes.OperationTimesWithDeleted
    19  }
    20  
    21  type RelAccountPassword struct {
    22  	PasswordID types.SFID `db:"f_password_id" json:"passwordID"`
    23  }
    24  
    25  type AccountPasswordData struct {
    26  	Type     enums.PasswordType `db:"f_type"              json:"type,omitempty"`   // Type password type
    27  	Password string             `db:"f_password,size=32"  json:"password"`         // Password md5(md5(${account_id}-${password}))
    28  	Scope    string             `db:"f_scope,default=''"  json:"scope,omitempty"`  // Scope comma separated
    29  	Remark   string             `db:"f_remark,default=''" json:"remark,omitempty"` // Remark
    30  }