user

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 22 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"
)
View Source
const (
	SN = "srv-user" // 定义services名称
)

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)

func Run

func Run()

Types

type Server

type Server struct{}

func (*Server) UserAdd

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

func (*Server) UserDelete

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

func (*Server) UserQueryAll

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

func (*Server) UserQueryOne

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

func (*Server) UserUpdate

func (s *Server) UserUpdate(ctx context.Context, in *pb.UserBase) (out *pb.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
}

func (*User) Add

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

添加

func (*User) Delete

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

删除

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

修改

Directories

Path Synopsis
Package user is a reverse proxy.
Package user is a reverse proxy.

Jump to

Keyboard shortcuts

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