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 ...@@ -16,6 +16,7 @@ namespace assignment2.Controllers
private readonly ILogService _logsService; private readonly ILogService _logsService;
public LogController(ILogService logsService) => _logsService = logsService; public LogController(ILogService logsService) => _logsService = logsService;
//[Authorize(Roles = "Admin")]
[HttpGet] [HttpGet]
public async Task<IActionResult> GetAsync(string? user, string? operation, DateTime? startDate, DateTime? endTime) public async Task<IActionResult> GetAsync(string? user, string? operation, DateTime? startDate, DateTime? endTime)
{ {
......
...@@ -8,6 +8,6 @@ namespace assignment2.Interfaces ...@@ -8,6 +8,6 @@ namespace assignment2.Interfaces
{ {
public interface ILogService 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;
using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Attributes;
namespace assignment1.Models namespace assignment2.Models
{ {
[BsonIgnoreExtraElements] [BsonIgnoreExtraElements]
public class LogEntry public class LogEntry
...@@ -12,6 +12,9 @@ namespace assignment1.Models ...@@ -12,6 +12,9 @@ namespace assignment1.Models
[BsonElement("Level")] [BsonElement("Level")]
public int Level { get; set; } public int Level { get; set; }
[BsonElement("UtcTimeStamp")]
public DateTime UtcTimeStamp { get; set; }
[BsonElement("Properties")] [BsonElement("Properties")]
public required LogProperties Properties { get; set; } public required LogProperties Properties { get; set; }
......
...@@ -4,7 +4,7 @@ using System.Linq; ...@@ -4,7 +4,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Attributes;
namespace assignment1.Models namespace assignment2.Models
{ {
public class LogInfo public class LogInfo
{ {
......
using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Attributes;
namespace assignment1.Models namespace assignment2.Models
{ {
[BsonIgnoreExtraElements] [BsonIgnoreExtraElements]
public class LogProperties public class LogProperties
......