package com.glxp.mipsdl.service.thrsys;

import com.glxp.mipsdl.config.ThirdSysConfig;
import com.glxp.mipsdl.dao.thrsys.ThrSystemDetailDao;
import com.glxp.mipsdl.entity.thrsys.ThrSystemDetailEntity;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 第三方系统接口地址Service
 */
@Service
public class ThrSystemDetailService {

    @Resource
    private ThirdSysConfig thirdSysConfig;
    @Resource
    private ThrSystemDetailDao thrSystemDetailDao;

    /**
     * 查询接口url
     *
     * @param urlName url名称
     * @return
     */
    public String getUrl(String urlName) {
        ThrSystemDetailEntity thrSystemDetailEntity = thrSystemDetailDao.selectByKey(urlName, thirdSysConfig.getThirdId());
        return thirdSysConfig.getThirdSysConfig().getThirdSysUrl() + thrSystemDetailEntity.getValue();
    }

    public String getUrlExclude(String urlName) {
        return thirdSysConfig.getThirdSysConfig().getThirdSysUrl();
    }

}
