-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_add.go
55 lines (52 loc) · 1.59 KB
/
init_add.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package generator
import (
"fmt"
adddomain "github.com/ar-mokhtari/orginfo-generator/add_domain"
deletedomain "github.com/ar-mokhtari/orginfo-generator/delete_domain"
"github.com/ar-mokhtari/orginfo-generator/entity"
"github.com/ar-mokhtari/orginfo-generator/env"
)
func addInit(input entity.Domain) {
//📛delete entry domain(s) if exist
deleteDomainErr := deletedomain.DeleteDomain(input)
if deleteDomainErr != nil {
fmt.Println(deleteDomainErr)
} else {
fmt.Println("Domain(s) deleted except `user` and `temp` ")
}
//dto
dtoErr := adddomain.DomainDTOGenerator(input)
if dtoErr != nil {
fmt.Println(dtoErr)
} else {
fmt.Printf("%s Domain for %s created successfully \n", input.SnakeName, env.DTO)
}
//adapter
adapterStorageErr := adddomain.DomainStorageGenerator(input)
if adapterStorageErr != nil {
fmt.Println(adapterStorageErr)
} else {
fmt.Printf("%s Domain for %s created successfully \n", input.SnakeName, env.Adapter+" -storage")
}
//delivery
deliveryErr := adddomain.DomainDeliveryGenerator(input)
if deliveryErr != nil {
fmt.Println(deliveryErr)
} else {
fmt.Printf("%s Domain for %s created successfully \n", input.SnakeName, env.Delivery)
}
//entity
entityErr := adddomain.DomainEntityGenerator(input)
if entityErr != nil {
fmt.Println(dtoErr)
} else {
fmt.Printf("%s Domain for %s created successfully \n", input.SnakeName, env.Entity)
}
//usecase
usecaseErr := adddomain.DomainUsecaseGenerator(input)
if usecaseErr != nil {
fmt.Println(usecaseErr)
} else {
fmt.Printf("%s Domain for %s created successfully \n", input.SnakeName, env.Usecase)
}
}