mirror of
https://github.com/go-nunu/nunu.git
synced 2025-09-26 20:31:18 +08:00
feat: add the admin panel
This commit is contained in:
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023-2024 Nunu
|
||||
Copyright (c) 2023-2025 Nunu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@@ -35,6 +35,8 @@ Nunu is a scaffolding tool for building Go applications. Its name comes from a g
|
||||
- **Gomock**: https://github.com/golang/mock
|
||||
- **Swaggo**: https://github.com/swaggo/swag
|
||||
- **Pitaya**: https://github.com/topfreegames/pitaya
|
||||
- **Casbin**: https://github.com/casbin/casbin
|
||||
|
||||
- More...
|
||||
|
||||
## Key Features
|
||||
|
@@ -31,6 +31,8 @@ Nunuは、Goアプリケーションを構築するためのスキャフォー
|
||||
- **Gomock**: https://github.com/golang/mock
|
||||
- **Swaggo**: https://github.com/swaggo/swag
|
||||
- **Pitaya**: https://github.com/topfreegames/pitaya
|
||||
- **Casbin**: https://github.com/casbin/casbin
|
||||
|
||||
- その他多数...
|
||||
|
||||
## 主な特徴
|
||||
|
@@ -31,6 +31,7 @@ Nunu é uma ferramenta de geração de estrutura (scaffolding) para construir ap
|
||||
- **Gomock**: https://github.com/golang/mock
|
||||
- **Swaggo**: https://github.com/swaggo/swag
|
||||
- **Pitaya**: https://github.com/topfreegames/pitaya
|
||||
- **Casbin**: https://github.com/casbin/casbin
|
||||
- Mais...
|
||||
|
||||
## Funcionalidades Principais
|
||||
|
@@ -31,6 +31,7 @@ Nunu是一个基于Golang的应用脚手架,它的名字来自于英雄联盟
|
||||
- **Gomock**: https://github.com/golang/mock
|
||||
- **Swaggo**: https://github.com/swaggo/swag
|
||||
- **Pitaya**: https://github.com/topfreegames/pitaya
|
||||
- **Casbin**: https://github.com/casbin/casbin
|
||||
- More...
|
||||
## 特性
|
||||
* **超低学习成本和定制**:Nunu封装了Gopher最熟悉的一些流行库。您可以轻松定制应用程序以满足特定需求。
|
||||
|
@@ -16,7 +16,7 @@ var CmdRoot = &cobra.Command{
|
||||
Use: "nunu",
|
||||
Example: "nunu new demo-api",
|
||||
Short: "\n _ _ \n| \\ | |_ _ _ __ _ _ \n| \\| | | | | '_ \\| | | |\n| |\\ | |_| | | | | |_| |\n|_| \\_|\\__,_|_| |_|\\__,_| \n \n" + "\x1B[38;2;66;211;146mA\x1B[39m \x1B[38;2;67;209;149mC\x1B[39m\x1B[38;2;68;206;152mL\x1B[39m\x1B[38;2;69;204;155mI\x1B[39m \x1B[38;2;70;201;158mt\x1B[39m\x1B[38;2;71;199;162mo\x1B[39m\x1B[38;2;72;196;165mo\x1B[39m\x1B[38;2;73;194;168ml\x1B[39m \x1B[38;2;74;192;171mf\x1B[39m\x1B[38;2;75;189;174mo\x1B[39m\x1B[38;2;76;187;177mr\x1B[39m \x1B[38;2;77;184;180mb\x1B[39m\x1B[38;2;78;182;183mu\x1B[39m\x1B[38;2;79;179;186mi\x1B[39m\x1B[38;2;80;177;190ml\x1B[39m\x1B[38;2;81;175;193md\x1B[39m\x1B[38;2;82;172;196mi\x1B[39m\x1B[38;2;83;170;199mn\x1B[39m\x1B[38;2;83;167;202mg\x1B[39m \x1B[38;2;84;165;205mg\x1B[39m\x1B[38;2;85;162;208mo\x1B[39m \x1B[38;2;86;160;211ma\x1B[39m\x1B[38;2;87;158;215mp\x1B[39m\x1B[38;2;88;155;218ml\x1B[39m\x1B[38;2;89;153;221mi\x1B[39m\x1B[38;2;90;150;224mc\x1B[39m\x1B[38;2;91;148;227ma\x1B[39m\x1B[38;2;92;145;230mt\x1B[39m\x1B[38;2;93;143;233mi\x1B[39m\x1B[38;2;94;141;236mo\x1B[39m\x1B[38;2;95;138;239mn\x1B[39m\x1B[38;2;96;136;243m.\x1B[39m",
|
||||
Version: fmt.Sprintf("\n _ _ \n| \\ | |_ _ _ __ _ _ \n| \\| | | | | '_ \\| | | |\n| |\\ | |_| | | | | |_| |\n|_| \\_|\\__,_|_| |_|\\__,_| \n \nNunu %s - Copyright (c) 2023-2024 Nunu\nReleased under the MIT License.\n\n", config.Version),
|
||||
Version: fmt.Sprintf("\n _ _ \n| \\ | |_ _ _ __ _ _ \n| \\| | | | | '_ \\| | | |\n| |\\ | |_| | | | | |_| |\n|_| \\_|\\__,_|_| |_|\\__,_| \n \nNunu %s - Copyright (c) 2023-2025 Nunu\nReleased under the MIT License.\n\n", config.Version),
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
@@ -1,11 +1,12 @@
|
||||
package config
|
||||
|
||||
var (
|
||||
Version = "1.1.0"
|
||||
Version = "1.1.1"
|
||||
WireCmd = "github.com/google/wire/cmd/wire@latest"
|
||||
NunuCmd = "github.com/go-nunu/nunu@latest"
|
||||
RepoBase = "https://github.com/go-nunu/nunu-layout-base.git"
|
||||
RepoAdvanced = "https://github.com/go-nunu/nunu-layout-advanced.git"
|
||||
RepoAdmin = "https://github.com/go-nunu/nunu-layout-admin.git"
|
||||
RepoChat = "https://github.com/go-nunu/nunu-layout-chat.git"
|
||||
RunExcludeDir = ".git,.idea,tmp,vendor"
|
||||
RunIncludeExt = "go,html,yaml,yml,toml,ini,json,xml,tpl,tmpl"
|
||||
|
@@ -110,15 +110,19 @@ func (p *Project) cloneTemplate() (bool, error) {
|
||||
Message: "Please select a layout:",
|
||||
Options: []string{
|
||||
"Advanced",
|
||||
"Admin",
|
||||
"Basic",
|
||||
"Chat",
|
||||
},
|
||||
Description: func(value string, index int) string {
|
||||
if index == 1 {
|
||||
return "A basic project structure"
|
||||
return "A admin template for quick backend setup."
|
||||
}
|
||||
if index == 2 {
|
||||
return "A simple chat room containing websocket/tcp"
|
||||
return "A basic project structure."
|
||||
}
|
||||
if index == 3 {
|
||||
return "A simple chat room containing websocket/tcp."
|
||||
}
|
||||
return "It has rich functions such as db, jwt, cron, migration, test, etc"
|
||||
},
|
||||
@@ -131,6 +135,8 @@ func (p *Project) cloneTemplate() (bool, error) {
|
||||
repo = config.RepoAdvanced
|
||||
} else if layout == "Chat" {
|
||||
repo = config.RepoChat
|
||||
} else if layout == "Admin" {
|
||||
repo = config.RepoAdmin
|
||||
}
|
||||
err = os.RemoveAll(p.ProjectName)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user