Compare commits
No commits in common. "master" and "v1.0.0" have entirely different histories.
@ -14,13 +14,7 @@
|
|||||||
A flexsible and powerful command line tool to initialize beego framework
|
A flexsible and powerful command line tool to initialize beego framework
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
1. 打开 go modules
|
|
||||||
```
|
|
||||||
export GO111MODULE=on
|
|
||||||
# or
|
|
||||||
go env -w GO111MODULE=on
|
|
||||||
```
|
|
||||||
2. 下载
|
|
||||||
```
|
```
|
||||||
go get golib.gaore.com/GaoreGo/beegoinit-cmd
|
go get golib.gaore.com/GaoreGo/beegoinit-cmd
|
||||||
```
|
```
|
||||||
|
@ -87,11 +87,15 @@ var initfun = `
|
|||||||
package applications
|
package applications
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
|
"golib.gaore.com/GaoreGo/beegoinit/response"
|
||||||
router "golib.gaore.com/GaoreGo/beegoinit/routers"
|
router "golib.gaore.com/GaoreGo/beegoinit/routers"
|
||||||
|
"golib.gaore.com/GaoreGo/grconfig"
|
||||||
"golib.gaore.com/GaoreGo/grlogs"
|
"golib.gaore.com/GaoreGo/grlogs"
|
||||||
common "{{ packageName }}/applications/_common/controllers"
|
common "{{ packageName }}/applications/_common/controllers"
|
||||||
api "{{ packageName }}/applications/api/controllers"
|
api "{{ packageName }}/applications/api/controllers"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -229,7 +233,7 @@ func New(c *cli.Context) error {
|
|||||||
os.MkdirAll(path.Join(appPath, "applications", "_common", "views"), 0755)
|
os.MkdirAll(path.Join(appPath, "applications", "_common", "views"), 0755)
|
||||||
os.MkdirAll(path.Join(appPath, "applications", "api", "controllers"), 0755)
|
os.MkdirAll(path.Join(appPath, "applications", "api", "controllers"), 0755)
|
||||||
|
|
||||||
utils.WriteToFile(path.Join(appPath, "main.go"), strings.ReplaceAll(mainfun, "{{ packageName }}", packageName))
|
utils.WriteToFile(path.Join(appPath, "main1.go"), strings.ReplaceAll(mainfun, "{{ packageName }}", packageName))
|
||||||
utils.WriteToFile(path.Join(appPath, "applications", "init.go"), strings.ReplaceAll(initfun, "{{ packageName }}", packageName))
|
utils.WriteToFile(path.Join(appPath, "applications", "init.go"), strings.ReplaceAll(initfun, "{{ packageName }}", packageName))
|
||||||
utils.WriteToFile(path.Join(appPath, "conf", "app.conf"), strings.ReplaceAll(appconf, "{{ packageName }}", packageName))
|
utils.WriteToFile(path.Join(appPath, "conf", "app.conf"), strings.ReplaceAll(appconf, "{{ packageName }}", packageName))
|
||||||
utils.WriteToFile(path.Join(appPath, "applications", "_common", "views", "404.tpl"), indextpl)
|
utils.WriteToFile(path.Join(appPath, "applications", "_common", "views", "404.tpl"), indextpl)
|
||||||
|
2
main.go
2
main.go
@ -37,7 +37,7 @@ func main() {
|
|||||||
{
|
{
|
||||||
Name: "date",
|
Name: "date",
|
||||||
Aliases: []string{"d"},
|
Aliases: []string{"d"},
|
||||||
Usage: "Print current date",
|
Usage: "Print date",
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
fmt.Println(time.Now().Format(time.RFC3339))
|
fmt.Println(time.Now().Format(time.RFC3339))
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user