Kaynağa Gözat

调试post cms

临城职教中职
liangkun 2 yıl önce
ebeveyn
işleme
26a0f71682
1 değiştirilmiş dosya ile 10 ekleme ve 2 silme
  1. +10
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs

+ 10
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsService.cs Dosyayı Görüntüle

@@ -202,11 +202,15 @@ namespace Learun.Application.OA

if (newEntity.IsSend == "1" && status == 2)
{
BaseRepository()
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'准备开始run task') ");
Task.Run(async () => { sendNew(newEntity); });
}
}
catch (Exception ex)
{
BaseRepository()
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'run task 报错"+ex.Message+"') ");
if (ex is ExceptionEx)
{
throw;
@@ -233,6 +237,8 @@ namespace Learun.Application.OA
string ports = ConfigurationManager.AppSettings["Ports"];

#endregion
BaseRepository()
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'准备开始组装实体') ");
SemdNewList SendNew = new SemdNewList
{
Title = newEntity.F_FullHead,
@@ -248,10 +254,12 @@ namespace Learun.Application.OA
{
{ "X-SS-API-KEY", ApiKey }
};
BaseRepository()
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'准备开始post cms') ");

string responses = HttpMethods.HttpPosts("http://" + ports + "/api/v1/contents/" + siteId + "/" + channelId, SendNew.ToJson(), ApiId);
BaseRepository()
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson),VALUES (newid(),'2222','"+responses+"') ");
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'"+HttpUtility.UrlEncode(responses)+"') ");

//#region 修改审核状态
//string Nid = JsonConvert.DeserializeObject<Root>(responses).value.id;
@@ -275,7 +283,7 @@ namespace Learun.Application.OA
catch (Exception ex)
{
BaseRepository()
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson),VALUES (newid(),'2222','"+ex.Message + "') ");
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'"+ex.Message + "') ");
}
}



Yükleniyor…
İptal
Kaydet