player

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) Balance

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

Balance handles the request to adjust player balance

func (*Handler) Create

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

Create handles the request to create a new player

func (*Handler) Delete

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

Delete handles the request to delete a player

func (*Handler) Detail

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

Detail handles the request to get player details

func (*Handler) List

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

List handles the request to list players

func (*Handler) Update

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

Update handles the request to update a player

type Player

type Player struct {
	Id        int64  `json:"id"`
	Username  string `json:"username"`
	Nickname  string `json:"nickname"`
	Email     string `json:"email"`
	Phone     string `json:"phone"`
	GameId    string `json:"gameId"`
	Status    int    `json:"status"`  // 1:active 0:banned 2:suspended
	Balance   int64  `json:"balance"` // 游戏货币
	Level     int    `json:"level"`
	Vip       int    `json:"vip"`
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
}

Player represents a player entity in the system.

type PlayerAlias

type PlayerAlias = Player

PlayerAlias is an alias for Player for backward compatibility

type PlayerBalanceRequest

type PlayerBalanceRequest struct {
	ID     string `uri:"id"`
	Amount int64  `json:"amount"`
	Reason string `json:"reason"`
}

PlayerBalanceRequest represents a request to update player balance.

type PlayerBalanceRequestAlias

type PlayerBalanceRequestAlias = PlayerBalanceRequest

PlayerBalanceRequestAlias is an alias for PlayerBalanceRequest

type PlayerBalanceResponse

type PlayerBalanceResponse struct {
	Player
}

PlayerBalanceResponse represents the response after updating player balance.

type PlayerBalanceResponseAlias

type PlayerBalanceResponseAlias = PlayerBalanceResponse

PlayerBalanceResponseAlias is an alias for PlayerBalanceResponse

type PlayerCreateRequest

type PlayerCreateRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Nickname string `json:"nickname"`
	Email    string `json:"email"`
	Phone    string `json:"phone"`
	GameId   string `json:"gameId"`
}

PlayerCreateRequest represents a request to create a new player.

type PlayerCreateRequestAlias

type PlayerCreateRequestAlias = PlayerCreateRequest

PlayerCreateRequestAlias is an alias for PlayerCreateRequest

type PlayerCreateResponse

type PlayerCreateResponse struct {
	Player
}

PlayerCreateResponse represents the response after creating a player.

type PlayerCreateResponseAlias

type PlayerCreateResponseAlias = PlayerCreateResponse

PlayerCreateResponseAlias is an alias for PlayerCreateResponse

type PlayerDeleteRequest

type PlayerDeleteRequest struct {
	ID string `uri:"id"`
}

PlayerDeleteRequest represents a request to delete a player.

type PlayerDeleteRequestAlias

type PlayerDeleteRequestAlias = PlayerDeleteRequest

PlayerDeleteRequestAlias is an alias for PlayerDeleteRequest

type PlayerDetailRequest

type PlayerDetailRequest struct {
	ID string `uri:"id"`
}

PlayerDetailRequest represents a request to get player details.

type PlayerDetailRequestAlias

type PlayerDetailRequestAlias = PlayerDetailRequest

PlayerDetailRequestAlias is an alias for PlayerDetailRequest

type PlayerDetailResponse

type PlayerDetailResponse struct {
	Player
}

PlayerDetailResponse represents the response with player details.

type PlayerDetailResponseAlias

type PlayerDetailResponseAlias = PlayerDetailResponse

PlayerDetailResponseAlias is an alias for PlayerDetailResponse

type PlayerUpdateRequest

type PlayerUpdateRequest struct {
	ID       string `uri:"id"`
	Nickname string `json:"nickname"`
	Email    string `json:"email"`
	Phone    string `json:"phone"`
	Status   int    `json:"status"`
	Level    int    `json:"level"`
	Vip      int    `json:"vip"`
}

PlayerUpdateRequest represents a request to update player information.

type PlayerUpdateRequestAlias

type PlayerUpdateRequestAlias = PlayerUpdateRequest

PlayerUpdateRequestAlias is an alias for PlayerUpdateRequest

type PlayerUpdateResponse

type PlayerUpdateResponse struct {
	Player
}

PlayerUpdateResponse represents the response after updating a player.

type PlayerUpdateResponseAlias

type PlayerUpdateResponseAlias = PlayerUpdateResponse

PlayerUpdateResponseAlias is an alias for PlayerUpdateResponse

type PlayersListRequest

type PlayersListRequest struct {
	Page     int    `form:"page,optional,default=1"`
	PageSize int    `form:"pageSize,optional,default=20"`
	GameId   string `form:"gameId"`
	Search   string `form:"search"`
	Status   int    `form:"status"`
	Level    int    `form:"level"`
	Vip      int    `form:"vip"`
}

PlayersListRequest represents a request to list players with filtering.

type PlayersListRequestAlias

type PlayersListRequestAlias = PlayersListRequest

PlayersListRequestAlias is an alias for PlayersListRequest

type PlayersListResponse

type PlayersListResponse struct {
	Items []Player `json:"items"`
	Total int64    `json:"total"`
	Page  int      `json:"page"`
	Size  int      `json:"pageSize"`
}

PlayersListResponse represents the paginated response of players list.

type PlayersListResponseAlias

type PlayersListResponseAlias = PlayersListResponse

PlayersListResponseAlias is an alias for PlayersListResponse

type Service

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

func NewService

func NewService(svcCtx *svc.ServiceContext) *Service

func (*Service) Balance

Balance adjusts a player's balance

func (*Service) Create

Create creates a new player

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, req *PlayerDeleteRequest) error

Delete deletes a player

func (*Service) Detail

Detail retrieves details of a specific player

func (*Service) List

List retrieves a paginated list of players

func (*Service) Update

Update updates an existing player

Jump to

Keyboard shortcuts

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