21 lines
453 B
Go
21 lines
453 B
Go
package modifier
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
|
|
e "simrs-vx/internal/domain/main-entities/single"
|
|
)
|
|
|
|
// a sampel of modifying some input
|
|
func ModifInput(input *e.Createdto, data *e.Single, tx *gorm.DB) error {
|
|
input.Name = "Prefix_" + input.Name
|
|
return nil
|
|
}
|
|
|
|
// a sampel of utilizing transaction
|
|
func CheckData(input *e.Createdto, data *e.Single, tx *gorm.DB) error {
|
|
tx.Where("Name = ?", input.Name)
|
|
input.Name = "Prefix_" + input.Name
|
|
return nil
|
|
}
|