项目基本构成
This commit is contained in:
9
QMPlusServer/model/interface.go
Normal file
9
QMPlusServer/model/interface.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package model
|
||||
|
||||
// 因为我也不确定项目要不要多人维护 所以定义了CURD接口 凡是对数据库进行简单CURD操作 请实现此接口 默认首位返回 error
|
||||
type CURD interface {
|
||||
Create() (error, interface{})
|
||||
Updata() (error, interface{})
|
||||
Read() (error, interface{})
|
||||
Delete() (error, interface{})
|
||||
}
|
21
QMPlusServer/model/user.go
Normal file
21
QMPlusServer/model/user.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
gorm.Model `json:"-"`
|
||||
UUID uuid.UUID `json:"uuid"`
|
||||
UserName string `json:"userName"`
|
||||
PassWord string `json:"passWord"`
|
||||
NickName string `json:"nickName" gorm:"default:'galeone'"`
|
||||
HeaderImg string `json:"headerImg" gorm:"default:'galeone'"`
|
||||
//Propertie // 多余属性自行添加
|
||||
//PropertieId uint // 自动关联 Propertie 的Id 附加属性过多 建议创建一对一关系
|
||||
}
|
||||
|
||||
//type Propertie struct {
|
||||
// gorm.Model
|
||||
//}
|
Reference in New Issue
Block a user