From d9232010fc544d7c5151426dab20c021eafc470b Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Fri, 24 Dec 2021 23:23:58 +0800 Subject: [PATCH] update --- calendar/api_cal.go | 1 + calendar/calendar.go | 1 + 2 files changed, 2 insertions(+) diff --git a/calendar/api_cal.go b/calendar/api_cal.go index 1ac2da4..1e4a92d 100644 --- a/calendar/api_cal.go +++ b/calendar/api_cal.go @@ -51,6 +51,7 @@ func ApiCalQuery(c *gin.Context) { func ApiCalNew(c *gin.Context) { cal := &Calendar{} + cal.Creator = c.GetString(auth.GinUserKey) if err := c.ShouldBindJSON(cal); err != nil { panic(err) } diff --git a/calendar/calendar.go b/calendar/calendar.go index b1ad079..40bb22b 100644 --- a/calendar/calendar.go +++ b/calendar/calendar.go @@ -28,6 +28,7 @@ type Calendar struct { GroupName string `gorm:"-" json:"Group"` GroupID uint `gorm:"index:idx_cal,unique" json:"-"` + Creator string CreatedAt time.Time UpdatedAt time.Time }