user

package
v0.0.0-...-1b41cfb Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildUserResponse

func BuildUserResponse(user Session) *serializer.Response

BuildUserResponse 序列化用户响应

Types

type Session

type Session struct {
	UserName string         `json:"user_name"`
	UserID   int            `json:"user_id"`
	NickName string         `json:"nick_name"`
	Avatar   string         `json:"avatar"`
	Roles    map[int]string `json:"roles"`
}

UserSession 用户session信息

type User

type User struct {
	ID        int    `json:"id"`
	UserName  string `json:"user_name"`
	Nickname  string `json:"nickname"`
	Status    int    `json:"status"`
	Avatar    string `json:"avatar"`
	CreatedAt int64  `json:"created_at"`
}

User 用户序列化器

func BuildUser

func BuildUser(user model.User) User

BuildUser 序列化用户

Jump to

Keyboard shortcuts

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