Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bad1/assignment2
1 result
Show changes
Commits on Source (2)
......@@ -16,6 +16,7 @@ namespace assignment2.Controllers
private readonly ILogService _logsService;
public LogController(ILogService logsService) => _logsService = logsService;
//[Authorize(Roles = "Admin")]
[HttpGet]
public async Task<IActionResult> GetAsync(string? user, string? operation, DateTime? startDate, DateTime? endTime)
{
......
......@@ -8,6 +8,6 @@ namespace assignment2.Interfaces
{
public interface ILogService
{
Task<IEnumerable<Log>> GetAsync(string? user, string? operation, DateTime? startDate, DateTime? endTime);
Task<IEnumerable<LogEntry>> GetAsync(string? user, string? operation, DateTime? startDate, DateTime? endTime);
}
}
\ No newline at end of file
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace assignment1.Models
namespace assignment2.Models
{
[BsonIgnoreExtraElements]
public class LogEntry
......@@ -12,6 +12,9 @@ namespace assignment1.Models
[BsonElement("Level")]
public int Level { get; set; }
[BsonElement("UtcTimeStamp")]
public DateTime UtcTimeStamp { get; set; }
[BsonElement("Properties")]
public required LogProperties Properties { get; set; }
......
......@@ -4,7 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using MongoDB.Bson.Serialization.Attributes;
namespace assignment1.Models
namespace assignment2.Models
{
public class LogInfo
{
......
using MongoDB.Bson.Serialization.Attributes;
namespace assignment1.Models
namespace assignment2.Models
{
[BsonIgnoreExtraElements]
public class LogProperties
......