package com.gic.haoban.manage.web.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * @author yao
 * NationCodePhoneFormater
 */
public class NationCodePhoneFormater {

    /**
     * 大陆手机号码
     */
    public static final String CHINA = "86";

    public static String format(String nationCode, String phone) {
        if (CHINA.equals(nationCode)) {
            return phone;
        }

        if (StringUtils.isBlank(phone)){
            return "";
        }

        return StringUtils.isBlank(nationCode)? phone:  ("+" + nationCode + "-" + phone);
    }
}
