diff --git a/demo/classfile2_blog/gop_autogen.go b/demo/classfile2_blog/gop_autogen.go index 6812132..559f23f 100644 --- a/demo/classfile2_blog/gop_autogen.go +++ b/demo/classfile2_blog/gop_autogen.go @@ -22,12 +22,11 @@ func (this *AppV2) MainEntry() { //line demo/classfile2_blog/main.yap:1:1 this.Run(":8888") } -func main() { - yap.Gopt_AppV2_Main(new(AppV2), new(get), new(get_p_id)) +func (this *AppV2) Main() { + yap.Gopt_AppV2_Main(this, new(get), new(get_p_id)) } //line demo/classfile2_blog/get.yap:1 func (this *get) Main(_gop_arg0 *yap.Context) { -//line demo/classfile2_blog/main.yap:1:1 this.Handler.Main(_gop_arg0) //line demo/classfile2_blog/get.yap:1:1 this.Html__1(`Hello, YAP!`) @@ -44,3 +43,6 @@ func (this *get_p_id) Main(_gop_arg0 *yap.Context) { func (this *get_p_id) Classfname() string { return "get_p_#id" } +func main() { + new(AppV2).Main() +} diff --git a/demo/classfile2_hello/gop_autogen.go b/demo/classfile2_hello/gop_autogen.go index d28204e..7e6c8a9 100644 --- a/demo/classfile2_hello/gop_autogen.go +++ b/demo/classfile2_hello/gop_autogen.go @@ -8,13 +8,14 @@ const _ = true type get struct { yap.Handler + *AppV2 } type get_p_id struct { yap.Handler + *AppV2 } - -func main() { - yap.Gopt_AppV2_Main(new(yap.AppV2), new(get), new(get_p_id)) +type AppV2 struct { + yap.AppV2 } //line demo/classfile2_hello/get.yap:1 func (this *get) Main(_gop_arg0 *yap.Context) { @@ -34,3 +35,9 @@ func (this *get_p_id) Main(_gop_arg0 *yap.Context) { func (this *get_p_id) Classfname() string { return "get_p_#id" } +func (this *AppV2) Main() { + yap.Gopt_AppV2_Main(this, new(get), new(get_p_id)) +} +func main() { + new(AppV2).Main() +} diff --git a/demo/classfile2_static/gop_autogen.go b/demo/classfile2_static/gop_autogen.go index 7120a97..1f93e74 100644 --- a/demo/classfile2_static/gop_autogen.go +++ b/demo/classfile2_static/gop_autogen.go @@ -18,6 +18,9 @@ func (this *AppV2) MainEntry() { //line demo/classfile2_static/main.yap:4:1 this.Run(":8080") } +func (this *AppV2) Main() { + yap.Gopt_AppV2_Main(this) +} func main() { - yap.Gopt_AppV2_Main(new(AppV2)) + new(AppV2).Main() } diff --git a/demo/classfile2_statichttp/gop_autogen.go b/demo/classfile2_statichttp/gop_autogen.go index 3a1517c..f5a50c5 100644 --- a/demo/classfile2_statichttp/gop_autogen.go +++ b/demo/classfile2_statichttp/gop_autogen.go @@ -19,6 +19,9 @@ func (this *AppV2) MainEntry() { //line demo/classfile2_statichttp/main.yap:4:1 this.Run(":8080") } +func (this *AppV2) Main() { + yap.Gopt_AppV2_Main(this) +} func main() { - yap.Gopt_AppV2_Main(new(AppV2)) + new(AppV2).Main() } diff --git a/demo/classfile_blog/gop_autogen.go b/demo/classfile_blog/gop_autogen.go index 3cb0531..85a84ed 100644 --- a/demo/classfile_blog/gop_autogen.go +++ b/demo/classfile_blog/gop_autogen.go @@ -24,6 +24,9 @@ func (this *blog) MainEntry() { //line demo/classfile_blog/blog_yap.gox:10:1 this.Run(":8888") } +func (this *blog) Main() { + yap.Gopt_App_Main(this) +} func main() { - yap.Gopt_App_Main(new(blog)) + new(blog).Main() } diff --git a/demo/classfile_hello/gop_autogen.go b/demo/classfile_hello/gop_autogen.go index c8aa50a..9ce6055 100644 --- a/demo/classfile_hello/gop_autogen.go +++ b/demo/classfile_hello/gop_autogen.go @@ -24,6 +24,9 @@ func (this *AppV2) MainEntry() { //line demo/classfile_hello/main.yap:10:1 this.Run("localhost:8080") } +func (this *AppV2) Main() { + yap.Gopt_AppV2_Main(this) +} func main() { - yap.Gopt_AppV2_Main(new(AppV2)) + new(AppV2).Main() } diff --git a/ydb/demo/foo/gop_autogen.go b/ydb/demo/foo/gop_autogen.go index 211436e..12047ac 100644 --- a/ydb/demo/foo/gop_autogen.go +++ b/ydb/demo/foo/gop_autogen.go @@ -47,13 +47,14 @@ type User struct { } type articles struct { ydb.Class + *AppGen } type users struct { ydb.Class + *AppGen } - -func main() { - ydb.Gopt_AppGen_Main(new(ydb.AppGen), new(articles), new(users)) +type AppGen struct { + ydb.AppGen } //line ydb/demo/foo/articles_ydb.gox:22:1 func (this *articles) API_Add(doc Article) { @@ -326,3 +327,9 @@ func (this *users) Main() { func (this *users) Classfname() string { return "users" } +func (this *AppGen) Main() { + ydb.Gopt_AppGen_Main(this, new(articles), new(users)) +} +func main() { + new(AppGen).Main() +} diff --git a/ytest/demo/foo/gop_autogen.go b/ytest/demo/foo/gop_autogen.go index e8c496d..93b0d16 100644 --- a/ytest/demo/foo/gop_autogen.go +++ b/ytest/demo/foo/gop_autogen.go @@ -19,6 +19,9 @@ func (this *foo) MainEntry() { //line ytest/demo/foo/foo_yap.gox:7:1 this.Run(":8080") } +func (this *foo) Main() { + yap.Gopt_App_Main(this) +} func main() { - yap.Gopt_App_Main(new(foo)) + new(foo).Main() } diff --git a/ytest/demo/jwtdemo/gop_autogen.go b/ytest/demo/jwtdemo/gop_autogen.go index b04a120..0fcc912 100644 --- a/ytest/demo/jwtdemo/gop_autogen.go +++ b/ytest/demo/jwtdemo/gop_autogen.go @@ -19,6 +19,9 @@ func (this *jwtdemo) MainEntry() { //line ytest/demo/jwtdemo/jwtdemo_yap.gox:7:1 this.Run(":8080") } +func (this *jwtdemo) Main() { + yap.Gopt_App_Main(this) +} func main() { - yap.Gopt_App_Main(new(jwtdemo)) + new(jwtdemo).Main() }