var clfdCommonService = (function () {
    return {}
}());

clfdCommonService.prodListApiRequest = function (cbOption, searchOption) {
    $.ajax({
        url: "/clfd/prod/list.json?" + $.now(),
        data: searchOption,
        type: "GET",
        success: function (res) {
            if (res.result === "success") {
                if (cbOption && cbOption.scb) {
                    cbOption.scb(res);
                }
            } else {
                if (cbOption && cbOption.ecb) {
                    cbOption.ecb(res);
                }
            }
        }
    });
}

clfdCommonService.recommendProdList = function (cbOption, searchOption) {
    $.ajax({
        url: "/clfd/recommend/prod/list.json?" + $.now(),
        data: searchOption,
        type: "GET",
        success: function (res) {
            if (res.result === "success") {
                try {
                    if (cbOption && cbOption.scb) {
                        cbOption.scb(res.recommendList, res.productGbn);
                    }
                } catch (e) {
                    if (cbOption && cbOption.ecb) {
                        cbOption.ecb(res);
                    }
                }
            } else {
                if (cbOption && cbOption.ecb) {
                    cbOption.ecb(res);
                }
            }
        }
    });
};