提交 v1.3.0 beta
This commit is contained in:
29
server/service/storage_log.go
Normal file
29
server/service/storage_log.go
Normal file
@ -0,0 +1,29 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"next-terminal/server/common"
|
||||
"next-terminal/server/model"
|
||||
"next-terminal/server/repository"
|
||||
"next-terminal/server/utils"
|
||||
)
|
||||
|
||||
var StorageLogService = new(storageLogService)
|
||||
|
||||
type storageLogService struct {
|
||||
baseService
|
||||
}
|
||||
|
||||
func (s storageLogService) Save(ctx context.Context, assetId, sessionId, userId, action, filename string) error {
|
||||
storageLog := &model.StorageLog{
|
||||
ID: utils.UUID(),
|
||||
AssetId: assetId,
|
||||
SessionId: sessionId,
|
||||
UserId: userId,
|
||||
Action: action,
|
||||
FileName: filename,
|
||||
Created: common.NowJsonTime(),
|
||||
}
|
||||
return repository.StorageLogRepository.Create(ctx, storageLog)
|
||||
}
|
Reference in New Issue
Block a user