File tree Expand file tree Collapse file tree
backend/modules/evaluation/application/convertor/evaluation_set Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -578,6 +578,8 @@ func OpenAPIContentDO2DTO(content *entity.Content) *common.Content {
578578 ContentType : convertDOContentTypeToOpenAPI (gptr .Indirect (content .ContentType )),
579579 Text : content .Text ,
580580 Image : ConvertImageDO2DTO (content .Image ),
581+ Audio : ConvertAudioDO2DTO (content .Audio ),
582+ Video : ConvertVideoDO2DTO (content .Video ),
581583 MultiPart : multiPart ,
582584 ContentOmitted : content .ContentOmitted ,
583585 FullContent : ConvertObjectStorageDO2DTO (content .FullContent ),
@@ -617,6 +619,18 @@ func ConvertAudioDO2DTO(audio *entity.Audio) *common.Audio {
617619 }
618620}
619621
622+ func ConvertVideoDO2DTO (video * entity.Video ) * common.Video {
623+ if video == nil {
624+ return nil
625+ }
626+ return & common.Video {
627+ Name : video .Name ,
628+ URL : video .URL ,
629+ ThumbURL : video .ThumbURL ,
630+ URI : video .URI ,
631+ }
632+ }
633+
620634func OpenAPIItemErrorGroupDO2DTOs (dos []* entity.ItemErrorGroup ) []* openapi_eval_set.ItemErrorGroup {
621635 if dos == nil {
622636 return nil
Original file line number Diff line number Diff line change @@ -533,6 +533,10 @@ func TestOpenAPIItemDOToDTOConversions(t *testing.T) {
533533 Format : & audioFormat ,
534534 URL : & audioURL ,
535535 },
536+ Video : & entity.Video {
537+ Name : & imageName ,
538+ URL : & imageURL ,
539+ },
536540 }
537541
538542 do := & entity.EvaluationSetItem {
@@ -570,6 +574,8 @@ func TestOpenAPIItemDOToDTOConversions(t *testing.T) {
570574 URL : & imageURL ,
571575 ThumbURL : & thumbURL ,
572576 },
577+ Audio : & common.Audio {Format : & audioFormat , URL : & audioURL },
578+ Video : & common.Video {Name : & imageName , URL : & imageURL },
573579 MultiPart : []* common.Content {
574580 {
575581 ContentType : ptr [common.ContentType ](common .ContentTypeText ),
You can’t perform that action at this time.
0 commit comments