Setup boilerplate gorm , and admin part
This commit is contained in:
12
models/crudInterface.go
Normal file
12
models/crudInterface.go
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Created by VoidArtanis on 10/24/2017
|
||||
*/
|
||||
|
||||
package models
|
||||
|
||||
type SimpleCRUD interface {
|
||||
Create() (bool,error)
|
||||
Update()( bool,error)
|
||||
Delete() (bool,error)
|
||||
|
||||
}
|
||||
25
models/user.go
Normal file
25
models/user.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Created by desha on 10/24/2017
|
||||
*/
|
||||
|
||||
package models
|
||||
|
||||
import "github.com/jinzhu/gorm"
|
||||
|
||||
type User struct {
|
||||
gorm.Model
|
||||
Username string
|
||||
Password string
|
||||
Email string
|
||||
Avatar string
|
||||
}
|
||||
|
||||
func (this User)Update() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (this User)Create() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (this User)Delete() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
Reference in New Issue
Block a user