fix: remove unused DatabaseSQLLogService
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user