Documentation ¶
Overview ¶
Copyright 2017 by rabbit author: gdccmcm14@live.com. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License
Copyright 2017 by rabbit author: gdccmcm14@live.com. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License
Copyright 2017 by rabbit author: gdccmcm14@live.com. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License
Copyright 2017 by rabbit author: gdccmcm14@live.com. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License
Copyright 2017 by rabbit author: gdccmcm14@live.com. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License
Index ¶
- func AccessList(uid int64) (list []orm.Params, err error)
- func AddGroup(g *Group) (int64, error)
- func AddNode(n *Node) (int64, error)
- func AddRole(r *Role) (int64, error)
- func AddRoleNode(roleid int64, nodeid int64) (int64, error)
- func AddRoleUser(roleid int64, userid int64) (int64, error)
- func AddUser(u *User) (int64, error)
- func DelGroupById(Id int64) (status int64, err error)
- func DelGroupNode(roleid int64, groupid int64) error
- func DelNodeById(Id int64) (int64, error)
- func DelRoleById(Id int64) (int64, error)
- func DelUserById(Id int64) (int64, error)
- func DelUserRole(roleid int64) error
- func GetGrouplist(page int64, page_size int64, sort string) (groups []orm.Params, count int64)
- func GetNodeTree(pid int64, level int64) ([]orm.Params, error)
- func GetNodelist(page int64, page_size int64, sort string) (nodes []orm.Params, count int64)
- func GetNodelistByGroupid(Groupid int64) (nodes []orm.Params, count int64)
- func GetNodelistByRoleId(Id int64) (nodes []orm.Params, count int64)
- func GetRolelist(page int64, page_size int64, sort string) (roles []orm.Params, count int64)
- func GetUserByRoleId(roleid int64) (users []orm.Params, count int64)
- func Getuserlist(page int64, page_size int64, sort string) (users []orm.Params, count int64)
- func GroupList() (groups []orm.Params)
- func InitData()
- func InsertCategory()
- func InsertConfig()
- func InsertGroup()
- func InsertNodes()
- func InsertPaper()
- func InsertRole()
- func InsertRoll()
- func InsertUser()
- func UpdateGroup(g *Group) (int64, error)
- func UpdateNode(n *Node) (int64, error)
- func UpdateRole(r *Role) (int64, error)
- func UpdateUser(u *User) (int64, error)
- func UpdateUserPasswd(u *User) (int64, error)
- type Group
- type Node
- type Role
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DelGroupById ¶
func DelGroupNode ¶
func DelNodeById ¶
func DelRoleById ¶
func DelUserById ¶
func DelUserRole ¶
func GetGrouplist ¶
func GetNodelist ¶
func GetNodelistByGroupid ¶
func GetRolelist ¶
func Getuserlist ¶
列出用户
func InsertCategory ¶
func InsertCategory()
func InsertPaper ¶
func InsertPaper()
func InsertRoll ¶
func InsertRoll()
func UpdateGroup ¶
func UpdateNode ¶
func UpdateRole ¶
func UpdateUser ¶
func UpdateUserPasswd ¶
Types ¶
type Group ¶
type Group struct { Id int64 Name string `orm:"size(100)" form:"Name" valid:"Required"` Title string `orm:"size(100)" form:"Title" valid:"Required"` Status int `orm:"default(2)" form:"Status" valid:"Range(1,2)"` Sort int `orm:"default(1)" form:"Sort"` Nodes []*Node `orm:"reverse(many)"` }
func (*Group) Query ¶
func (m *Group) Query() orm.QuerySeter
type Node ¶
type Node struct { Id int64 Title string `orm:"size(100)" form:"Title" valid:"Required"` Name string `orm:"size(100)" form:"Name" valid:"Required"` Level int `orm:"default(1)" form:"Level" valid:"Required"` Pid int64 `form:"Pid" valid:"Required"` Remark string `orm:"null;size(200)" form:"Remark" valid:"MaxSize(200)"` Status int `orm:"default(2)" form:"Status" valid:"Range(1,2)"` Group *Group `orm:"rel(fk)"` Role []*Role `orm:"rel(m2m)"` }
func (*Node) Query ¶
func (m *Node) Query() orm.QuerySeter
type Role ¶
type Role struct { Id int64 Title string `orm:"size(100)" form:"Title" valid:"Required"` Name string `orm:"size(100)" form:"Name" valid:"Required"` Remark string `orm:"null;size(200)" form:"Remark" valid:"MaxSize(200)"` Status int `orm:"default(2)" form:"Status" valid:"Range(1,2)"` Node []*Node `orm:"reverse(many)"` User []*User `orm:"reverse(many)"` }
角色表
func (*Role) Query ¶
func (m *Role) Query() orm.QuerySeter
type User ¶
type User struct { Id int64 Logincount int Username string `orm:"unique;size(32)" form:"Username" valid:"Required;MaxSize(20);MinSize(6)"` Password string `orm:"size(32)" form:"Password" valid:"Required;MaxSize(20);MinSize(6)"` Repassword string `orm:"-" form:"Repassword" valid:"Required"` Nickname string `orm:"unique;size(32)" form:"Nickname" valid:"Required;MaxSize(20);MinSize(2)"` Email string `orm:"size(32)" form:"Email" valid:"Email"` Remark string `orm:"null;size(200)" form:"Remark" valid:"MaxSize(200)"` Status int `orm:"default(2)" form:"Status" valid:"Range(1,2)"` Lastlogintime time.Time `orm:"null;type(datetime)" form:"-"` Createtime time.Time `orm:"type(datetime)" ` Lastip string Role []*Role `orm:"rel(m2m)"` }
func GetUserByUsername ¶
func UpdateLoginTime ¶
func (*User) Query ¶
func (m *User) Query() orm.QuerySeter
func (*User) Valid ¶
func (u *User) Valid(v *validation.Validation)