Files
Message-Push-Nest/routers/api/v1/login_log.go
T
2025-10-01 00:19:48 +08:00

24 lines
477 B
Go

package v1
import (
"github.com/gin-gonic/gin"
"message-nest/pkg/app"
"message-nest/pkg/e"
"message-nest/models"
)
// GetRecentLoginLogs 最近登录日志(默认8条)
func GetRecentLoginLogs(c *gin.Context) {
appG := app.Gin{C: c}
logs, err := models.GetRecentLoginLogs(8)
if err != nil {
appG.CResponse(e.ERROR, err.Error(), nil)
return
}
appG.CResponse(e.SUCCESS, "success", gin.H{
"lists": logs,
})
}