model

package
v0.0.0-...-1391dca Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUser

func CheckUser(phone string) bool

CheckUser 检查用户是否存在

func Register

func Register(phone string, pwd string) error

Register 插入用户,先检查是否存在用户,如果没有则存入

func ResetPwd

func ResetPwd(mobile string, pwd string) error

ResetPwd 重置密码

Types

type EditUserReq

type EditUserReq struct {
	UserId     string `json:"userId"`
	UserName   string `json:"userName"`
	UserGender string `json:"gender"`
}

EditUserReq 更新用户信息数据类

type LoginReq

type LoginReq struct {
	Phone string `json:"mobile"`
	Pwd   string `json:"pwd"`
}

LoginReq 登录请求参数类

func (*LoginReq) MarshalJSON

func (j *LoginReq) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*LoginReq) MarshalJSONBuf

func (j *LoginReq) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*LoginReq) UnmarshalJSON

func (j *LoginReq) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*LoginReq) UnmarshalJSONFFLexer

func (j *LoginReq) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type User

type User struct {
	Id         string `json:"userId"`
	Name       string `json:"userName"`
	Gender     string `json:"gender"`
	Phone      string `json:"userMobile"`
	Pwd        string `json:"pwd"`
	Permission string `json:"permission"`
}

User 用户类

func LoginCheck

func LoginCheck(loginReq LoginReq) (bool, User, error)

LoginCheck 登录验证

func UpdateUser

func UpdateUser(editUser EditUserReq) (User, error)

UpdateUser 更新用户信息

func (*User) MarshalJSON

func (j *User) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*User) MarshalJSONBuf

func (j *User) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*User) UnmarshalJSON

func (j *User) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*User) UnmarshalJSONFFLexer

func (j *User) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

Jump to

Keyboard shortcuts

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