src/ZKEACMS.Message/Service/CommentsWidgetService.cs
(完整代码) 1KB/* http://www.zkea.net/
* Copyright (c) ZKEASOFT. All rights reserved.
* http://www.zkea.net/licenses */
using Easy;
using Easy.Constant;
using Microsoft.AspNetCore.Mvc;
using ZKEACMS.Message.Models;
using ZKEACMS.Widget;
namespace ZKEACMS.Message.Service
{
public class CommentsWidgetService : SimpleWidgetService<CommentsWidget>
{
private readonly ICommentsService _commentsService;
public CommentsWidgetService(IWidgetBasePartService widgetBasePartService, IApplicationContext applicationContext, CMSDbContext dbContext, ICommentsService commentsService) : base(widgetBasePartService, applicationContext, dbContext)
{
_commentsService = commentsService;
}
public override object Display(WidgetDisplayContext widgetDisplayContext)
{
var actionContext = widgetDisplayContext.ActionContext;
var comments = _commentsService.Get(m => m.PagePath == actionContext.HttpContext.Request.Path.Value && m.Status == (int)RecordStatus.Active);
return comments;
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。