replace amount from pj
This commit is contained in:
parent
71fd522c46
commit
bd2e1372f4
@ -9,7 +9,6 @@ type Privilege struct {
|
||||
ID primitive.ObjectID `bson:"_id"`
|
||||
Name string `bson:"name"`
|
||||
PrivilegeID string `bson:"privilegeId"`
|
||||
Amount int `bson:"amount"`
|
||||
ServiceKey string `bson:"serviceKey"`
|
||||
Description string `bson:"description"`
|
||||
Type string `bson:"type"`
|
||||
|
@ -8,7 +8,6 @@ type CreateUpdateReq struct {
|
||||
Type string `json:"type"`
|
||||
Value string `json:"value"`
|
||||
Price float64 `json:"price"`
|
||||
Amount int `json:"amount"`
|
||||
}
|
||||
|
||||
type ManyCreateUpdate struct {
|
||||
|
@ -68,8 +68,6 @@ func (p *Privilege) Create(ctx context.Context, req *models.CreateUpdateReq) (*m
|
||||
Type: req.Type,
|
||||
Value: req.Value,
|
||||
Price: req.Price,
|
||||
// amount в хабе не вставляется
|
||||
Amount: req.Amount,
|
||||
CreatedAt: time.Now(),
|
||||
IsDeleted: false,
|
||||
}
|
||||
@ -102,8 +100,6 @@ func (p *Privilege) Update(ctx context.Context, req *models.CreateUpdateReq) (*m
|
||||
"value": req.Value,
|
||||
"price": req.Price,
|
||||
"updatedAt": time.Now(),
|
||||
// amount в хабе не вставляется
|
||||
"amount": req.Amount,
|
||||
},
|
||||
}
|
||||
|
||||
@ -120,7 +116,6 @@ func (p *Privilege) Update(ctx context.Context, req *models.CreateUpdateReq) (*m
|
||||
exist.Value = req.Value
|
||||
exist.Price = req.Price
|
||||
exist.UpdatedAt = time.Now()
|
||||
exist.Amount = req.Amount
|
||||
|
||||
return exist, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user