var system = require("../../../system")
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base");
var cacheBaseComp = null;

class FormInfoCtl extends CtlBase {
    constructor() {
        super("formmag", CtlBase.getServiceName(FormInfoCtl));
        this.forminfoSve = system.getObject('service.configmag.forminfoSve');
    }

    /**
     * 重写查询方法
     * @param pobj
     * @returns {Promise<{msg: string, data: *, bizmsg: string, status: number}>}
     */
    async findAndCountAll(pobj) {
        let result = await this.forminfoSve.findByCompanyId(pobj);
        return result;
    }

    /**
     * 重写保存方法
     * @param pobj
     * @returns {Promise<void>}
     */
    async create(pobj){
        let result =  await this.forminfoSve.createForm(pobj);
        return result;
    }

    /**
     * 重写添加方法
     * @param pobj
     * @returns {Promise<void>}
     */
    async update(pobj) {
        let result = await this.forminfoSve.updateForm(pobj);
        return result;
    }

}

module.exports = FormInfoCtl;
