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{
|
||||
"message": "Dados inválidos"})
|
||||
}
|
||||
|
|
@ -124,6 +124,7 @@ func AddUser(c *fiber.Ctx) error {
|
|||
CompanyName: data["companyname"],
|
||||
Password: passwd,
|
||||
Channel: strings.ToLower(data["channel"]),
|
||||
CpfCnpj: data["cpfcnpj"],
|
||||
UserType: data["usertype"],
|
||||
Blocked: "N",
|
||||
Cancelled: "N",
|
||||
|
|
|
|||
|
|
@ -86,6 +86,8 @@ func ConnectDB() error {
|
|||
Email: "pcast@pcastive.com",
|
||||
CompanyName: "PCast",
|
||||
Password: passwd,
|
||||
Url: "https://pcastive.com",
|
||||
CpfCnpj: "49083957000138",
|
||||
Channel: "pcast",
|
||||
UserType: "A",
|
||||
Blocked: "N",
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ type User struct {
|
|||
Email string `gorm:"size:40;not null;unique" json:"email"`
|
||||
Password []byte `gorm:"size:100;not null;" json:"-"`
|
||||
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"`
|
||||
Plan string `gorm:"size:1;not null;default:1" json:"T"`
|
||||
Blocked string `gorm:"size:1;not null;default:N" json:"blocked"`
|
||||
|
|
|
|||
Loading…
Reference in New Issue