added wallet controller

This commit is contained in:
Fran Jurmanović
2021-05-15 22:23:44 +02:00
parent cc98d0cf49
commit a37386bb36
6 changed files with 148 additions and 1 deletions

16
pkg/models/wallets.go Normal file
View File

@@ -0,0 +1,16 @@
package models
type WalletModel struct {
tableName struct{} `pg:"wallets,alias:wallets"`
CommonModel
WalletTypeID string `json:"walletTypeId" pg:"wallet_type_id"`
WalletType *WalletTypeModel `json:"walletType" pg:"rel:has-one,fk:wallet_type_id"`
UserID string `json:"userId" pg:"user_id"`
User *UserReturnInfoModel `json:"user" pg:"rel:has-one,fk:user_id"`
}
type WalletTypeModel struct {
tableName struct{} `pg:"walletTypes,alias:walletTypes"`
CommonModel
Name string `json:"name"`
}