package cn.com.poc.mineru;

import cn.com.poc.thirdparty.resource.minerU.MinerUResponse;
import cn.com.poc.thirdparty.resource.minerU.api.MinerUAPI;
import cn.com.yict.framemax.core.spring.SingleContextInitializer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import javax.annotation.Resource;
import java.io.File;

/**
 * @author alex.yao
 * @date 2025/10/30 23:46
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(initializers = SingleContextInitializer.class)
@WebAppConfiguration
public class MinerUTest {

    @Resource
    private MinerUAPI minerUAPI;

    @Test
    public void test_minerU() {
        File file = new File("C:\\Users\\Ayyy\\Desktop\\土地租赁合同2.pdf");
        MinerUResponse minerUResponse = new MinerUResponse();
        minerUResponse.setFiles(file);
        System.out.println(minerUAPI.parsePDF(minerUResponse).toString());

    }
}
