package com.yaoyicloud.ai.pipeline.fc;

import java.util.List;
import java.util.stream.Collectors;

import com.aliyun.fc.runtime.Context;
import com.aliyun.fc.runtime.PojoRequestHandler;

public class MimicRealMsgHandler implements PojoRequestHandler<OssTestDataSet, TaskContentMsgs> {

	@Override
	public TaskContentMsgs handleRequest(OssTestDataSet request, Context context) {
		System.out.println("Fake the task msg with oss images");
		return new TaskContentMsgs(
			request.getOssFileList().stream()
				.map(ossFile -> new TaskContentMsgs.Message("appId1", "testTask1", "testUser1", List.of(ossFile)))
				.collect(Collectors.toList()),
			null);
	}

}
