feat: add login log record

This commit is contained in:
engigu
2025-10-01 00:19:48 +08:00
parent 456d3aaf46
commit 6dbc8352e9
9 changed files with 156 additions and 8 deletions
+23
View File
@@ -0,0 +1,23 @@
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,
})
}