swagger配置 数据库初始化结构调整
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package model
|
||||
package dbModel
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"main/init/mysql"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
@@ -19,3 +20,7 @@ type User struct {
|
||||
//type Propertie struct {
|
||||
// gorm.Model
|
||||
//}
|
||||
func (u *User) Create() (err error, user interface{}) {
|
||||
err = mysql.DEFAULTDB.Create(u).Error
|
||||
return err, user
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package model
|
||||
package modelInterface
|
||||
|
||||
// 因为我也不确定项目要不要多人维护 所以定义了CURD接口 凡是对数据库进行简单CURD操作 请实现此接口 默认首位返回 error
|
||||
type CURD interface {
|
||||
Reference in New Issue
Block a user