users

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instance

func Instance() *userService

func RegisterPublicEntries

func RegisterPublicEntries(app *iris.Application)

Types

type BasicForm

type BasicForm struct {
}

func (*BasicForm) Failed

func (s *BasicForm) Failed(msg string) models.BasicResp

func (*BasicForm) OK

func (s *BasicForm) OK() models.BasicResp

type DbOpOpt

type DbOpOpt func(*gorm.DB) *gorm.DB

type LoginForm

type LoginForm struct {
	BasicForm
	Email    string
	Mobile   string
	Username string
	Password string
}

type LoginResp

type LoginResp struct {
	models.BasicResp
	Data *models.NormalUser
}

type UserAddForm

type UserAddForm struct {
	BasicForm
	Username string
	Password string
	Email    string
	Mobile   string
}

type UserAddResp

type UserAddResp struct {
	models.BasicResp
}

type UserDao

type UserDao struct{}

func NewUserDao

func NewUserDao() *UserDao

func (*UserDao) Add

func (s *UserDao) Add(in *models.User) (id uint64, err error)

func (*UserDao) DropById

func (s *UserDao) DropById(id uint64) (rows int64, err error)

func (*UserDao) Exists

func (s *UserDao) Exists(id uint64) (yes bool)

func (*UserDao) ExistsBy

func (s *UserDao) ExistsBy(where string, args ...interface{}) (id uint64, yes bool)

func (*UserDao) Get

func (s *UserDao) Get(tmpl *models.User) (ret *models.User, err error)

func (*UserDao) GetBy

func (s *UserDao) GetBy(where string, args ...interface{}) (ret *models.User, err error)

func (*UserDao) GetById

func (s *UserDao) GetById(id uint64) (ret *models.User, err error)

func (*UserDao) GetLanguageByName

func (s *UserDao) GetLanguageByName(name string) (ret *models.Language)

func (*UserDao) List

func (s *UserDao) List(tmpl *models.User, opts ...DbOpOpt) (ret []*models.User, err error)

func (*UserDao) Login

func (s *UserDao) Login(userInfo *LoginForm) (ret *LoginResp, err error)

func (*UserDao) Remove

func (s *UserDao) Remove(tmpl *models.User) (rows int64, err error)

func (*UserDao) RemoveById

func (s *UserDao) RemoveById(id uint64) (rows int64, err error)

func (*UserDao) Update

func (s *UserDao) Update(in *models.User, fieldNames ...string) (ret *models.User, rows int64, err error)

type UserGetForm

type UserGetForm struct {
	BasicForm
	Id       uint64
	Username string
	Email    string
	Mobile   string
}

type UserGetResp

type UserGetResp struct {
	models.BasicResp
	Data []*models.User
}

type UserGetRespNormal

type UserGetRespNormal struct {
	models.BasicResp
	Data []*models.NormalUser
}

type UserListForm

type UserListForm struct {
	BasicForm
	Id       uint64
	Username string
	Email    string
	Mobile   string
	UniqueId string
	Limit    int
	Offset   int
}

type UserListResp

type UserListResp struct {
	models.BasicResp
	Data []*models.User
}

type UserListRespNormal

type UserListRespNormal struct {
	models.BasicResp
	Data []*models.NormalUser
}

type UserRemoveForm

type UserRemoveForm struct {
	BasicForm
	ID uint64
}

type UserRemoveResp

type UserRemoveResp struct {
	models.BasicResp
}

type UserService

type UserService interface {
	Add(form UserAddForm)
	Remove(form UserRemoveForm)
}

func Register

func Register(app *iris.Application) UserService

Jump to

Keyboard shortcuts

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