1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package test
- import (
- //"git.cestong.com.cn/cecf/config-center-server/models/tools"
- //"os"
- "testing"
- //"text/template"
- )
- func TestGoModelTemplate(t *testing.T) {
- //t1, err := template.ParseFiles("model.go.template")
- //if err != nil {
- // t.Error(err)
- //}
- //table := tools.SysTables{}
- //table.TBName = "sys_tables"
- //tab, err := table.Get()
- //if err != nil {
- // t.Error(err)
- //}
- //file, err := os.CreateConfigItem("models/" + table.PackageName + ".go")
- //if err != nil {
- // t.Error(err)
- //}
- //defer file.Close()
- //
- //_ = t1.Execute(file, tab)
- t.Log("")
- }
- func TestGoApiTemplate(t *testing.T) {
- //t1, err := template.ParseFiles("api.go.template")
- //if err != nil {
- // t.Error(err)
- //}
- //table := tools.SysTables{}
- //table.TBName = "sys_tables"
- //tab, _ := table.Get()
- //file, err := os.CreateConfigItem("apis/" + table.PackageName + ".go")
- //if err != nil {
- // t.Error(err)
- //}
- //defer file.Close()
- //
- //_ = t1.Execute(file, tab)
- t.Log("")
- }
|