From b37e49da3698a3c92b214931a23dcdb1ac41587c Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Thu, 28 Sep 2023 18:40:58 +0300 Subject: feat: improve logs and mod log endpoint (#55) Former-commit-id: 7f2d9100cc4bd78c27544909fe7215913d6a2dfe --- backend/handlers/logs.go | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'backend/handlers/logs.go') diff --git a/backend/handlers/logs.go b/backend/handlers/logs.go index 0a0b6be..23c4a39 100644 --- a/backend/handlers/logs.go +++ b/backend/handlers/logs.go @@ -25,13 +25,14 @@ const ( LogDescriptionUserUpdateCountrySuccess string = "UpdateCountrySuccess" LogDescriptionUserUpdateCountryFail string = "UpdateCountryFail" - LogDescriptionMapSummaryCreateSuccess string = "MapSummaryCreateSuccess" - LogDescriptionMapSummaryCreateFail string = "MapSummaryCreateFail" - LogDescriptionMapSummaryEditSuccess string = "MapSummaryEditSuccess" - LogDescriptionMapSummaryEditFail string = "MapSummaryEditFail" - LogDescriptionMapSummaryEditImage string = "MapSummaryEditImage" - LogDescriptionMapSummaryDeleteSuccess string = "MapSummaryDeleteSuccess" - LogDescriptionMapSummaryDeleteFail string = "MapSummaryDeleteFail" + LogDescriptionMapSummaryCreateSuccess string = "MapSummaryCreateSuccess" + LogDescriptionMapSummaryCreateFail string = "MapSummaryCreateFail" + LogDescriptionMapSummaryEditSuccess string = "MapSummaryEditSuccess" + LogDescriptionMapSummaryEditFail string = "MapSummaryEditFail" + LogDescriptionMapSummaryEditImageSuccess string = "MapSummaryEditImageSuccess" + LogDescriptionMapSummaryEditImageFail string = "MapSummaryEditImageFail" + LogDescriptionMapSummaryDeleteSuccess string = "MapSummaryDeleteSuccess" + LogDescriptionMapSummaryDeleteFail string = "MapSummaryDeleteFail" LogDescriptionCreateRecordSuccess string = "CreateRecordSuccess" LogDescriptionCreateRecordInsertRecordFail string = "InsertRecordFail" @@ -49,6 +50,7 @@ type Log struct { User models.UserShort `json:"user"` Type string `json:"type"` Description string `json:"description"` + Message string `json:"message"` Date time.Time `json:"date"` } @@ -57,9 +59,10 @@ type LogsResponse struct { } type LogsResponseDetails struct { - User models.UserShort `json:"user"` - Log string `json:"detail"` - Date time.Time `json:"date"` + User models.UserShort `json:"user"` + Log string `json:"detail"` + Message string `json:"message"` + Date time.Time `json:"date"` } type ScoreLogsResponse struct { @@ -112,8 +115,9 @@ func ModLogs(c *gin.Context) { SteamID: log.User.SteamID, UserName: log.User.UserName, }, - Log: detail, - Date: log.Date, + Log: detail, + Message: log.Message, + Date: log.Date, }) } c.JSON(http.StatusOK, models.Response{ -- cgit v1.2.3