优化结构

This commit is contained in:
Yvan
2026-08-28 09:44:11 +08:00
parent 279692375b
commit e997d9718e
26 changed files with 106 additions and 129 deletions
-1
View File
@@ -100,7 +100,6 @@ type ErrorRecord struct {
type AuditRecordRepo interface {
RecordOperation(context.Context, *OperationRecord) error
RecordLogin(context.Context, *LoginLog) error
RecordDataAccess(context.Context, *DataAccessLog) error
CreateError(context.Context, *ErrorRecord) error
}
+4 -1
View File
@@ -206,7 +206,10 @@ func (uc *MediaUsecase) CompleteUpload(ctx context.Context, userID, uploadID uin
return nil, value
}
chunks, err := uc.ListChunks(ctx, uploadID)
if err != nil || len(chunks) != session.ChunkTotal {
if err != nil {
return fail(err)
}
if len(chunks) != session.ChunkTotal {
return fail(fmt.Errorf("分片不全: %d/%d", len(chunks), session.ChunkTotal))
}
sort.Slice(chunks, func(i, j int) bool { return chunks[i].Index < chunks[j].Index })