Fix: return userID to client
This commit is contained in:
@@ -16,6 +16,8 @@ func TestUserCreateHandler(t *testing.T) {
|
||||
body, _ := json.Marshal(createUserMsg{
|
||||
UserName: name,
|
||||
Password: "qwer123",
|
||||
Nickname: "Nick",
|
||||
Gender: datamodel.Female,
|
||||
})
|
||||
req, err := http.NewRequest("POST", "/register/", bytes.NewReader(body))
|
||||
if err != nil {
|
||||
|
||||
@@ -3,8 +3,16 @@ package datamodel
|
||||
import "github.com/jinzhu/gorm"
|
||||
import _ "github.com/jinzhu/gorm/dialects/postgres"
|
||||
|
||||
const (
|
||||
Female = iota
|
||||
Male
|
||||
)
|
||||
|
||||
type User struct {
|
||||
gorm.Model
|
||||
UserName string `gorm:"UNIQUE;Column:username"`
|
||||
Password string
|
||||
|
||||
NickName string
|
||||
Gender int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user