-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增从xlsx文件生成Go配置代码和JSON数据文件的功能。实现xlsx到Go的结构体定义及数据转换,支持客户端、服务端和双端导出模式。同时提供xlsx模板文件的导出功能。
- Loading branch information
1 parent
6b82d33
commit 818b80c
Showing
28 changed files
with
897 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"github.com/spf13/cobra" | ||
"os" | ||
) | ||
|
||
var stack bool | ||
|
||
var rootCmd = &cobra.Command{ | ||
Use: "minotaur-ax", | ||
Short: "Minotaur ax is a CLI (Command Line Interface) tool designed to facilitate the rapid development of Minotaur projects.", | ||
Long: "Minotaur ax is an essential command line tool aimed at enhancing and accelerating the development process of projects using the Minotaur framework.", | ||
} | ||
|
||
func Execute() { | ||
defer func() { | ||
if err := recover(); err != nil { | ||
checkError(err) | ||
} | ||
}() | ||
if err := rootCmd.Execute(); err != nil { | ||
panic(err) | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
func init() { | ||
|
||
rootCmd.PersistentFlags().BoolVar(&stack, "stack", false, "show stack trace") | ||
} | ||
|
||
func checkError(err error) { | ||
func checkError(err any) { | ||
if err != nil { | ||
panic(err) | ||
if stack { | ||
panic(err) | ||
} | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,7 @@ type Table interface { | |
|
||
// GetFields 获取配置结构的字段 | ||
GetFields() FieldScanner | ||
|
||
// IsIgnore 是否忽略该表 | ||
IsIgnore() bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.