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 }