profile

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangePasswordRequest

type ChangePasswordRequest struct {
	OldPassword string `json:"oldPassword" binding:"required"`
	NewPassword string `json:"newPassword" binding:"required,min=6"`
}

ChangePasswordRequest 修改密码请求

type ChangePasswordResponse

type ChangePasswordResponse struct {
	Ok bool `json:"ok"`
}

ChangePasswordResponse 修改密码响应

type GameInfo

type GameInfo struct {
	GameID   string `json:"gameId"`
	GameName string `json:"gameName"`
}

GameInfo 游戏信息

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) ChangePassword

func (h *Handler) ChangePassword(c *gin.Context)

ChangePassword 修改密码

func (*Handler) GetGames

func (h *Handler) GetGames(c *gin.Context)

GetGames 获取我的游戏列表

func (*Handler) GetPermissions

func (h *Handler) GetPermissions(c *gin.Context)

GetPermissions 获取当前用户的权限列表

func (*Handler) GetProfile

func (h *Handler) GetProfile(c *gin.Context)

GetProfile 获取个人资料

func (*Handler) UpdateProfile

func (h *Handler) UpdateProfile(c *gin.Context)

UpdateProfile 更新个人资料

type ProfileGame

type ProfileGame struct {
	GameId      string      `json:"gameId"`
	GameName    string      `json:"gameName"`
	Color       string      `json:"color"`
	Envs        []string    `json:"envs"`
	EnvMeta     interface{} `json:"envMeta"`
	Permissions []string    `json:"permissions"`
}

ProfileGame 游戏资料

type ProfileGamesRequest

type ProfileGamesRequest struct {
}

ProfileGamesRequest 获取我的游戏请求

type ProfileGamesResponse

type ProfileGamesResponse struct {
	Games []ProfileGame `json:"games"`
}

ProfileGamesResponse 获取我的游戏响应

type ProfileGetRequest

type ProfileGetRequest struct {
}

ProfileGetRequest 获取个人资料请求

type ProfileGetResponse

type ProfileGetResponse struct {
	ProfileInfo
}

ProfileGetResponse 获取个人资料响应

type ProfileInfo

type ProfileInfo struct {
	Id          int64    `json:"id"`
	Username    string   `json:"username"`
	Nickname    string   `json:"nickname"`
	Email       string   `json:"email"`
	Phone       string   `json:"phone"`
	Active      bool     `json:"active"`
	Roles       []string `json:"roles"`
	Avatar      string   `json:"avatar"`
	CreatedAt   string   `json:"createdAt"`
	UpdatedAt   string   `json:"updatedAt"`
	LastLoginAt string   `json:"lastLoginAt,omitempty"`
}

ProfileInfo 个人资料信息

type ProfilePasswordRequest

type ProfilePasswordRequest struct {
	OldPassword string `json:"oldPassword"`
	NewPassword string `json:"newPassword"`
}

ProfilePasswordRequest 修改密码请求

type ProfilePermission

type ProfilePermission struct {
	Resource string   `json:"resource"`
	Actions  []string `json:"actions"`
	GameId   string   `json:"gameId,omitempty"`
	Env      string   `json:"env,omitempty"`
}

ProfilePermission 权限

type ProfilePermissionsRequest

type ProfilePermissionsRequest struct {
	GameId string `form:"gameId"`
	Env    string `form:"env"`
}

ProfilePermissionsRequest 获取权限列表请求

type ProfilePermissionsResponse

type ProfilePermissionsResponse struct {
	Permissions   []ProfilePermission `json:"permissions"`
	Admin         bool                `json:"admin"`
	Roles         []string            `json:"roles"`
	PermissionIDs []string            `json:"permissionIDs,omitempty"`
}

ProfilePermissionsResponse 获取权限列表响应

type ProfileUpdateRequest

type ProfileUpdateRequest struct {
	Nickname string `json:"nickname"`
	Email    string `json:"email"`
	Phone    string `json:"phone"`
	Avatar   string `json:"avatar"`
}

ProfileUpdateRequest 更新个人资料请求

type ProfileUpdateResponse

type ProfileUpdateResponse struct {
	Ok bool `json:"ok"`
}

ProfileUpdateResponse 更新个人资料响应

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(adminModel *model.AdminModel, gameModel *model.GameModel, roleModel *model.RoleModel, opsStore ...*svc.OpsStateStore) *Service

func (*Service) ChangePassword

func (s *Service) ChangePassword(ctx context.Context, username string, req *ChangePasswordRequest) (*ChangePasswordResponse, error)

ChangePassword 修改密码

func (*Service) GetPermissions

func (s *Service) GetPermissions(ctx context.Context, username string) (*ProfilePermissionsResponse, error)

GetPermissions 获取用户权限列表

func (*Service) GetProfile

func (s *Service) GetProfile(ctx context.Context, username string) (*ProfileGetResponse, error)

GetProfile 获取个人资料

func (*Service) GetUserGames

func (s *Service) GetUserGames(ctx context.Context, username string) (*ProfileGamesResponse, error)

GetUserGames 获取用户的游戏列表

func (*Service) UpdateProfile

func (s *Service) UpdateProfile(ctx context.Context, username string, req *ProfileUpdateRequest) (*ProfileUpdateResponse, error)

UpdateProfile 更新个人资料

Jump to

Keyboard shortcuts

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