Skip to content
Snippets Groups Projects
Commit 40eda79b authored by Nikoline Vistoft Bartholin's avatar Nikoline Vistoft Bartholin
Browse files

Ændringer i Logservice, logentry

parent 43b1ba93
No related branches found
No related tags found
No related merge requests found
......@@ -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; }
......
......@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace assignment1.Models
namespace assignment2.Models
{
public class LogInfo
{
......
using MongoDB.Bson.Serialization.Attributes;
namespace assignment1.Models
namespace assignment2.Models
{
[BsonIgnoreExtraElements]
public class LogProperties
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment