fixed multipart form issue

This commit is contained in:
Fran Jurmanović
2021-06-05 00:10:23 +02:00
parent 1406c74e67
commit 636a367d3e
12 changed files with 66 additions and 35 deletions

View File

@@ -5,10 +5,14 @@ type Token struct {
}
type Login struct {
Email string
Password string
Email string `form:"email"`
Password string `form:"password"`
}
type Auth struct {
Id string
}
type CheckToken struct {
Valid bool `json:"valid"`
}

View File

@@ -3,10 +3,10 @@ package models
type User struct {
tableName struct{} `pg:"users,alias:users"`
BaseModel
IsActive bool `json:"isActive" pg:"is_active"`
Username string `json:"username" pg:"username"`
Password string `json:"password" pg:"password"`
Email string `json:"email" pg:"email"`
IsActive bool `json:"isActive" pg:"is_active" form:"isActive"`
Username string `json:"username" pg:"username" form:"username"`
Password string `json:"password" pg:"password" form:"password"`
Email string `json:"email" pg:"email" form:"email"`
}
type UserReturnInfo struct {

View File

@@ -8,6 +8,6 @@ type TransactionType struct {
}
type NewTransactionTypeBody struct {
Name string `json:"name"`
Type string `json:"type"`
Name string `json:"name" form:"name"`
Type string `json:"type" form:"type"`
}

View File

@@ -15,8 +15,8 @@ type Transaction struct {
}
type NewTransactionBody struct {
WalletID string `json:"walletId"`
TransactionTypeID string `json:"transactionTypeId"`
TransactionDate time.Time `json:"transactionDate"`
Description string `json:"description"`
WalletID string `json:"walletId" form:"walletId"`
TransactionTypeID string `json:"transactionTypeId" form:"transactionTypeId"`
TransactionDate time.Time `json:"transactionDate" form:"transactionDate"`
Description string `json:"description" form:"description"`
}

View File

@@ -9,6 +9,6 @@ type Wallet struct {
}
type NewWalletBody struct {
Name string `json:"name"`
UserID string `json:"userId"`
Name string `json:"name" form:"name"`
UserID string `json:"userId" form:"userId"`
}