Giter Club home page Giter Club logo

gin-admin-cli's People

Contributors

lyrictian avatar sigam-zq avatar whtiehack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gin-admin-cli's Issues

window 生成寻找不到模板文件报错

win10 64位

gin-admin-cli 版本如下

gin-admin-cli version v10.3.1

错误报错如下

gin-admin-cli gen -d . -m Comm --structs Param --structs-comment 'Param 系统参数' --structs-router-prefix=true
2024-01-19T09:40:32.530+0800 ERROR [GEN] Failed to parse tpl, err: open tpls\default\schema.go.tpl: file does not exist, #struct Param, #tpl default\schema.go.tpl
github.com/gin-admin/gin-admin-cli/v10/internal/actions.(*GenerateAction).generate
D:/desktop/gitDemo/go/gin-admin-cli/internal/actions/generate.go:216
github.com/gin-admin/gin-admin-cli/v10/internal/actions.(*GenerateAction).run
D:/desktop/gitDemo/go/gin-admin-cli/internal/actions/generate.go:89
github.com/gin-admin/gin-admin-cli/v10/internal/actions.(*GenerateAction).RunWithStruct
D:/desktop/gitDemo/go/gin-admin-cli/internal/actions/generate.go:84
github.com/gin-admin/gin-admin-cli/v10/cmd.Generate.func1
D:/desktop/gitDemo/go/gin-admin-cli/cmd/generate.go:104
github.com/urfave/cli/v2.(*Command).Run
C:/Users/zq102/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:274
github.com/urfave/cli/v2.(*Command).Run
C:/Users/zq102/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:267
github.com/urfave/cli/v2.(*App).RunContext
C:/Users/zq102/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:332
github.com/urfave/cli/v2.(*App).Run
C:/Users/zq102/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:309
main.main
D:/desktop/gitDemo/go/gin-admin-cli/main.go:47
runtime.main
D:/Environment/go1.21/go1.21.0.windows-amd64/go/src/runtime/proc.go:267
panic: open tpls\default\schema.go.tpl: file does not exist

尝试重新编译 也不通过

配置文件中的table_name字段没有实际使用

当前使用版本
feat/v10

Bug描述
使用-c参数指定配置文件生成业务模型,table_name参数指定的表名不生效,应该是template中没有使用这个创建表名
我在scheme.go.tpl中添加的如下代码重新编译的,作者大大可以考虑修复下这个问题

{{ if .TableName }}
// Use `{{ .TableName }}` as TableName
func (a *{{$name}}) TableName() string {
	return "{{ .TableName }}"
}
{{ end }}

unknown field RightDelim in struct literal

Hello, I am not sure if I can get the documentation well.
I have just made the following commands:

$gin-admin-cli new -d ~/go/src --name test-gin-admin --desc 'A test API service based on golang.' --pkg 'github.com/mgazzin/test-gin-admin'
$ gin-admin-cli gen -d ~/go/src/test-gin-admin -m SYS --structs Dictionary --structs-comment "Dictionaries management" --structs-router-prefix
2024-01-23T14:55:10.805+0100	INFO	[GEN]	Write file: /home/mgem/go/src/test-gin-admin/internal/mods/sys/schema/dictionary.go
2024-01-23T14:55:10.823+0100	INFO	[GEN]	Write file: /home/mgem/go/src/test-gin-admin/internal/mods/sys/dal/dictionary.dal.go
2024-01-23T14:55:10.828+0100	INFO	[GEN]	Write file: /home/mgem/go/src/test-gin-admin/internal/mods/sys/biz/dictionary.biz.go
2024-01-23T14:55:10.834+0100	INFO	[GEN]	Write file: /home/mgem/go/src/test-gin-admin/internal/mods/sys/api/dictionary.api.go
2024-01-23T14:55:10.842+0100	INFO	[GEN]	Write file: /home/mgem/go/src/test-gin-admin/internal/mods/sys/main.go
2024-01-23T14:55:10.848+0100	INFO	[GEN]	Write file: /home/mgem/go/src/test-gin-admin/internal/mods/sys/wire.go
2024-01-23T14:55:10.854+0100	INFO	[GEN]	Write file: /home/mgem/go/src/test-gin-admin/internal/mods/mods.go
wire: github.com/mgazzin/test-gin-admin/internal/wirex: wrote /home/mgem/go/src/test-gin-admin/internal/wirex/wire_gen.go
swag init --parseDependency --generalInfo main.go --output internal/swagger 
2024/01/23 14:55:12 Generate swagger docs....
2024/01/23 14:55:12 Generate general API Info, search dir:./
2024/01/23 14:55:14 Generating util.ResponseResult
2024/01/23 14:55:14 Generating errors.Error
2024/01/23 14:55:14 Generating schema.Captcha
2024/01/23 14:55:14 Generating schema.LoginForm
2024/01/23 14:55:14 Generating schema.LoginToken
2024/01/23 14:55:14 Generating schema.User
2024/01/23 14:55:14 Generating schema.UserRoles
2024/01/23 14:55:14 Generating schema.UserRole
2024/01/23 14:55:14 Generating schema.UpdateLoginPassword
2024/01/23 14:55:14 Generating schema.Menu
2024/01/23 14:55:14 Generating schema.Menus
2024/01/23 14:55:14 Skipping 'schema.Menu', recursion detected.
2024/01/23 14:55:14 Generating schema.MenuResources
2024/01/23 14:55:14 Generating schema.MenuResource
2024/01/23 14:55:14 Generating schema.UpdateCurrentUser
2024/01/23 14:55:14 Generating schema.MenuForm
2024/01/23 14:55:14 Generating schema.Role
2024/01/23 14:55:14 Generating schema.RoleMenus
2024/01/23 14:55:14 Generating schema.RoleMenu
2024/01/23 14:55:14 Generating schema.RoleForm
2024/01/23 14:55:14 Generating schema.UserForm
2024/01/23 14:55:14 Generating schema.Dictionary
2024/01/23 14:55:14 Generating schema.DictionaryForm
2024/01/23 14:55:14 Generating schema.Logger
2024/01/23 14:55:14 create docs.go at internal/swagger/docs.go
2024/01/23 14:55:14 create swagger.json at internal/swagger/swagger.json
2024/01/23 14:55:14 create swagger.yaml at internal/swagger/swagger.yaml
$ make swagger
2024/01/23 15:02:44 Generate swagger docs....
2024/01/23 15:02:44 Generate general API Info, search dir:./
2024/01/23 15:02:46 Generating util.ResponseResult
2024/01/23 15:02:46 Generating errors.Error
2024/01/23 15:02:46 Generating schema.Captcha
2024/01/23 15:02:46 Generating schema.LoginForm
2024/01/23 15:02:46 Generating schema.LoginToken
2024/01/23 15:02:46 Generating schema.User
2024/01/23 15:02:46 Generating schema.UserRoles
2024/01/23 15:02:46 Generating schema.UserRole
2024/01/23 15:02:46 Generating schema.UpdateLoginPassword
2024/01/23 15:02:46 Generating schema.Menu
2024/01/23 15:02:46 Generating schema.Menus
2024/01/23 15:02:46 Skipping 'schema.Menu', recursion detected.
2024/01/23 15:02:46 Generating schema.MenuResources
2024/01/23 15:02:46 Generating schema.MenuResource
2024/01/23 15:02:46 Generating schema.UpdateCurrentUser
2024/01/23 15:02:46 Generating schema.MenuForm
2024/01/23 15:02:46 Generating schema.Role
2024/01/23 15:02:46 Generating schema.RoleMenus
2024/01/23 15:02:46 Generating schema.RoleMenu
2024/01/23 15:02:46 Generating schema.RoleForm
2024/01/23 15:02:46 Generating schema.UserForm
2024/01/23 15:02:46 Generating schema.Dictionary
2024/01/23 15:02:46 Generating schema.DictionaryForm
2024/01/23 15:02:46 Generating schema.Logger
2024/01/23 15:02:46 create docs.go at internal/swagger/docs.go
2024/01/23 15:02:46 create swagger.json at internal/swagger/swagger.json
2024/01/23 15:02:46 create swagger.yaml at internal/swagger/swagger.yaml
$ make wire
wire: github.com/mgazzin/test-gin-admin/internal/wirex: wrote /home/mgem/go/src/test-gin-admin/internal/wirex/wire_gen.go
$ make start
fatal: Needed a single revision
# github.com/mgazzin/test-gin-admin/internal/swagger
internal/swagger/docs.go:2309:2: unknown field LeftDelim in struct literal of type "github.com/swaggo/swag".Spec
internal/swagger/docs.go:2310:2: unknown field RightDelim in struct literal of type "github.com/swaggo/swag".Spec
make: *** [Makefile:21: start] Error 1

Is there anything I am not considering?

How can i generate frontend ui with generate command?

Hi,

It seems that if I call gin-admin-cli gen without a json/yaml config file, the frontend ui is not created even if I specify the fe-dir value. Looking at the code, it seems that the frontend ui-related values must be set in the json/yaml file to generate code in the fe-dir entered when calling cli. right?

Can you provide yaml example for generate frontend ui? I would like to simply add a record struct and check the record list through the created top UI.

mac os path

I successfully downloaded gin-admin-cli in but the command cannot be executed

gin-admin-cli: command not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.