diff --git a/hasaki-gen-crud/hasaki-gen-crud.js b/hasaki-gen-crud/hasaki-gen-crud.js index 4673179..1740941 100644 --- a/hasaki-gen-crud/hasaki-gen-crud.js +++ b/hasaki-gen-crud/hasaki-gen-crud.js @@ -14,8 +14,8 @@ try { // }).catch(error => { // console.log("fix:", error); // }) - // vscode.commands.executeCommand('editor.action.quickFix', vscode.Uri.file(path)); - vscode.window.createTerminal("go:fix", "cmd.exe", ["/c", `gopls fix -a -w ${path}`]) + vscode.commands.executeCommand('editor.action.quickFix', vscode.Uri.file(path), new vscode.Range((new vscode.Position(0, 0)), (new vscode.Position(100, 0)))); + // vscode.window.createTerminal("go:fix", "cmd.exe", ["/c", `gopls fix -a -w ${path}`]) } diff --git a/test.go b/test.go index f503ded..8db4983 100644 --- a/test.go +++ b/test.go @@ -3,10 +3,27 @@ */ package main +import ( + "git.ouxuan.net/hasaki-service/hasaki-sdk/hskdb" + "xorm.io/xorm" +) + type MyTestr struct { Id int } +//wherePrimaryKey +func (myTestr *MyTestr) wherePrimaryKey() (q interface{}, args []interface{}) { + //todo 根据需求修改 + return "`id`=?", []interface{}{ + myTestr.Id, + } +} + +func (myTestr *MyTestr) getXorm() *xorm.Engine { + return hskdb.GetXormAuto() +} + type MyTestr2 struct { Id int }