account

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package account GENERATED BY gengo:enum DON'T EDIT THIS FILE

Package account GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Package account GENERATED BY gengo:table DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

View Source
var InvalidIdentityType = github_com_pkg_errors.New("invalid IdentityType")
View Source
var InvalidType = github_com_pkg_errors.New("invalid Type")
View Source
var VendorIdentityT = &tableVendorIdentity{
	AccountID:          github_com_octohelm_storage_pkg_sqlbuilder.CastCol[ID](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&VendorIdentity{}).F("AccountID")),
	VendorIdentityFrom: github_com_octohelm_storage_pkg_sqlbuilder.CastCol[string](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&VendorIdentity{}).F("VendorIdentityFrom")),
	VendorIdentity:     github_com_octohelm_storage_pkg_sqlbuilder.CastCol[string](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&VendorIdentity{}).F("VendorIdentity")),
	ID:                 github_com_octohelm_storage_pkg_sqlbuilder.CastCol[uint64](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&VendorIdentity{}).F("ID")),
	CreatedAt:          github_com_octohelm_storage_pkg_sqlbuilder.CastCol[github_com_octohelm_storage_pkg_datatypes.Timestamp](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&VendorIdentity{}).F("CreatedAt")),
	UpdatedAt:          github_com_octohelm_storage_pkg_sqlbuilder.CastCol[github_com_octohelm_storage_pkg_datatypes.Timestamp](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&VendorIdentity{}).F("UpdatedAt")),

	I: indexNameOfVendorIdentity{
		Primary: github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&VendorIdentity{}).Cols([]string{
			"ID",
		}...),
		IVendorIdentity: github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&VendorIdentity{}).Cols([]string{
			"VendorIdentityFrom",
			"VendorIdentity",
		}...),
	},
	table: github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&VendorIdentity{}),
}

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	ID datatypes.SFID `db:"f_id" json:"-"`

	AccountID ID `db:"f_account_id" json:"accountID"`

	Desc string `db:"f_desc" json:"desc"`
	// 过期时间
	ExpiresAt datatypes.Timestamp `db:"f_expires_at,default=0" json:"expiresAt"`

	datatypes.CreationTime
}

+gengo:table:group=account +gengo:table:register=T @def primary ID @def index i_account AccountID @def index i_expires_at ExpiresAt @def index i_created_at CreatedAt

func (AccessToken) Primary

func (AccessToken) Primary() []string

func (AccessToken) RuntimeDoc

func (v AccessToken) RuntimeDoc(names ...string) ([]string, bool)

func (AccessToken) TableName

func (AccessToken) TableName() string

type Account

type Account struct {
	AccountID   ID   `db:"f_account_id" json:"accountID"`
	AccountType Type `db:"f_account_type" json:"accountType"`

	datatypes.PrimaryID
	datatypes.CreationUpdationDeletionTime
}

Account +gengo:table:register=T @def primary ID @def unique_index i_account AccountID DeletedAt @def index i_account_type AccountType @def index i_created_at CreatedAt @def index i_updated_at UpdatedAt

func (Account) Primary

func (Account) Primary() []string

func (Account) RuntimeDoc

func (v Account) RuntimeDoc(names ...string) ([]string, bool)

func (Account) TableName

func (Account) TableName() string

type ID

type ID uint64

func (ID) MarshalText

func (id ID) MarshalText() (text []byte, err error)

func (ID) RuntimeDoc

func (ID) RuntimeDoc(names ...string) ([]string, bool)

func (ID) String

func (id ID) String() string

func (*ID) UnmarshalText

func (id *ID) UnmarshalText(text []byte) error

type Identity

type Identity struct {
	AccountID    ID           `db:"f_account_id" json:"accountID"`
	IdentityType IdentityType `db:"f_identity_type" json:"identityType"`
	Identity     string       `db:"f_identity" json:"identity"`

	datatypes.PrimaryID
	datatypes.CreationUpdationTime
}

+gengo:table:group=account +gengo:table:register=T @def primary ID @def unique_index i_account_identity IdentityType Identity @def index i_account AccountID @def index i_created_at CreatedAt @def index i_updated_at UpdatedAt

func (Identity) Primary

func (Identity) Primary() []string

func (Identity) RuntimeDoc

func (v Identity) RuntimeDoc(names ...string) ([]string, bool)

func (Identity) TableName

func (Identity) TableName() string

type IdentityType

type IdentityType uint8

+gengo:enum

const (
	IDENTITY_TYPE_UNKNOWN   IdentityType = iota
	IDENTITY_TYPE__MOBILE                // 手机号
	IDENTITY_TYPE__EMAIL                 // 邮箱
	IDENTITY_TYPE__NICKNAME              // 昵称
)

func ParseIdentityTypeFromString

func ParseIdentityTypeFromString(s string) (IdentityType, error)

func ParseIdentityTypeLabelString

func ParseIdentityTypeLabelString(label string) (IdentityType, error)

func (IdentityType) EnumValues

func (IdentityType) EnumValues() []any

func (IdentityType) Label

func (v IdentityType) Label() string

func (IdentityType) MarshalText

func (v IdentityType) MarshalText() ([]byte, error)

func (IdentityType) RuntimeDoc

func (IdentityType) RuntimeDoc(names ...string) ([]string, bool)

func (*IdentityType) Scan

func (v *IdentityType) Scan(src any) error

func (IdentityType) String

func (v IdentityType) String() string

func (*IdentityType) UnmarshalText

func (v *IdentityType) UnmarshalText(data []byte) error

func (IdentityType) Value

type Robot

type Robot struct {
	Account
	RobotInfo
}

func (Robot) RuntimeDoc

func (v Robot) RuntimeDoc(names ...string) ([]string, bool)

type RobotInfo

type RobotInfo struct {
	Name string `json:"name"`
}

func (RobotInfo) RuntimeDoc

func (v RobotInfo) RuntimeDoc(names ...string) ([]string, bool)

func (*RobotInfo) ValueFromIdentity

func (r *RobotInfo) ValueFromIdentity(i *Identity)

type RobotQueryParams

type RobotQueryParams struct {
	AccountIDs []ID     `name:"accountID,omitempty" in:"query"`
	Identity   []string `name:"identity,omitempty" in:"query"`
	datatypes.Pager
}

func (RobotQueryParams) RuntimeDoc

func (v RobotQueryParams) RuntimeDoc(names ...string) ([]string, bool)

type Type

type Type uint8

+gengo:enum

const (
	TYPE_UNKNOWN Type = iota
	TYPE__USER
	TYPE__ROBOT
)

func ParseTypeFromString

func ParseTypeFromString(s string) (Type, error)

func ParseTypeLabelString

func ParseTypeLabelString(label string) (Type, error)

func (Type) EnumValues

func (Type) EnumValues() []any

func (Type) Label

func (v Type) Label() string

func (Type) MarshalText

func (v Type) MarshalText() ([]byte, error)

func (Type) RuntimeDoc

func (Type) RuntimeDoc(names ...string) ([]string, bool)

func (*Type) Scan

func (v *Type) Scan(src any) error

func (Type) String

func (v Type) String() string

func (*Type) UnmarshalText

func (v *Type) UnmarshalText(data []byte) error

func (Type) Value

func (v Type) Value() (database_sql_driver.Value, error)

type User

type User struct {
	Account
	UserInfo
}

func (User) RuntimeDoc

func (v User) RuntimeDoc(names ...string) ([]string, bool)

type UserDataList

type UserDataList struct {
	Data  []*User `json:"data"`
	Total int     `json:"total"`
}

func (UserDataList) RuntimeDoc

func (v UserDataList) RuntimeDoc(names ...string) ([]string, bool)

type UserInfo

type UserInfo struct {
	Nickname string `json:"nickname,omitempty"`
	Email    string `json:"email,omitempty"`
	Mobile   string `json:"mobile,omitempty"`
}

func (UserInfo) RuntimeDoc

func (v UserInfo) RuntimeDoc(names ...string) ([]string, bool)

func (*UserInfo) ValueFromIdentity

func (u *UserInfo) ValueFromIdentity(i *Identity)

type UserQueryParams

type UserQueryParams struct {
	AccountIDs []ID     `name:"accountID,omitempty" in:"query"`
	Identity   []string `name:"identity,omitempty" in:"query"`

	datatypes.Pager
}

func (UserQueryParams) RuntimeDoc

func (v UserQueryParams) RuntimeDoc(names ...string) ([]string, bool)

type VendorIdentity

type VendorIdentity struct {
	AccountID          ID     `db:"f_account_id" json:"accountID"`
	VendorIdentityFrom string `db:"f_vendor_identity_from" json:"vendorIdentityFrom"`
	VendorIdentity     string `db:"f_vendor_identity" json:"vendorIdentity"`

	datatypes.PrimaryID
	datatypes.CreationUpdationTime
}

+gengo:table:group=account +gengo:table:register=T @def primary ID @def unique_index i_vendor_identity VendorIdentityFrom VendorIdentity @def index i_account_id AccountID @def index i_created_at CreatedAt @def index i_updated_at UpdatedAt

func (VendorIdentity) Primary

func (VendorIdentity) Primary() []string

func (VendorIdentity) RuntimeDoc

func (v VendorIdentity) RuntimeDoc(names ...string) ([]string, bool)

func (VendorIdentity) TableName

func (VendorIdentity) TableName() string

Directories

Path Synopsis
Package repository GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Package repository GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Package service GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Package service GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Jump to

Keyboard shortcuts

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