|
@@ -1,4 +1,5 @@
|
|
|
-using Hotline.Article;
|
|
|
+using Hotline.Application.Bulletin;
|
|
|
+using Hotline.Article;
|
|
|
using Hotline.Orders;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Share.Dtos;
|
|
@@ -23,14 +24,17 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly IOrderRepository _orderRepository;
|
|
|
private readonly IRepository<Bulletin> _bulletinRepository;
|
|
|
+ private readonly IBulletinApplication _bulletinApplication;
|
|
|
|
|
|
public DataSharingController(IMapper mapper,
|
|
|
IOrderRepository orderRepository,
|
|
|
- IRepository<Bulletin> bulletinRepository)
|
|
|
+ IRepository<Bulletin> bulletinRepository,
|
|
|
+ IBulletinApplication bulletinApplication)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_orderRepository = orderRepository;
|
|
|
_bulletinRepository = bulletinRepository;
|
|
|
+ _bulletinApplication = bulletinApplication;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -154,6 +158,10 @@ namespace Hotline.Api.Controllers
|
|
|
model.ReadedNum = model.ReadedNum++;
|
|
|
await _bulletinRepository.UpdateAsync(model, HttpContext.RequestAborted);
|
|
|
}
|
|
|
+
|
|
|
+ if (model != null && !string.IsNullOrEmpty(model.Content))
|
|
|
+ model.Content = _bulletinApplication.GetSiteUrls(model.Content);
|
|
|
+
|
|
|
return _mapper.Map<BulletinDto>(model);
|
|
|
}
|
|
|
|