var APIBase = require("../../api.base");
var system = require("../../../system");
class TaxApi extends APIBase {
    constructor() {
        super();
        this.tcompanytaxocrSve = system.getObject("service.tax.tcompanytaxocrSve");
        this.tcompanytaxitemSve = system.getObject("service.tax.tcompanytaxitemSve");
    }

    async test(pobj, query, req) {
        return system.getResultSuccess(1);
    }

    async taxocrSend(pobj, query, req) {
        await this.tcompanytaxocrSve.sendImg(pobj.limit || 100);
        return system.getResultSuccess();
    }
    async taxocrallback(pobj, query, req) {
        
        try {
           return await this.tcompanytaxitemSve.saveOcrItems(pobj);
        } catch (error) {
            console.log(error);
            return system.getResult(null, "api异常");
        }
    }
}
module.exports = TaxApi;