niki/adapter/storage/action_piggy_bank_request.go

31 lines
945 B
Go

package storage
import (
storage "git.gocasts.ir/ebhomengo/niki/adapter/storage/models"
entitypiggybank "git.gocasts.ir/ebhomengo/niki/entity/piggy_bank"
)
func (d *DBMS) AddPiggyBank([]entitypiggybank.PiggyBank) error {
return nil
}
func (d *DBMS) EditPiggyBank(piggyID uint, piggyBankInput entitypiggybank.PiggyBank) error {
return nil
}
func (d *DBMS) DeletePiggyBank(piggyID uint) error {
return nil
}
func (d *DBMS) GetAllPiggyBank() ([]entitypiggybank.PiggyBank, error) {
var storeResponse []storage.PiggyBank
if err := d.db.Find(&storeResponse).Error; err != nil {
return nil, err
}
actionsEntities := make([]entitypiggybank.PiggyBank, len(storeResponse))
for i := range storeResponse {
actionsEntities[i] = storage.MapActionsStoreToEntity(storeResponse[i])
}
return actionsEntities, nil
}
func (d *DBMS) GetPiggyBankByID(piggyBankID uint) (entitypiggybank.PiggyBank, error) {
return entitypiggybank.PiggyBank{}, nil
}