added cpf/cnpj and url on user's data
parent
e2f8970e6c
commit
87b41f4a88
|
|
@ -95,7 +95,7 @@ func AddUser(c *fiber.Ctx) error {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if data["name"] == "" || data["email"] == "" || data["password"] == "" || data["channel"] == "" || data["usertype"] == "" || data["companyname"] == "" {
|
if data["name"] == "" || data["email"] == "" || data["url"] == "" || data["cpfcnpj"] == "" || data["password"] == "" || data["channel"] == "" || data["usertype"] == "" || data["companyname"] == "" {
|
||||||
return c.JSON(fiber.Map{
|
return c.JSON(fiber.Map{
|
||||||
"message": "Dados inválidos"})
|
"message": "Dados inválidos"})
|
||||||
}
|
}
|
||||||
|
|
@ -124,6 +124,7 @@ func AddUser(c *fiber.Ctx) error {
|
||||||
CompanyName: data["companyname"],
|
CompanyName: data["companyname"],
|
||||||
Password: passwd,
|
Password: passwd,
|
||||||
Channel: strings.ToLower(data["channel"]),
|
Channel: strings.ToLower(data["channel"]),
|
||||||
|
CpfCnpj: data["cpfcnpj"],
|
||||||
UserType: data["usertype"],
|
UserType: data["usertype"],
|
||||||
Blocked: "N",
|
Blocked: "N",
|
||||||
Cancelled: "N",
|
Cancelled: "N",
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,8 @@ func ConnectDB() error {
|
||||||
Email: "pcast@pcastive.com",
|
Email: "pcast@pcastive.com",
|
||||||
CompanyName: "PCast",
|
CompanyName: "PCast",
|
||||||
Password: passwd,
|
Password: passwd,
|
||||||
|
Url: "https://pcastive.com",
|
||||||
|
CpfCnpj: "49083957000138",
|
||||||
Channel: "pcast",
|
Channel: "pcast",
|
||||||
UserType: "A",
|
UserType: "A",
|
||||||
Blocked: "N",
|
Blocked: "N",
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ type User struct {
|
||||||
Email string `gorm:"size:40;not null;unique" json:"email"`
|
Email string `gorm:"size:40;not null;unique" json:"email"`
|
||||||
Password []byte `gorm:"size:100;not null;" json:"-"`
|
Password []byte `gorm:"size:100;not null;" json:"-"`
|
||||||
Channel string `gorm:"size:40;not null" json:"channel"`
|
Channel string `gorm:"size:40;not null" json:"channel"`
|
||||||
|
Url string `gorm:"size:40;not null" json:"url"`
|
||||||
|
CpfCnpj string `gorm:"size:14;not null" json:"cpfcnpj"`
|
||||||
UserType string `gorm:"size:1;not null;default:U" json:"usertype"`
|
UserType string `gorm:"size:1;not null;default:U" json:"usertype"`
|
||||||
Plan string `gorm:"size:1;not null;default:1" json:"T"`
|
Plan string `gorm:"size:1;not null;default:1" json:"T"`
|
||||||
Blocked string `gorm:"size:1;not null;default:N" json:"blocked"`
|
Blocked string `gorm:"size:1;not null;default:N" json:"blocked"`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue