package api

import (
	"gadmin/internal/admin/forms"
	"gadmin/internal/admin/service"
	"github.com/gin-gonic/gin"
)

func ChatLogPlayerList(c *gin.Context) {
	var req forms.ChatLogPlayerListReq
	if err := c.ShouldBind(&req); err != nil {
		c.JSON(200, ErrorResponse(err))
		return
	}

	if err := forms.ParseParams(&req); err != nil {
		c.JSON(200, ErrorResponse(err))
		return
	}

	c.JSON(200, service.ChatLog.ChatLogPlayerList(c, req))
}

func ChatLogInfo(c *gin.Context) {
	var req forms.ChatLogInfoReq
	if err := c.ShouldBind(&req); err != nil {
		c.JSON(200, ErrorResponse(err))
		return
	}

	if err := forms.ParseParams(&req); err != nil {
		c.JSON(200, ErrorResponse(err))
		return
	}

	c.JSON(200, service.ChatLog.ChatLogInfo(c, req))
}
