Parcourir la source

feat: play 命令,做调试使用

runningwater il y a 5 mois
Parent
commit
71e208faf5
3 fichiers modifiés avec 20 ajouts et 1 suppressions
  1. 1 0
      CHANGELOG.md
  2. 18 0
      app/cmd/play.go
  3. 1 1
      main.go

+ 1 - 0
CHANGELOG.md

@@ -31,6 +31,7 @@
 - 账号登陆
 - Guest 中间件
 - 命令行模式
+- Key  命令
 
 ### 🚜 代码重构
 

+ 18 - 0
app/cmd/play.go

@@ -0,0 +1,18 @@
+package cmd
+
+import (
+	"github.com/spf13/cobra"
+)
+
+var CmdPlay = &cobra.Command{
+	Use:   "play",
+	Short: "Linke the Go Playground, but running at our application eontext",
+	Run:   runPlay,
+}
+
+// 调试用,完成后删除
+func runPlay(cmd *cobra.Command, args []string) {
+	//redis.Redis.Set("hello", "hi form redis", 10*time.Second)
+
+	//console.Success(redis.Redis.Get("hello"))
+}

+ 1 - 1
main.go

@@ -47,7 +47,7 @@ func main() {
 	rootCmd.AddCommand(
 		cmd.CmdServe,
 		cmd.CmdKey,
-		// cmd.CmdPlay,
+		cmd.CmdPlay,
 	)
 
 	// 配置默认运行 Web 服务