package com.iotechn.unimall.core.util;

import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;

import java.util.*;
public class NoticeUtil {
    public static void notice(String content,String mobile){
        String appcode = "2d59bfa794994f5f94d1d98b7b5bd102";
        //API产品路径
        String requestUrl = "https://personcard.market.alicloudapi.com/ai_market/ai_ocr_universal/shen_fen_zheng/ch/v1";
        String host = "https://yytz.market.alicloudapi.com";
        String path = "/chuangxin/yytz";
        String method = "GET";
        Map<String, String> headers = new HashMap<String, String>();
        headers.put("Authorization", "APPCODE " + appcode);
        Map<String, String> querys = new HashMap<String, String>();
        querys.put("content", "您好，您有新的"+content+"，请及时查看。");
        querys.put("mobile", mobile);
        try {
            HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);
            System.out.println(response.toString());
            //获取response的body
            System.out.println(EntityUtils.toString(response.getEntity()));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
