public_host 4 years ago
parent
commit
b09ed8a49a
  1. 4
      hasaki-gen-crud/hasaki-gen-crud.js
  2. 17
      test.go

4
hasaki-gen-crud/hasaki-gen-crud.js

@ -14,8 +14,8 @@ try {
// }).catch(error => { // }).catch(error => {
// console.log("fix:", 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}`])
} }

17
test.go

@ -3,10 +3,27 @@
*/ */
package main package main
import (
"git.ouxuan.net/hasaki-service/hasaki-sdk/hskdb"
"xorm.io/xorm"
)
type MyTestr struct { type MyTestr struct {
Id int 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 { type MyTestr2 struct {
Id int Id int
} }

Loading…
Cancel
Save