model

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CharacterList

func CharacterList(t string, i int, v interface{}) error

func ConnectDB

func ConnectDB(config *config.Config) *xorm.Engine

func CreateTables

func CreateTables() error

func FindBigYanAll

func FindBigYanAll(by *[]BigYan) error

func FindBigYanByGoil

func FindBigYanByGoil(by *[]BigYan, v string) error

func FindBigYanByIndex

func FindBigYanByIndex(by *[]BigYan, i int) error

func NewDatabase

func NewDatabase(driver, source string) (err error)

func Register

func Register(i interface{})

Types

type Base

type Base struct {
	Id      string     `xorm:"uuid pk"`
	Created time.Time  `xorm:"created"`
	Updated time.Time  `xorm:"updated"`
	Deleted *time.Time `xorm:"deleted"`
	Version int        `xorm:"version"`
}

func (*Base) BeforeInsert

func (b *Base) BeforeInsert()

type BigYan

type BigYan struct {
	Base    `xorm:"extends"`
	Index   int    //use array index
	Goil    string //good or ill luck(吉凶),哈哈
	SkyNine string //天九(天九地十)
	Comment string
}

BigYan 大衍之数取天九

func GetBigYanByIndex

func GetBigYanByIndex(i int) BigYan

func (*BigYan) Create

func (by *BigYan) Create(v ...interface{}) (int64, error)

type Character

type Character struct {
	Base           `xorm:"extends"`
	IsSur          bool   `xorm:"notnull"`                        //姓
	SimpleChar     string `xorm:"varchar(2) index notnull"`       //字
	SimpleStrokes  int    `xorm:"notnull default(0)"`             //标准笔画数
	TradChar       string `xorm:"varchar(2) notnull default()"`   //繁体
	TradStrokes    int    `xorm:"notnull default(0)"`             //繁体笔画数
	NameType       string `xorm:"varchar(2) notnull default()"`   //五行
	NameRoot       string `xorm:"varchar(128) notnull default()"` //字根
	Radical        string `xorm:"varchar(16) notnull default()"`  //部首
	ScienceStrokes int    `xorm:"notnull default(0)"`             //姓名学笔画数
	Pinyin         string `xorm:"varchar(128) notnull"`           //拼音
	Comment        string `xorm:"text notnull default() "`        //备注
}

func (*Character) Create

func (c *Character) Create(v ...interface{}) (int64, error)

func (*Character) Get

func (c *Character) Get() *Character

func (*Character) Sync

func (c *Character) Sync() error

func (*Character) Update

func (c *Character) Update(v ...interface{}) (int64, error)

type EightCharacter

type EightCharacter interface {
}

type FivePhase

type FivePhase struct {
	Base    `xorm:"extends"`
	First   string `xorm:"varchar(2)"`
	Second  string `xorm:"varchar(2)"`
	Third   string `xorm:"varchar(2)"`
	Fortune string `xorm:"varchar(8)"`
}

func NewFivePhase

func NewFivePhase(f, s, t string) FivePhase

func (*FivePhase) Create

func (fp *FivePhase) Create(v ...interface{}) (int64, error)

func (*FivePhase) Get

func (fp *FivePhase) Get() *FivePhase

func (*FivePhase) GetFortune

func (fp *FivePhase) GetFortune() string

type Model

type Model interface {
	Create(v ...interface{}) (int64, error)
}

type Zodiac

type Zodiac struct {
	Base       `xorm:"extends"`
	ZodiacType string
	Best       string ``
	Worst      string `xorm:"notnull default()"`
}

Jump to

Keyboard shortcuts

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