Skip to content

Commit

Permalink
style: +vscodeworkspace
Browse files Browse the repository at this point in the history
  • Loading branch information
2637309949 committed Nov 24, 2021
1 parent 2738c7a commit 90f01e1
Show file tree
Hide file tree
Showing 25 changed files with 628 additions and 836 deletions.
27 changes: 0 additions & 27 deletions .circleci/config.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"go.inferGopath": false
}
50 changes: 24 additions & 26 deletions cmd/dolphin/template/assets/auto.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,35 @@ import (
"github.com/spf13/viper"
)

// Name project
{{- $pName := .Name }}
var Name = "{{.Name}}"
var NopHandlerFunc = func(ctx *Context) { ctx.Next() }
var (
Name = "{{.Name}}"
NopHandlerFunc = func(ctx *Context) { ctx.Next() }
{{- range .Controllers}}
{{.ToUpperCase .Name}}Instance = New{{.ToUpperCase .Name}}()
{{- end}}
)

// Controller defined
type Controller struct {
Method string
RelativePath string
Auth,
Roles,
Cache,
Interceptor,
Handler core.HandlerFunc
}
type (
Controller struct {
Method string
RelativePath string
Auth, Roles, Cache, Interceptor, Handler core.HandlerFunc
}
{{- range .Controllers}}
{{.ToUpperCase .Name}} struct {
Name string
Srv *{{$.Viper.GetString "dir.srv" }}.{{.ToUpperCase .Name}}
{{- $APIS := .APIS}}
{{- range $index, $api := .APIS}}
{{.ToUpperCase $api.Name}}{{- if last $index $APIS}} Controller{{- else}},{{- end}}
{{- end}}
}
{{- end}}
)

{{- range .Controllers}}
{{- $ctr := .}}
// {{.ToUpperCase .Name}} defined
type {{.ToUpperCase .Name}} struct {
Name string
Srv *{{$.Viper.GetString "dir.srv" }}.{{.ToUpperCase .Name}}
{{- $APIS := .APIS}}
{{- range $index, $api := .APIS}}
{{.ToUpperCase $api.Name}}{{- if last $index $APIS}} Controller{{- else}},{{- end}}
{{- end}}
}

// New{{.ToUpperCase .Name}} defined
func New{{.ToUpperCase .Name}}() *{{.ToUpperCase .Name}} {
ctr := &{{.ToUpperCase .Name}}{Name: "{{.Name}}", Srv: {{$.Viper.GetString "dir.srv" }}.New{{.ToUpperCase .Name}}()}
Expand All @@ -66,9 +67,6 @@ func {{.ToUpperCase .Name}}Routes() {
g.Handle(i.{{.ToUpperCase .Name}}.Method, i.{{.ToUpperCase .Name}}.RelativePath, i.{{.ToUpperCase .Name}}.Auth, i.{{.ToUpperCase .Name}}.Roles, i.{{.ToUpperCase .Name}}.Cache, i.{{.ToUpperCase .Name}}.Interceptor, i.{{.ToUpperCase .Name}}.Handler)
{{- end}}
}

// {{.ToUpperCase .Name}}Instance defined
var {{.ToUpperCase .Name}}Instance = New{{.ToUpperCase .Name}}()
{{end}}

// SyncModel defined
Expand Down
6 changes: 3 additions & 3 deletions cmd/dolphin/template/dist/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/aisle/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"go.inferGopath": false
}
2 changes: 1 addition & 1 deletion examples/aisle/api/app.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 24 additions & 29 deletions examples/aisle/api/auto.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions examples/aisle/api/base_organ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified examples/aisle/x_test.db
Binary file not shown.
Binary file modified examples/aisle/x_test_localhost.db
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/scene/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"go.inferGopath": false
}
Loading

0 comments on commit 90f01e1

Please sign in to comment.