admin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2017 by GoWeb 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

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitData

func InitData()

func InsertUser

func InsertUser()

用户数据

Types

type User

type User struct {
	Id            int64
	Logincount    int       `orm:"column(logincount)" form:"logincount" json:"loginCount"`
	Username      string    `orm:"unique;size(32)" form:"Username"  valid:"Required;MaxSize(20);MinSize(6)" json:"username"`
	Password      string    `orm:"size(32)" form:"Password" valid:"Required;MaxSize(20);MinSize(6)" json:"password"`
	Repassword    string    `orm:"-" form:"Repassword" valid:"Required" json:"repassword"`
	Nickname      string    `orm:"unique;size(32)" form:"Nickname" valid:"Required;MaxSize(20);MinSize(2)" json:"nickname"`
	Email         string    `orm:"size(32)" form:"Email" valid:"Email" json:"email"`
	Remark        string    `orm:"null;size(200)" form:"Remark" valid:"MaxSize(200)" json:"remark"`
	Status        int       `orm:"default(2)" form:"Status" valid:"Range(0,1)" json:"status"`
	Lastlogintime time.Time `orm:"null;type(datetime)" form:"-" json:"lastLoginTime"`
	Createtime    time.Time `orm:"type(datetime)" json:"createTime"`
	Lastip        string    `json:"lastip"`
}

func GetUsableUserByUsername

func GetUsableUserByUsername(username string) (user User, err error)

func GetUserByUsername

func GetUserByUsername(username string) (user User, err error)

func GetUserOnlyByUsername

func GetUserOnlyByUsername(username string) (user User)

func ListUserByUsername

func ListUserByUsername(offset, limit int) []*User

func SearchUserByUsername

func SearchUserByUsername(username string) []*User

func UpdateLoginTime

func UpdateLoginTime(u *User) User

func (*User) Delete

func (m *User) Delete() error

func (*User) Insert

func (m *User) Insert() error

func (*User) Read

func (m *User) Read(fields ...string) error

func (*User) TableName

func (u *User) TableName() string

func (*User) Update

func (m *User) Update(fields ...string) error

Jump to

Keyboard shortcuts

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