Skip to content

Commit

Permalink
fix: rest in controller/http dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidayat Hamir committed Feb 6, 2024
1 parent d0b1bcd commit 4ed4984
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ go install github.com/spacetronot-research-team/erago@latest
or you can define your prefered version.

```shell
go install github.com/spacetronot-research-team/erago@v0.0.7
go install github.com/spacetronot-research-team/erago@v0.0.8
```

Or you can download erago binary from release page.
Or you can download erago binary from [release page](https://github.com/spacetronot-research-team/erago/releases).

You can check your version by running.

Expand All @@ -55,7 +55,9 @@ New project will be created in directory `go-customer`.
cd go-customer && erago create-domain profile
```

New domain will be created in directory `go-customer/internal`.
New domain will be created in directory `internal/controller/http/`.
New domain will be created in directory `internal/service/`.
New domain will be created in directory `internal/repository/`.

## Docs

Expand Down
2 changes: 1 addition & 1 deletion cmd/createdomain/create_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func generateControllerTemplate(domain string, moduleName string) error {
return fmt.Errorf("err get controller template: %v", err)
}

path := filepath.Join("internal", "controller", strcase.ToSnake(domain)+".go")
path := filepath.Join("internal", "controller", "http", strcase.ToSnake(domain)+".go")
err = os.WriteFile(path, []byte(controllerTemplate), 0666)
if err != nil {
return fmt.Errorf("err write controller template: %v", err)
Expand Down
6 changes: 3 additions & 3 deletions cmd/createproject/create_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func CreateProject(projectName string, moduleName string) {
log.Fatal(fmt.Errorf("err run go mod init in project path: %v", err))
}

log.Println("create internal/controller dir in project dir")
if err := os.MkdirAll(filepath.Join(projectPath, "internal", "controller"), os.ModePerm); err != nil {
log.Fatal(fmt.Errorf("err mkdir projectPath/internal/controller: %v", err))
log.Println("create internal/controller/http dir in project dir")
if err := os.MkdirAll(filepath.Join(projectPath, "internal", "controller", "http"), os.ModePerm); err != nil {
log.Fatal(fmt.Errorf("err mkdir projectPath/internal/controller/http/: %v", err))
}

log.Println("create internal/service dir in project dir")
Expand Down
2 changes: 1 addition & 1 deletion cmd/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package version
import "fmt"

func Version() {
fmt.Println("v0.0.7")
fmt.Println("v0.0.8")
}

0 comments on commit 4ed4984

Please sign in to comment.