synthesis.go 764 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package controller
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/mhaya/game/game_cluster/nodes/webadmin/entity"
  5. "github.com/mhaya/game/game_cluster/nodes/webadmin/service"
  6. )
  7. type Synthesis struct {
  8. sev *service.Synthesis
  9. }
  10. func NewSynthesis() *Synthesis {
  11. return &Synthesis{
  12. sev: service.NewSynthesis(),
  13. }
  14. }
  15. func (s *Synthesis) FindUserLogDaily(ctx *gin.Context) {
  16. req := &entity.UserLogDailyReq{}
  17. if err := ctx.ShouldBindJSON(req); err != nil {
  18. ctx.JSON(200, gin.H{
  19. "code": 400,
  20. "msg": err.Error(),
  21. })
  22. return
  23. }
  24. resp, err := s.sev.FindMDBUserLogDaily(req)
  25. if err != nil {
  26. ctx.JSON(200, gin.H{
  27. "code": 400,
  28. "msg": err.Error(),
  29. })
  30. return
  31. }
  32. ctx.JSON(200, gin.H{
  33. "code": 200,
  34. "msg": "success",
  35. "data": resp,
  36. })
  37. }