package com.caimei.www.service.page.impl;

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

import javax.annotation.Resource;

/**
 * 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;
    }

}
