package controller

import (
	"github.com/gin-gonic/gin"
	"github.com/mhaya/game/game_cluster/internal/code"
	"github.com/mhaya/game/game_cluster/nodes/adminapi/common"
	"github.com/mhaya/game/game_cluster/nodes/adminapi/entity"
	"github.com/mhaya/game/game_cluster/nodes/adminapi/service"
)

func GetUserCount(ctx *gin.Context) {
	resp := service.GetUserCount()
	common.PackOkResult(ctx, code.OK, resp)
}

func GetUserList(ctx *gin.Context) {
	var req entity.UserReq
	err := ctx.ShouldBindQuery(&req)
	if err != nil {
		return
	}
	resp := service.GetUserList(&req)
	common.PackOkResult(ctx, code.OK, resp)
}
