From 847fc09535c58176d52b3db78e8811b9220ab76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=BB=84?= <1520752231@qq.com> Date: Wed, 7 Apr 2021 10:46:23 +0800 Subject: [PATCH] bug: fix --- README.md | 9 ++++++++- go.mod | 2 +- main.go | 2 +- modelgen/gen.go | 28 +++------------------------- 4 files changed, 13 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 6d7e649..0e2d5d6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,10 @@ # hasaki-ctl -工具 \ No newline at end of file +工具 + +servicegen + +modelgen + +ui +可以通过某些request/response/handler 确定简单的接口。 \ No newline at end of file diff --git a/go.mod b/go.mod index 3c35b77..8d359db 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module demo +module hasaki-ctl go 1.14 diff --git a/main.go b/main.go index be03a6f..92db30c 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "demo/servicegen" + "hasaki-ctl/servicegen" "github.com/spf13/cobra" ) diff --git a/modelgen/gen.go b/modelgen/gen.go index 779f5e4..223771b 100644 --- a/modelgen/gen.go +++ b/modelgen/gen.go @@ -1,29 +1,7 @@ package modelgen -import ( - "git.ouxuan.net/hasaki-service/hasaki-sdk/hskdb" - "time" - "xorm.io/xorm" -) -type Model struct { - Id int `json:"id"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - DeletedAt time.Time `json:"deleted_at"` -} +// 生成model +func Gen() { -type Context struct { - session *xorm.Session - instance interface{} -} - -type UserModel struct { -} - -func (u *UserModel) Objects() *Context { - return &Context{ - session: hskdb.GetXormAuto().NewSession(), - instance: u, - } -} +} \ No newline at end of file