user.go 609 B

123456789101112131415161718192021222324
  1. package controller
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/mhaya/game/game_cluster/internal/code"
  5. "github.com/mhaya/game/game_cluster/nodes/adminapi/common"
  6. "github.com/mhaya/game/game_cluster/nodes/adminapi/entity"
  7. "github.com/mhaya/game/game_cluster/nodes/adminapi/service"
  8. )
  9. func GetUserCount(ctx *gin.Context) {
  10. resp := service.GetUserCount()
  11. common.PackOkResult(ctx, code.OK, resp)
  12. }
  13. func GetUserList(ctx *gin.Context) {
  14. var req entity.UserReq
  15. err := ctx.ShouldBindQuery(&req)
  16. if err != nil {
  17. return
  18. }
  19. resp := service.GetUserList(&req)
  20. common.PackOkResult(ctx, code.OK, resp)
  21. }