优化结构
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user