package com.caimei.www.service.impl;

import com.caimei.www.mapper.SupplierDao;
import com.caimei.www.pojo.JsonModel;
import com.caimei.www.pojo.page.ProductList;
import com.caimei.www.pojo.page.SupplierDetail;
import com.caimei.www.service.SupplierService;
import com.caimei.www.utils.ImageUtil;
import com.caimei.www.utils.PriceUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Description
 *
 * @author : Charles
 * @date : 2020/7/22
 */
@Slf4j
@Service
public class SupplierServiceImpl implements SupplierService {
    @Value("${caimei.wwwDomain}")
    private String domain;
    @Resource
    private SupplierDao supplierDao;

    /**
     * 供应商详情
     *
     * @param supplierId
     * @return
     */
    @Override
    public SupplierDetail getSupplierById(Integer supplierId) {
        SupplierDetail supplier = supplierDao.getSupplierById(supplierId);
        String[] businessScope = supplier.getBusinessScope().split("/");
        supplier.setBusinessScopeArr(businessScope);
        return supplier;
    }

}
