Пример #1
0
        public static string GetPicUrl(string productId, string messageType)
        {
            AppConnectLogHelper.DebugFormat("发消息图片地址:{0}", imgUrlFormat);
            string picUrl = "";

            if (string.IsNullOrEmpty(messageType))
            {
                AppConnectLogHelper.Error("获取消息图片产品Id为空!");
                return(picUrl);
            }
            string imgName = "italent_massage_03"; //默认是微信

            if (messageType == "21")               //如果是钉钉
            {
                imgName = "italent_massage_04";
            }
            switch (productId)
            {
            //审批中心
            case "907": picUrl = string.Format(imgUrlFormat, imgName); break;

            //核心人力
            case "908": picUrl = string.Format(imgUrlFormat, imgName); break;

            //假勤
            case "909": picUrl = string.Format(imgUrlFormat, imgName); break;

            //薪酬
            case "960": picUrl = string.Format(imgUrlFormat, imgName); break;

            default: picUrl = string.Format(imgUrlFormat, imgName); break;
            }
            return(picUrl);
        }
 public static string GetSginV2(int tenantId, int userId, int titaAppId, long timeStamp, int signType = 1)
 {
     try
     {
         //调用tita获取sign信息
         string requestUrl = string.Format("{0}/api/v1/{1}/{2}/sign?app_id={3}&time_stamp={4}&sign_type={5}", TitaApiUrl, tenantId, userId, titaAppId, timeStamp, signType);
         AppConnectLogHelper.DebugFormat("GetSginV2-Url:{0}", requestUrl);
         string resultStr   = HttpClientHelper.HttpGet(requestUrl);
         var    resultModel = Newtonsoft.Json.JsonConvert.DeserializeObject <ApiResultModel>(resultStr);
         if (resultModel.Code != 0)
         {
             AppConnectLogHelper.Error("GetSginV2-获取数据api失败");
             return(string.Empty);
         }
         return(resultModel.Data.ObjData);
     }
     catch (Exception ex)
     {
         AppConnectLogHelper.ErrorFormat("GetSginV2-获取数据api异常:{0}", ex.Message);
         return(string.Empty);
     }
 }