mirror of
https://github.com/xinliangnote/go-gin-api.git
synced 2024-04-21 12:31:46 +00:00
- 将 middleware 命名为 interceptor - 将 deploy 命名为 deployments - 移除 pkg/errno - 使用 proposal 目录 - 优化代码
16 lines
345 B
Go
16 lines
345 B
Go
package proposal
|
|
|
|
import "encoding/json"
|
|
|
|
// SessionUserInfo 当前用户会话信息
|
|
type SessionUserInfo struct {
|
|
UserID int32 `json:"user_id"` // 用户ID
|
|
UserName string `json:"user_name"` // 用户名
|
|
}
|
|
|
|
// Marshal 序列化到JSON
|
|
func (user *SessionUserInfo) Marshal() (jsonRaw []byte) {
|
|
jsonRaw, _ = json.Marshal(user)
|
|
return
|
|
}
|