models

package
v0.0.0-...-66f669f Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2015 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB_Read *xorm.Engine

读数据

View Source
var DB_Write *xorm.Engine

写数据

Functions

func InitDB

func InitDB()

设置数据库

Types

type Admin

type Admin struct {
	Id            int64                  `xorm:"pk autoincr"`
	Username      string                 `xorm:"unique index varchar(255)"`
	Password      string                 `xorm:"varchar:(32)"`
	Roleid        int64                  `xorm:"index"`
	Role          *Role                  `xorm:"- <- ->"`
	Lastloginip   string                 `xorm:"varchar(32)"`
	LastipAddress map[string]interface{} `xorm:"- <- ->"`
	Lastlogintime string                 `xorm:"varchar(32)"`
	Email         string                 `xorm:"varchar(32)"`
	Realname      string                 `xorm:"varchar(32)"`
	Lang          string                 `xorm:"varchar(6)"`
	Status        int64                  `xorm:"bool"`
	Createtime    string                 `xorm:"DateTime"`
}

func (*Admin) DelByID

func (a *Admin) DelByID(Id int64) bool

删除管理员

func (*Admin) Edit

func (a *Admin) Edit(Id int64) bool

编辑管理员

func (*Admin) EditInfo

func (a *Admin) EditInfo(Id int64) bool

修改个人信息

func (*Admin) EditPwd

func (a *Admin) EditPwd(Id int64) bool

修改密码

func (*Admin) GetByAll

func (a *Admin) GetByAll(RoleId int64, where map[string]string, Page int64, Perpage int64) ([]*Admin, template.HTML)

获取管理员列表

func (*Admin) GetById

func (a *Admin) GetById(Id int64) *Admin

根据Id获取管理员信息

func (*Admin) GetByName

func (a *Admin) GetByName(name string) *Admin

根据用户名获取管理员信息

func (*Admin) GetByRealName

func (a *Admin) GetByRealName(name string) *Admin

根据真实姓名获取管理员信息

func (*Admin) GetMysqlVer

func (a *Admin) GetMysqlVer() string

获取MySQL版本

func (*Admin) HasEmail

func (a *Admin) HasEmail() bool

func (*Admin) HasName

func (a *Admin) HasName() bool

func (*Admin) Save

func (a *Admin) Save() bool

添加管理员

func (*Admin) UpdateLoginTime

func (a *Admin) UpdateLoginTime(Id int64) bool

更新登陆时间

func (*Admin) Validate

func (a *Admin) Validate(v *revel.Validation)

type Admin_Panel

type Admin_Panel struct {
	Id         int64  `xorm:"pk"`
	Mid        int64  `xorm:"int(11)"`
	Menu       *Menu  `xorm:"- <- ->"`
	Aid        int64  `xorm:"int(11)"`
	Name       string `xorm:"varchar(40)"`
	Url        string `xorm:"char(100)"`
	Createtime string `xorm:"DateTime"`
}

func (*Admin_Panel) AddPanel

func (a *Admin_Panel) AddPanel(Mid int64, Admin_Info *Admin) bool

添加快捷方式

func (*Admin_Panel) DelPanel

func (a *Admin_Panel) DelPanel(Mid int64, Admin_Info *Admin) bool

删除快捷方式

func (*Admin_Panel) GetById

func (a *Admin_Panel) GetById(Id int64) *Admin_Panel

根据Id获取信息

func (*Admin_Panel) GetByMid

func (a *Admin_Panel) GetByMid(Mid int64, Admin_Info *Admin) *Admin_Panel

根据mid获取快捷方式

func (*Admin_Panel) GetPanelList

func (a *Admin_Panel) GetPanelList(Admin_Info *Admin) []*Admin_Panel

获取快捷方式列表

func (*Admin_Panel) IsAdd

func (a *Admin_Panel) IsAdd(Mid int64, Admin_Info *Admin) bool

是否已添加快捷方式

type Announce

type Announce struct {
	Id         int64  `xorm:"pk"`
	Title      string `xorm:"varchar(255)"`
	Content    string `xorm:"text"`
	Starttime  string `xorm:"DateTime"`
	Endtime    string `xorm:"DateTime"`
	Hits       int64  `xorm:"int(11)"`
	Status     int64  `xorm:"default 1"`
	Createtime string `xorm:"DateTime"`
}

func (*Announce) DelByID

func (a *Announce) DelByID(Id int64) bool

删除公告

func (*Announce) Edit

func (a *Announce) Edit(Id int64) bool

编辑公告

func (*Announce) GetByAll

func (a *Announce) GetByAll(Page int64, Perpage int64) ([]*Announce, template.HTML)

获取公告列表

func (*Announce) GetById

func (a *Announce) GetById(Id int64) *Announce

根据Id获取菜单信息

func (*Announce) Save

func (a *Announce) Save() bool

添加公告

type Article

type Article struct {
	Id             int64      `xorm:"pk autoincr"`
	Cid            int64      `xorm:"index"`
	Category       *Category  `xorm:"- <- ->"`
	Aid            int64      `xorm:"index"`
	Admin          *Admin     `xorm:"- <- ->"`
	Title          string     `xorm:"varchar(80)"`
	Color          string     `xorm:"char(24)"`
	Font           string     `xorm:"char(24)"`
	Thumb          string     `xorm:"varchar(80)"`
	Content        string     `xorm:"text"`
	Copyfrom       string     `xorm:"varchar(100)"`
	Keywords       string     `xorm:"varchar(255)"`
	Description    string     `xorm:"varchar(255)"`
	Relation       string     `xorm:"varchar(255)"`
	RelationList   []*Article `xorm:"- <- ->"`
	Pagetype       int64      `xorm:"tynyint(1)"`
	Maxcharperpage int64      `xorm:"mediumint(6)"`
	Istop          int64      `xorm:"tynyint(1)"`
	Status         int64      `xorm:"tynyint(1)"`
	Hits           int64      `xorm:"tynyint(5)"`
	Iscomment      int64      `xorm:"tynyint(1)"`
	Createtime     string     `xorm:"DateTime"`
	Updatetime     string     `xorm:"DateTime"`
}

func (*Article) DelByID

func (a *Article) DelByID(Id int64) bool

删除内容

func (*Article) Edit

func (a *Article) Edit(Id int64) bool

编辑内容

func (*Article) GetByAll

func (a *Article) GetByAll(search string, Cid int64, Page int64, Perpage int64) (article_arr []*Article, html template.HTML, where map[string]interface{})

获取内容列表

func (*Article) GetByCid

func (a *Article) GetByCid(Cid int64) *Article

根据Cid获取栏目单页面内容

func (*Article) GetById

func (a *Article) GetById(Id int64) *Article

根据Id获取内容信息

func (*Article) GetByList

func (a *Article) GetByList(Cid int64, Search string, Page int64, Perpage int64) (article_arr []*Article, html template.HTML, where map[string]interface{})

获取内容列表

func (*Article) HasTitle

func (a *Article) HasTitle() bool

标题是否存在

func (*Article) Remove

func (a *Article) Remove(Cid int64, ids string) bool

批量移动

func (*Article) Save

func (a *Article) Save() bool

添加内容

type Category

type Category struct {
	Id          int64                  `xorm:"pk"`
	Pid         int64                  `xorm:"int(11)"`
	Type        int64                  `xorm:"int(11)"`
	Name        string                 `xorm:"varchar(255)"`
	Enname      string                 `xorm:"varchar(255)"`
	Desc        string                 `xorm:"text"`
	Url         string                 `xorm:"varchar(100)"`
	Hits        int64                  `xorm:"int(11)"`
	Setting     string                 `xorm:"text"`
	SettingText map[string]interface{} `xorm:"- <- ->"`
	Order       int64                  `xorm:"int(11)"`
	Ismenu      int64                  `xorm:"default 1"`
}

func (*Category) DelByID

func (c *Category) DelByID(Id int64) bool

删除栏目

func (*Category) Edit

func (c *Category) Edit(Id int64) bool

编辑栏目

func (*Category) GetById

func (c *Category) GetById(Id int64) *Category

根据Id获取栏目信息

func (*Category) GetCateGoryHtml

func (c *Category) GetCateGoryHtml(Admin_Info *Admin) template.HTML

获取所有菜单 返回HTML

func (*Category) GetCateGoryOptionHtml

func (c *Category) GetCateGoryOptionHtml(Id int64) template.HTML

返回菜单Option的HTML

func (*Category) GetCateNameHtml

func (c *Category) GetCateNameHtml(CateName string) string

快速进入 搜索

func (*Category) GetLeftHtml

func (c *Category) GetLeftHtml() template.HTML

返回左侧导航

func (*Category) GetLeftTree

func (c *Category) GetLeftTree() template.HTML

返回菜单树

func (*Category) Save

func (c *Category) Save() bool

添加栏目

type Comment

type Comment struct {
	Id         int64  `xorm:"pk autoincr"`
	Replyid    int64  `xorm:"index"`
	Content    string `xorm:"text"`
	Uid        int64  `xorm:"index"`
	User       *User  `xorm:"- <- ->"`
	Agree      int64  `xorm:"int(11)"`
	Against    int64  `xorm:"int(11)"`
	Ip         string `xorm:"char(11)"`
	Createtime string `xorm:"DateTime"`
}

func (*Comment) GetById

func (c *Comment) GetById(Id int64) *Comment

根据Id获取信息

func (*Comment) GetCommentList

func (c *Comment) GetCommentList(search string, Page int64, Perpage int64) (comment_arr []*Comment, html template.HTML, where map[string]interface{})

获取评论列表

func (*Comment) Save

func (c *Comment) Save() bool

添加评论

type Complaints

type Complaints struct {
	Id          int64  `xorm:"pk"`
	Type        int64  `xorm:"tinyint(1)"`
	Question    string `xorm:"varchar(255)"`
	Companyname string `xorm:"varchar(255)"`
	Name        string `xorm:"varchar(50)"`
	Phone       string `xorm:"varchar(50)"`
	Email       string `xorm:"varchar(50)"`
	Qq          string `xorm:"varchar(50)"`
	Createtime  string `xorm:"DateTime"`
}

func (*Complaints) DelByID

func (c *Complaints) DelByID(Id int64) bool

删除投诉建议

func (*Complaints) GetByAll

func (c *Complaints) GetByAll(Page int64, Perpage int64) ([]*Complaints, template.HTML)

获取投诉建议列表

func (*Complaints) GetById

func (c *Complaints) GetById(Id int64) *Complaints

根据Id获取投诉建议信息

type Copyfrom

type Copyfrom struct {
	Id         int64  `xorm:"pk autoincr"`
	Sitename   string `xorm:"varchar:(30)"`
	Siteurl    string `xorm:"varchar(100)"`
	Thumb      string `xorm:"varchar(100)"`
	Createtime string `xorm:"DateTime"`
}

func (*Copyfrom) DelByID

func (c *Copyfrom) DelByID(Id int64) bool

删除来源

func (*Copyfrom) Edit

func (c *Copyfrom) Edit(Id int64) bool

编辑来源

func (*Copyfrom) GetByAll

func (c *Copyfrom) GetByAll(Page int64, Perpage int64) ([]*Copyfrom, template.HTML)

获取来源列表

func (*Copyfrom) GetById

func (c *Copyfrom) GetById(Id int64) *Copyfrom

根据Id获取来源信息

func (*Copyfrom) GetRoleList

func (c *Copyfrom) GetRoleList() []*Copyfrom

获取来源列表

func (*Copyfrom) Save

func (c *Copyfrom) Save() bool

添加来源

type DailyMinutes

type DailyMinutes struct {
}

每天执行 每天运行一次,午夜

func (DailyMinutes) Run

func (c DailyMinutes) Run()

type EveryMinute

type EveryMinute struct {
}

每分钟执行一次

func (EveryMinute) Run

func (c EveryMinute) Run()

type FiveMinutes

type FiveMinutes struct {
}

每五分钟执行一次

func (FiveMinutes) Run

func (c FiveMinutes) Run()

type Focus

type Focus struct {
	Id         int64      `xorm:"pk autoincr"`
	Cid        int64      `xorm:"index"`
	Focuscate  *FocusCate `xorm:"- <- ->"`
	Aid        int64      `xorm:"index"`
	Admin      *Admin     `xorm:"- <- ->"`
	Title      string     `xorm:"varchar(255)"`
	Url        string     `xorm:"varchar(255)"`
	Img        string     `xorm:"varchar(255)"`
	Content    string     `xorm:"text"`
	Clicks     int64      `xorm:"int(10)"`
	Order      int64      `xorm:"tynyint(5)"`
	Status     int64      `xorm:"tynyint(1)"`
	Createtime string     `xorm:"DateTime"`
	Updatetime string     `xorm:"DateTime"`
}

func (*Focus) Edit

func (c *Focus) Edit(Id int64) bool

编辑焦点图

func (*Focus) GetByAll

func (c *Focus) GetByAll(search string, Page int64, Perpage int64) (focus_arr []*Focus, html template.HTML, where map[string]interface{})

获取焦点图列表

func (*Focus) GetById

func (c *Focus) GetById(Id int64) *Focus

根据Id获取内容信息

func (*Focus) Save

func (c *Focus) Save() bool

添加焦点图

type FocusCate

type FocusCate struct {
	Id         int64  `xorm:"pk autoincr"`
	Name       string `xorm:"varchar(255)"`
	Width      int64  `xorm:"int(6)"`
	Height     int64  `xorm:"int(6)"`
	Createtime string `xorm:"DateTime"`
}

func (*FocusCate) DelByID

func (c *FocusCate) DelByID(Id int64) bool

删除分类

func (*FocusCate) Edit

func (c *FocusCate) Edit(Id int64) bool

编辑分类

func (*FocusCate) GetByAll

func (c *FocusCate) GetByAll(Page int64, Perpage int64) ([]*FocusCate, template.HTML)

获取分类列表

func (*FocusCate) GetById

func (c *FocusCate) GetById(Id int64) *FocusCate

根据Id获取焦点图分类

func (*FocusCate) GetCateList

func (c *FocusCate) GetCateList() []*FocusCate

获取分类列表

func (*FocusCate) Save

func (c *FocusCate) Save() bool

添加分类

type HourlyMinutes

type HourlyMinutes struct {
}

每小时执行

func (HourlyMinutes) Run

func (c HourlyMinutes) Run()

type Logs

type Logs struct {
	Id         int64                  `xorm:"pk autoincr"`
	Uid        int64                  `xorm:"unique"`
	Admin      *Admin                 `xorm:"- <- ->"`
	Module     string                 `xorm:"varchar:(50)"`
	Url        string                 `xorm:"varchar(100)"`
	Action     string                 `xorm:"varchar(100)"`
	Ip         string                 `xorm:"varchar(15)"`
	IpAddress  map[string]interface{} `xorm:"- <- ->"`
	Desc       string                 `xorm:"text"`
	Createtime string                 `xorm:"DateTime"`
}

func (*Logs) DelAll

func (L *Logs) DelAll() bool

清空日志

func (*Logs) GetByAll

func (L *Logs) GetByAll(search string, Page int64, Perpage int64) (logs_arr []*Logs, html template.HTML, where map[string]interface{})

获取日志列表

func (*Logs) Save

func (L *Logs) Save(Admin_Info *Admin, c *revel.Controller, Desc string) bool

添加日志记录

func (*Logs) Validate

func (L *Logs) Validate(v *revel.Validation)
type Menu struct {
	Id      int64  `xorm:"pk"`
	Name    string `xorm:"char(40)"`
	Enname  string `xorm:"char(40)"`
	Pid     int64  `xorm:"int(11)"`
	Url     string `xorm:"char(100)"`
	Data    string `xorm:"varchar(60)"`
	Order   int64  `xorm:"int(11)"`
	Display int64  `xorm:"default 1"`
}
func (m *Menu) DelByID(Id int64) bool

删除菜单

func (m *Menu) Edit(Id int64) bool

编辑菜单

func (m *Menu) GetAdminMenu(Pid int64, Admin_Info *Admin) []*Menu

按父ID查找菜单子项

func (m *Menu) GetById(Id int64) *Menu

根据Id获取菜单信息

func (m *Menu) GetLeftMenuHtml(Pid int64, Admin_Info *Admin) template.HTML

获取左侧导航菜单

func (m *Menu) GetMenuAll() map[int64][]*Menu

获取所有菜单

func (m *Menu) GetMenuHtml(Admin_Info *Admin) template.HTML

获取所有菜单 返回HTML

func (m *Menu) GetMenuMap(Admin_Info *Admin) template.HTML

返回后台地图

func (m *Menu) GetMenuOptionHtml(Id int64, Admin_Info *Admin) template.HTML

返回菜单Option的HTML

func (m *Menu) GetMenuTree(role string, Admin_Info *Admin) template.HTML

返回菜单树

func (m *Menu) GetPos(Id int64, Admin_Info *Admin) string

当前位置

func (m *Menu) Save() bool

添加菜单

func (menu *Menu) Validate(v *revel.Validation)

type MonthlyMinutes

type MonthlyMinutes struct {
}

每月执行 一个月运行一次,半夜,第一个月

func (MonthlyMinutes) Run

func (c MonthlyMinutes) Run()

type Password

type Password struct {
	Password        string
	PasswordConfirm string
}

func (*Password) ValidatePassword

func (P *Password) ValidatePassword(v *revel.Validation)

验证密码

type Role

type Role struct {
	Id         int64  `xorm:"pk"`
	Rolename   string `xorm:"unique varchar(255)"`
	Desc       string `xorm:"varchar:(255)"`
	Data       string `xorm:"text"`
	Status     int64  `xorm:"bool"`
	Createtime string `xorm:"DateTime"`
}

func (*Role) DelByID

func (r *Role) DelByID(Id int64) bool

删除角色

func (*Role) Edit

func (r *Role) Edit(Id int64) bool

编辑角色

func (*Role) GetByAll

func (r *Role) GetByAll(Page int64, Perpage int64) ([]*Role, template.HTML)

获取角色列表

func (*Role) GetById

func (r *Role) GetById(Id int64) *Role

根据Id获取角色信息

func (*Role) GetRoleList

func (r *Role) GetRoleList() []*Role

获取角色

func (*Role) Save

func (r *Role) Save() bool

添加角色

func (*Role) SetStatus

func (r *Role) SetStatus(Id int64) bool

设置状态

type Task

type Task struct {
}

type Template

type Template struct {
	Id         int64  `xorm:"pk autoincr"`
	Identity   string `xorm:"varchar(50)"`
	Name       string `xorm:"varchar:(50)"`
	Author     string `xorm:"varchar(50)"`
	Version    string `xorm:"varchar(20)"`
	Status     int64  `xorm:"bool"`
	Createtime string `xorm:"DateTime"`
}

func (*Template) DelByID

func (t *Template) DelByID(Id int64) bool

删除模板风格

func (*Template) Edit

func (t *Template) Edit(Id int64) bool

编辑模板风格

func (*Template) GetById

func (t *Template) GetById(Id int64) *Template

根据Id获取信息

func (*Template) GetTemplateList

func (t *Template) GetTemplateList() []*Template

获取模板风格列表

func (*Template) Save

func (t *Template) Save() bool

添加模板风格

func (*Template) Setstatus

func (t *Template) Setstatus(Id int64) bool

设置状态

type Test

type Test struct {
	Id         int64  `xorm:"pk autoincr"`
	Content    string `xorm:"varchar(255)"`
	Createtime string `xorm:"DateTime"`
}

func (*Test) Save

func (c *Test) Save() bool

type ThirtyMinutes

type ThirtyMinutes struct {
}

每三十分钟执行

func (ThirtyMinutes) Run

func (c ThirtyMinutes) Run()

type Upload

type Upload struct {
}

func (Upload) EditorUpload

func (u Upload) EditorUpload() string

编辑器文件上传

type User

type User struct {
	Id          int64       `xorm:"pk"`
	Email       string      `xorm:"char(32)"`
	Username    string      `xorm:"char(20)"`
	Password    string      `xorm:"char(32)"`
	Encrypt     string      `xorm:"char(6)"`
	Nickname    string      `xorm:"char(20)"`
	Mobile      string      `xorm:"char(11)"`
	Birthday    string      `xorm:"Date"`
	Regip       string      `xorm:"char(11)"`
	Regdate     string      `xorm:"DateTime"`
	Lastdate    string      `xorm:"DateTime"`
	Lastip      string      `xorm:"char(11)"`
	Loginnum    int64       `xorm:"int(11)"`
	Groupid     int64       `xorm:"int(11)"`
	UserGroup   *User_Group `xorm:"- <- ->"`
	Areaid      int64       `xorm:"int(11)"`
	Amount      float64     `xorm:"float(8,2)"`
	Point       int64       `xorm:"smallint(5)"`
	Ismessage   int64       `xorm:"bool"`
	Islock      int64       `xorm:"bool"`
	Vip         int64       `xorm:"tinyint(1)"`
	Overduedate string      `xorm:"DateTime"`
	Status      int64       `xorm:"bool"`
	Createtime  string      `xorm:"DateTime"`
}

func (*User) DelByID

func (u *User) DelByID(Id int64) bool

删除用户

func (*User) DelByIDS

func (u *User) DelByIDS(ids string) bool

批量删除

func (*User) Edit

func (u *User) Edit(Id int64) bool

添加会员

func (*User) GetById

func (u *User) GetById(Id int64) *User

根据Id获取信息

func (*User) GetUserList

func (u *User) GetUserList(search string, Page int64, Perpage int64) (user_arr []*User, html template.HTML, where map[string]interface{})

获取会员列表

func (*User) HasEmail

func (u *User) HasEmail() bool

邮箱是否已有

func (*User) HasName

func (u *User) HasName() bool

用户名是否已有

func (*User) Lock

func (u *User) Lock(ids string) bool

锁定

func (*User) Move

func (u *User) Move(groupid int64, ids string) bool

移动

func (*User) Save

func (u *User) Save() bool

添加会员

func (*User) Unlock

func (u *User) Unlock(ids string) bool

解锁

type User_Group

type User_Group struct {
	Id               int64   `xorm:"pk"`
	Name             string  `xorm:"char(15)"`
	Issystem         int64   `xorm:"bool"`
	Usernum          int64   `xorm:"- <- ->"`
	Star             int64   `xorm:"tinyint(2)"`
	Point            int64   `xorm:"smallint(6)"`
	Allowmessage     int64   `xorm:"tinyint(5)"`
	Allowvisit       int64   `xorm:"bool"`
	Allowpost        int64   `xorm:"bool"`
	Allowpostverify  int64   `xorm:"bool"`
	Allowsearch      int64   `xorm:"bool"`
	Allowupgrade     int64   `xorm:"bool"`
	Allowsendmessage int64   `xorm:"bool"`
	Allowpostnum     int64   `xorm:"bool"`
	Allowattachment  int64   `xorm:"bool"`
	Priceyear        float64 `xorm:"float(8,2)"`
	Pricemonth       float64 `xorm:"float(8,2)"`
	Priceday         float64 `xorm:"float(8,2)"`
	Icon             string  `xorm:"char(100)"`
	Usernamecolor    string  `xorm:"char(7)"`
	Desc             string  `xorm:"char(100)"`
	Status           int64   `xorm:"bool"`
	Createtime       string  `xorm:"DateTime"`
}

func (*User_Group) Edit

func (u *User_Group) Edit(Id int64) bool

编辑会员组

func (*User_Group) GetById

func (u *User_Group) GetById(Id int64) *User_Group

根据Id获取信息

func (*User_Group) GetGroupList

func (u *User_Group) GetGroupList() []*User_Group

获取会员组列表

func (*User_Group) Save

func (u *User_Group) Save() bool

添加会员组

type WeeklyMinutes

type WeeklyMinutes struct {
}

每周执行 每周运行一次,周日午夜

func (WeeklyMinutes) Run

func (c WeeklyMinutes) Run()

type YearlyMinutes

type YearlyMinutes struct {
}

每年执行 运行一年一次,1月1日午夜

func (YearlyMinutes) Run

func (c YearlyMinutes) Run()

Jump to

Keyboard shortcuts

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