Skip to content

Commit

Permalink
调整结构 #18
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchenglong11 committed Oct 21, 2017
1 parent 912ef61 commit 8dc5df9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 36 deletions.
5 changes: 5 additions & 0 deletions backend/models/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ type HandleNode struct {
Intro string `json:"intro" gorm:"column:intro"`
}

type PassedNode struct {
UID string `json:"uid" gorm:"column:uid" valid:"Required"`
NID string `json:"nid" gorm:"column:pid" valid:"Required"`
}

func (u Node) TableName() string {
return "node"
}
Expand Down
11 changes: 0 additions & 11 deletions backend/models/passnode.go

This file was deleted.

12 changes: 0 additions & 12 deletions backend/models/passquestion.go

This file was deleted.

6 changes: 6 additions & 0 deletions backend/models/question.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ type Question struct {
TestPath string `json:"testpath" gorm:"column:testpath" valid:"Required"`
PrepCode string `json:"prepcode gorm:"cllumn:"prepcode" valid:"Required"`
}

type PassedQuestion struct {
UID string `json:"uid" gorm:"column:uid" valid:"Required"`
QID string `json:"qid" gorm:"column:qid" valid:"Required"`
NID string `json:"nid" gorm:"column:nid" valid:"Required"`
}
12 changes: 12 additions & 0 deletions backend/models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ type User struct {
Status int `json:"status"`
}

type UserAddNode struct {
ID string `json:"id" gorm:"column:id" valid:"Required"`
PID string `json:"pid" gorm:"column:pid" valid:"Required"`
Title string `json:"title" gorm:"column:title" valid:"Required"`
Description string `json:"desc" gorm:"column:desc" valid:"Required"`
}

type Vote struct {
UID string `json:"uid" gorm:"column:uid" valid:"Required"`
NID string `json:"nid" gorm:"column:pid" valid:"Required"`
}

func (u User) TableName() string {
return "user"
}
Expand Down
13 changes: 0 additions & 13 deletions backend/models/useraddnode.go

This file was deleted.

0 comments on commit 8dc5df9

Please sign in to comment.