forked from goffee/todoapp
first commit
This commit is contained in:
parent
968575e907
commit
5d67da6b1c
32 changed files with 1319 additions and 0 deletions
16
models/todo.go
Normal file
16
models/todo.go
Normal 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
19
models/user.go
Normal 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"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue