fix: remove unused DatabaseSQLLogService

This commit is contained in:
2026-04-19 17:45:13 +08:00
parent 6829d77898
commit c0a293cc8d
-47
View File
@@ -1,47 +0,0 @@
package service
import (
"context"
"next-terminal/server/common"
"next-terminal/server/model"
"next-terminal/server/repository"
"next-terminal/server/utils"
)
var DatabaseSQLLogService = new(databaseSQLLogService)
type databaseSQLLogService struct {
baseService
}
type DatabaseSQLLogParams struct {
AssetId string
Database string
UserId string
ClientIP string
SQL string
DurationMs int
RowsAffected int
Status string
ErrorMessage string
Source string
}
func (s databaseSQLLogService) Record(ctx context.Context, params DatabaseSQLLogParams) error {
log := &model.DatabaseSQLLog{
ID: utils.UUID(),
AssetId: params.AssetId,
Database: params.Database,
UserId: params.UserId,
ClientIP: params.ClientIP,
SQL: params.SQL,
DurationMs: params.DurationMs,
RowsAffected: params.RowsAffected,
Status: params.Status,
ErrorMessage: params.ErrorMessage,
Source: params.Source,
Created: common.NowJsonTime(),
}
return repository.DatabaseSQLLogRepository.Create(ctx, log)
}