const system = require("../../../system");
const ServiceBase = require("../../svems.base")

class MerchantService extends ServiceBase {
    constructor() {
        super();
    }

    async merchantOfList(params) {
        try {
            return await this.callms("sve_merchant", "merchantOfList", params);
        } catch (error) {
            return system.getResult(null, `系统错误 错误信息 ${error}`);
        }
    }

    async merchantOfInfo(params) {
        try {
            return await this.callms("sve_merchant", "merchantOfInfo", params);
        } catch (error) {
            return system.getResult(null, `系统错误 错误信息 ${error}`);
        }
    }

    async addModifyMerchants(params) {
        try {
            return await this.callms("sve_merchant", "addModifyMerchants", params);
        } catch (error) {
            return system.getResult(null, `系统错误 错误信息 ${error}`);
        }
    }

    async merchantSuggest(params) {
        try {
            return await this.callms("sve_merchant", "merchantSuggest", params);
        } catch (error) {
            return system.getResult(null, `系统错误 错误信息 ${error}`);
        }
    }

    async auditMerchant(params) {
        try {
            return await this.callms("sve_merchant", "auditMerchant", params);
        } catch (error) {
            return system.getResult(null, `系统错误 错误信息 ${error}`);
        }
    }

    /**
     * fn:根据商户ID查询商户信息MAP
     * @returns {Promise<void>}
     */
    async merchantMapByIds(params){
        return await this.callms("sve_merchant", "merchantMapByIds", params);
    }
}

module.exports = MerchantService;
