
package cn.orionsec.ops.handler.exporter;

import cn.orionsec.kit.lang.utils.convert.Converts;
import cn.orionsec.kit.spring.SpringHolder;
import cn.orionsec.ops.constant.ExportType;
import cn.orionsec.ops.dao.ApplicationProfileDAO;
import cn.orionsec.ops.entity.domain.ApplicationProfileDO;
import cn.orionsec.ops.entity.exporter.ApplicationProfileExportDTO;
import cn.orionsec.ops.entity.request.data.DataExportRequest;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

public class AppProfileDataExporter extends AbstractDataExporter<ApplicationProfileExportDTO> {

    private static final ApplicationProfileDAO applicationProfileDAO = SpringHolder.getBean(ApplicationProfileDAO.class);

    public AppProfileDataExporter(DataExportRequest request, HttpServletResponse response) {
        super(ExportType.APP_PROFILE, request, response);
    }

    @Override
    protected List<ApplicationProfileExportDTO> queryData() {
        // 查询数据
        List<ApplicationProfileDO> profileList = applicationProfileDAO.selectList(null);
        return Converts.toList(profileList, ApplicationProfileExportDTO.class);
    }

}
