rewrite using gin and gorm