diff --git a/backend/modules/evaluation/application/convertor/evaluation_set/openapi.go b/backend/modules/evaluation/application/convertor/evaluation_set/openapi.go index aa181db1a..12cdeed31 100755 --- a/backend/modules/evaluation/application/convertor/evaluation_set/openapi.go +++ b/backend/modules/evaluation/application/convertor/evaluation_set/openapi.go @@ -578,6 +578,8 @@ func OpenAPIContentDO2DTO(content *entity.Content) *common.Content { ContentType: convertDOContentTypeToOpenAPI(gptr.Indirect(content.ContentType)), Text: content.Text, Image: ConvertImageDO2DTO(content.Image), + Audio: ConvertAudioDO2DTO(content.Audio), + Video: ConvertVideoDO2DTO(content.Video), MultiPart: multiPart, ContentOmitted: content.ContentOmitted, FullContent: ConvertObjectStorageDO2DTO(content.FullContent), @@ -617,6 +619,18 @@ func ConvertAudioDO2DTO(audio *entity.Audio) *common.Audio { } } +func ConvertVideoDO2DTO(video *entity.Video) *common.Video { + if video == nil { + return nil + } + return &common.Video{ + Name: video.Name, + URL: video.URL, + ThumbURL: video.ThumbURL, + URI: video.URI, + } +} + func OpenAPIItemErrorGroupDO2DTOs(dos []*entity.ItemErrorGroup) []*openapi_eval_set.ItemErrorGroup { if dos == nil { return nil diff --git a/backend/modules/evaluation/application/convertor/evaluation_set/openapi_test.go b/backend/modules/evaluation/application/convertor/evaluation_set/openapi_test.go index 0568a5031..371ad669c 100755 --- a/backend/modules/evaluation/application/convertor/evaluation_set/openapi_test.go +++ b/backend/modules/evaluation/application/convertor/evaluation_set/openapi_test.go @@ -533,6 +533,10 @@ func TestOpenAPIItemDOToDTOConversions(t *testing.T) { Format: &audioFormat, URL: &audioURL, }, + Video: &entity.Video{ + Name: &imageName, + URL: &imageURL, + }, } do := &entity.EvaluationSetItem{ @@ -570,6 +574,8 @@ func TestOpenAPIItemDOToDTOConversions(t *testing.T) { URL: &imageURL, ThumbURL: &thumbURL, }, + Audio: &common.Audio{Format: &audioFormat, URL: &audioURL}, + Video: &common.Video{Name: &imageName, URL: &imageURL}, MultiPart: []*common.Content{ { ContentType: ptr[common.ContentType](common.ContentTypeText),