From a496dca96eea6965a61de1dab9b4c5184218fbb4 Mon Sep 17 00:00:00 2001 From: public_host Date: Tue, 20 Apr 2021 16:46:17 +0800 Subject: [PATCH] fix --- main.go | 34 ++++++++++++++++++++++++++++++++++ test.go | 17 ----------------- 2 files changed, 34 insertions(+), 17 deletions(-) create mode 100644 main.go delete mode 100644 test.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..0c90c80 --- /dev/null +++ b/main.go @@ -0,0 +1,34 @@ +/* +测试文件 +*/ +package main + +import ( + "git.ouxuan.net/hasaki-service/hasaki-sdk/hskdb" + "xorm.io/xorm" +) + +type MyTestr struct { + Id int +} + +type MyTestr2 struct { + Id int +} + +type MyTestr3 struct { + Id int + Mi int +} + +//wherePrimaryKey +func (myTestr3 *MyTestr3) wherePrimaryKey() (q interface{}, args []interface{}) { + //todo 根据需求修改 + return "`id`=?", []interface{}{ + myTestr3.Id, + } +} + +func (myTestr3 *MyTestr3) getXorm() *xorm.Engine { + return hskdb.GetXormAuto() +} diff --git a/test.go b/test.go deleted file mode 100644 index f503ded..0000000 --- a/test.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -测试文件 -*/ -package main - -type MyTestr struct { - Id int -} - -type MyTestr2 struct { - Id int -} - -type MyTestr3 struct { - Id int - Mi int -}