21 Star 41 Fork 9

K. / go-adm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
predef.go 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
K. 提交于 2015-05-02 21:05 . 增加OnBind接口
package adm
type PkMode int8
type Ope int8
type State int8
type EventSignal bool
const (
PkNone PkMode = iota
PkAi
PkNormal
)
const (
OpeNone Ope = iota
OpeCreate
OpeUpdate
OpeSelect
OpeDelete
)
const (
StateFail State = iota -1
StateNothing
StateUpdated
)
const (
EventBreak = false
EventContinue = true
)
func (s State) Success() bool {
return s >= StateNothing
}
func (s State) Fail() bool {
return s == StateFail
}
func (s State) Nothing() bool {
return s == StateNothing
}
func (s State) Updated() bool {
return s == StateUpdated
}
type ModelEvents struct {
}
func (this *ModelEvents) OnBind() {
}
func (this *ModelEvents) BeforeUpdate() EventSignal {
return EventContinue
}
func (this *ModelEvents) BeforeCreate() EventSignal {
return EventContinue
}
func (this *ModelEvents) BeforeSave() EventSignal {
return EventContinue
}
func (this *ModelEvents) BeforeDestroy() EventSignal {
return EventContinue
}
func (this *ModelEvents) AfterUpdate() {
}
func (this *ModelEvents) AfterCreate() {
}
func (this *ModelEvents) AfterSave() {
}
func (this *ModelEvents) AfterDestroy() {
}
Go
1
https://gitee.com/janpoem/go-adm.git
git@gitee.com:janpoem/go-adm.git
janpoem
go-adm
go-adm
e5bac01d84b2

搜索帮助