Change db.Card.Value to db.Card.Balance and types.DbCard.Value to types.DbCard.Balance
This commit is contained in:
parent
340b39c35e
commit
de7926337a
|
@ -10,7 +10,7 @@ import (
|
|||
type Card struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
Value uint64
|
||||
Balance uint64
|
||||
HaveCreditLine bool
|
||||
CreditLine uint64
|
||||
UserID uint
|
||||
|
|
|
@ -24,7 +24,7 @@ func CardGetId(c *gin.Context) {
|
|||
return types.DbCard{
|
||||
ID: inp.ID,
|
||||
Name: inp.Name,
|
||||
Value: inp.Value,
|
||||
Balance: inp.Balance,
|
||||
HaveCreditLine: inp.HaveCreditLine,
|
||||
CreditLine: inp.CreditLine,
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ func CardAdd(c *gin.Context) {
|
|||
card := &db.Card{}
|
||||
CreateHandler(card, func(src types.DbCard, dst *db.Card) {
|
||||
dst.Name = src.Name
|
||||
dst.Value = src.Value
|
||||
dst.Balance = src.Balance
|
||||
dst.HaveCreditLine = src.HaveCreditLine
|
||||
dst.CreditLine = src.CreditLine
|
||||
})(c)
|
||||
|
@ -72,7 +72,7 @@ func CardPutId(c *gin.Context) {
|
|||
// Filter used to apply only needed changes from srt to dst before updating dst
|
||||
func(src types.DbCard, dst *db.Card) {
|
||||
dst.Name = src.Name
|
||||
dst.Value = src.Value
|
||||
dst.Balance = src.Balance
|
||||
dst.CreditLine = src.CreditLine
|
||||
dst.HaveCreditLine = src.HaveCreditLine
|
||||
},
|
||||
|
@ -80,7 +80,7 @@ func CardPutId(c *gin.Context) {
|
|||
return types.DbCard{
|
||||
ID: inp.ID,
|
||||
Name: inp.Name,
|
||||
Value: inp.Value,
|
||||
Balance: inp.Balance,
|
||||
HaveCreditLine: inp.HaveCreditLine,
|
||||
CreditLine: inp.CreditLine,
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ type ErrorResponse struct {
|
|||
type DbCard struct {
|
||||
ID uint `json:"id" example:"1"`
|
||||
Name string `json:"name" example:"CreditCard"`
|
||||
Value uint64 `json:"value" example:"1000"`
|
||||
Balance uint64 `json:"balance" example:"1000"`
|
||||
HaveCreditLine bool `json:"have_credit_line" example:"true"`
|
||||
CreditLine uint64 `json:"credit_line" example:"500000"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user