|
@@ -94,55 +94,27 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// Remove HTML from string with Regex.
|
|
|
|
|
|
+ /// 公告详情
|
|
/// </summary>
|
|
/// </summary>
|
|
- private static string StripTagsRegex(string source)
|
|
|
|
- {
|
|
|
|
- return Regex.Replace(source, "<.*?>", string.Empty);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Compiled regular expression for performance.
|
|
|
|
- /// </summary>
|
|
|
|
- static Regex _htmlRegex = new Regex("<.*?>", RegexOptions.Compiled);
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Remove HTML from string with compiled Regex.
|
|
|
|
- /// </summary>
|
|
|
|
- private static string StripTagsRegexCompiled(string source)
|
|
|
|
- {
|
|
|
|
- return _htmlRegex.Replace(source, string.Empty);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Remove HTML tags from string using char array.
|
|
|
|
- /// </summary>
|
|
|
|
- private static string StripTagsCharArray(string source)
|
|
|
|
|
|
+ /// <param name="id"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpGet]
|
|
|
|
+ [NoOprationLog]
|
|
|
|
+ public async Task<NoticeDetailOutput> GetDetailAsync(long id = 0)
|
|
{
|
|
{
|
|
- char[] array = new char[source.Length];
|
|
|
|
- int arrayIndex = 0;
|
|
|
|
- bool inside = false;
|
|
|
|
-
|
|
|
|
- for (int i = 0; i < source.Length; i++)
|
|
|
|
|
|
+ if(id == 0)
|
|
{
|
|
{
|
|
- char let = source[i];
|
|
|
|
- if (let == '<')
|
|
|
|
- {
|
|
|
|
- inside = true;
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- if (let == '>')
|
|
|
|
- {
|
|
|
|
- inside = false;
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- if (!inside)
|
|
|
|
- {
|
|
|
|
- array[arrayIndex] = let;
|
|
|
|
- arrayIndex++;
|
|
|
|
- }
|
|
|
|
|
|
+ throw ResultOutput.Exception("ID不可为空");
|
|
}
|
|
}
|
|
- return new string(array, 0, arrayIndex);
|
|
|
|
|
|
+
|
|
|
|
+ var noticeDetail = await _noticeRepository.Select.DisableGlobalFilter(FilterNames.Tenant).FirstAsync(a => new NoticeDetailOutput() {
|
|
|
|
+ Id = a.Id,
|
|
|
|
+ Title = a.Title,
|
|
|
|
+ Content = a.Content,
|
|
|
|
+ CreateTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", a.CreatedTime),
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ return noticeDetail;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|