56 lines
1.5 KiB
Go
56 lines
1.5 KiB
Go
|
package handler
|
||
|
|
||
|
import (
|
||
|
"ego/internal/service"
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
// SysLoginLogHandler 登录日志处理器
|
||
|
type SysLoginLogHandler struct {
|
||
|
sysLoginLogService *service.SysLoginLogService
|
||
|
}
|
||
|
|
||
|
// NewSysLoginLogHandler 构建登录日志处理器
|
||
|
func NewSysLoginLogHandler(sysLoginLogService *service.SysLoginLogService) *SysLoginLogHandler {
|
||
|
return &SysLoginLogHandler{
|
||
|
sysLoginLogService: sysLoginLogService,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Create 创建登录日志
|
||
|
func (h *SysLoginLogHandler) Create(c *gin.Context) {
|
||
|
c.JSON(http.StatusOK, h.sysLoginLogService.Create(c))
|
||
|
}
|
||
|
|
||
|
// DeleteByID 根据ID删除登录日志
|
||
|
func (h *SysLoginLogHandler) DeleteByID(c *gin.Context) {
|
||
|
c.JSON(http.StatusOK, h.sysLoginLogService.DeleteByID(c))
|
||
|
}
|
||
|
|
||
|
// UpdateByID 根据ID更新登录日志
|
||
|
func (h *SysLoginLogHandler) UpdateByID(c *gin.Context) {
|
||
|
c.JSON(http.StatusOK, h.sysLoginLogService.UpdateByID(c))
|
||
|
}
|
||
|
|
||
|
// GetByID 根据ID获取登录日志
|
||
|
func (h *SysLoginLogHandler) GetByID(c *gin.Context) {
|
||
|
c.JSON(http.StatusOK, h.sysLoginLogService.GetByID(c))
|
||
|
}
|
||
|
|
||
|
// GetByCondition 根据条件获取登录日志
|
||
|
func (h *SysLoginLogHandler) GetByCondition(c *gin.Context) {
|
||
|
c.JSON(http.StatusOK, h.sysLoginLogService.GetByCondition(c))
|
||
|
}
|
||
|
|
||
|
// ListByIDs 根据ID列表获取登录日志
|
||
|
func (h *SysLoginLogHandler) ListByIDs(c *gin.Context) {
|
||
|
c.JSON(http.StatusOK, h.sysLoginLogService.ListByIDs(c))
|
||
|
}
|
||
|
|
||
|
// DeleteByIDs 根据ID列表删除登录日志
|
||
|
func (h *SysLoginLogHandler) DeleteByIDs(c *gin.Context) {
|
||
|
c.JSON(http.StatusOK, h.sysLoginLogService.DeleteByIDs(c))
|
||
|
}
|