package org.matrix.autotest.controller;

import org.matrix.testNg.web.vo.DataBeansJobVo;
import org.matrix.testNg.web.vo.DataBeansVo;
import org.matrix.testNg.web.entity.ReportMessage;
import org.matrix.testNg.web.report.TestNgImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author MRY
 */
@RestController
@RequestMapping("/tests")
public class Controller {

    @Autowired
    private TestNgImpl testNg;

    @PostMapping("/test")
    public ReportMessage test(@RequestBody DataBeansVo dataBeansVo) {
        System.out.println(testNg.getReportUrl(dataBeansVo));
        return testNg.getReportUrl(dataBeansVo);
    }

    @PostMapping("/test1")
    public ReportMessage test1(@RequestBody DataBeansJobVo dataBeansJobVo) {
        System.out.println(testNg.getReporterUrls(dataBeansJobVo));
        return testNg.getReporterUrls(dataBeansJobVo);
    }


}
