1
0
Fork 0
forked from goffee/todoapp

first commit

This commit is contained in:
Zeni Kim 2024-09-15 13:36:50 -05:00
parent 968575e907
commit 5d67da6b1c
32 changed files with 1319 additions and 0 deletions

16
models/todo.go Normal file
View file

@ -0,0 +1,16 @@
package models
import "gorm.io/gorm"
type Todo struct {
gorm.Model
Title string
Body string
IsDone bool
// add your field here...
}
// Override the table name
func (Todo) TableName() string {
return "todos"
}

19
models/user.go Normal file
View file

@ -0,0 +1,19 @@
// Copyright 2023 Harran Ali <harran.m@gmail.com>. All rights reserved.
// Use of this source code is governed by MIT-style
// license that can be found in the LICENSE file.
package models
import "gorm.io/gorm"
type User struct {
gorm.Model
Name string
Email string
Password string
}
// Override the table name
func (User) TableName() string {
return "users"
}