impl

package
v0.0.0-...-c2b00e4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyMaxExpire     = 500 // 秒
	AgainGetStopTime = 100 * time.Millisecond
)
View Source
const (
	SexMan   = 1
	SexWoman = 2
	SexOther = 3
)

性别

View Source
const (
	CacheIDPrefix = "ucid"
)

Variables

This section is empty.

Functions

func CacheDel

func CacheDel(ctx context.Context, id int64)

func CacheGet

func CacheGet(ctx context.Context, id int64) (map[string]string, error)

func CacheSet

func CacheSet(ctx context.Context, id int64, m *User)

Types

type Server

type Server struct {
	user.UnimplementedUserServiceServer
}

func (*Server) UserDelete

func (s *Server) UserDelete(ctx context.Context, in *user.UserID) (out *user.UserID, outerr error)

func (*Server) UserInfo

func (s *Server) UserInfo(ctx context.Context, in *user.UserBase) (out *user.UserBase, outerr error)

func (*Server) UserQueryAll

func (s *Server) UserQueryAll(ctx context.Context, in *user.UserAllOption) (*user.UserAll, error)

func (*Server) UserQueryOne

func (s *Server) UserQueryOne(ctx context.Context, in *user.UserID) (out *user.UserBase, outerr error)

type User

type User struct {
	ID         int64      `json:"id" db:"id" valid:"int~用户id类型为int"`
	UserName   string     `json:"user_name" db:"user_name" valid:"required~用户名称必须存在"`
	Password   string     `json:"password" db:"password" valid:"required~密码必须存在"`
	Iphone     string     `json:"iphone" db:"iphone" valid:"required~手机号码必须存在"`
	Sex        int32      `json:"sex" db:"sex" valid:"required~性别必须存在"`
	IsUsable   int32      `json:"-" db:"is_usable"`
	Page       utils.Page `gorm:"-" json:"-"`
	gorm.Model `json:"-"`
}

func (*User) Add

func (m *User) Add(ctx context.Context) error

添加

func (*User) Delete

func (m *User) Delete(ctx context.Context) error

删除

func (*User) GetID

func (m *User) GetID() int64

从缓存获取数据 nolint: unused 验证参数

func (*User) QueryAll

func (m *User) QueryAll(ctx context.Context) ([]*User, utils.Page, error)

查询全部

func (*User) QueryOne

func (m *User) QueryOne(ctx context.Context) error

查询一个

func (*User) Update

func (m *User) Update(ctx context.Context) error

修改

Jump to

Keyboard shortcuts

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