package com.persagy.proxy.migration.service;

import com.persagy.dmp.basic.model.QueryCriteria;
import com.persagy.dmp.rwd.migrate.entity.SyncData;
import com.persagy.proxy.common.entity.InstanceUrlParam;
import com.persagy.proxy.migration.model.DataMigrationExcel;
import com.persagy.proxy.migration.model.DataMigrationResponse;
import com.persagy.proxy.migration.model.MigrationInfo;

import java.util.Collection;
import java.util.List;

/**
 * @author lvxianyun
 * @title: DefineTypeMigrationService
 * @projectName adm-middleware
 * @description:
 * @date 2021/12/8 10:45
 */
public interface IDataMigrationProcess<T> {
    /**
     * 获取adm交付的数据，默认获取有效数据
     * @param context
     * @return
     */
    List getAdmData(InstanceUrlParam context, QueryCriteria queryCriteria);

    /**
     * 拼接访问链接
     * @param context
     * @param migrationInfo
     * @param type
     * @return
     */
    String requestUrl(InstanceUrlParam context, MigrationInfo migrationInfo, String type);

    /**
     * 将目标集合处理成excel格式的集合  使用与insert/delete
     * @param list
     * @param type insert/delete
     * @return
     */
    List<DataMigrationExcel> processDataForExcel(Collection list, String type);

    /**
     * 将目标集合处理成SyncData(日志)格式的集合  入库
     * @param dataMigrationResponse
     * @param type insert/delete
     * @return
     */
    List<SyncData> processDataForLog(DataMigrationResponse dataMigrationResponse, String type);


}
