feat(*): go 后端项目脚手架
This commit is contained in:
29
pkg/consts/consts.go
Normal file
29
pkg/consts/consts.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package consts
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// 通用系统级常量
|
||||
const (
|
||||
AppName = "NavSite"
|
||||
AppAuthor = "zhilv666"
|
||||
AppVersion = "1.0.0"
|
||||
)
|
||||
|
||||
// 默认服务端口
|
||||
const DefaultPort = 8080
|
||||
|
||||
// 通用时间格式
|
||||
const (
|
||||
TimeFormatDate = "2006-01-02"
|
||||
TimeFormatDateTime = "2006-01-02 15:04:05"
|
||||
)
|
||||
|
||||
func init() {
|
||||
fmt.Printf("🚀 启动 %s v%s by %s\n",
|
||||
AppName,
|
||||
AppVersion,
|
||||
AppAuthor,
|
||||
)
|
||||
}
|
||||
6
pkg/consts/paths.go
Normal file
6
pkg/consts/paths.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package consts
|
||||
|
||||
// 项目路径与文件定义
|
||||
var (
|
||||
ConfigName = "config"
|
||||
)
|
||||
6
pkg/consts/version.go
Normal file
6
pkg/consts/version.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package consts
|
||||
|
||||
var (
|
||||
BuildTime string
|
||||
GitCommit string
|
||||
)
|
||||
Reference in New Issue
Block a user