package cn.superdesk.uniorder.common.security;

import cn.superdesk.uniorder.common.exception.constants.ExceptionMsg;
import cn.superdesk.uniorder.common.exception.UnifiedOrderRuntimeException;
import cn.superdesk.uniorder.common.security.crypt.rsa.SignTools;
import cn.superdesk.uniorder.common.HttpClientUtils;

import java.util.HashMap;

public class GetProjectUtil {

	public static String GetProject(String phone, String url) {

		String sign = null;
		try {
			sign = SignTools.makeSign(phone);
		} catch (Exception e) {
			throw new UnifiedOrderRuntimeException(ExceptionMsg.SIGN_CREATE_ERROR);
		}
		HashMap<String, String> map = new HashMap<>();
		map.put("sign", sign);
		map.put("phone", phone);

		return HttpClientUtils.doPost(url, map);
	}

}
