master
Evan Chen 2021-12-24 23:23:58 +08:00
parent 9b3f3fcc62
commit d9232010fc
2 changed files with 2 additions and 0 deletions

View File

@ -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)
}

View File

@ -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
}