Forráskód Böngészése

feat:数据超市路由初始化

wangchuanjin 2 éve
szülő
commit
0338b2111f

+ 44 - 0
src/jfw/front/datasmt.go

@@ -0,0 +1,44 @@
+package front
+
+import (
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jypkg/public"
+)
+
+type Datasmt struct {
+	*xweb.Action
+	index  xweb.Mapper `xweb:"/datasmt"`            //落地页
+	list   xweb.Mapper `xweb:"/datasmt/([^/]+$)"`   //列表
+	detail xweb.Mapper `xweb:"/datasmt/(.+?)/(.+)"` //详情页面
+}
+
+func init() {
+	xweb.AddAction(&Datasmt{})
+}
+
+func (this *Datasmt) Index() error {
+	if mobileReg.MatchString(this.UserAgent()) || public.CheckWxBrowser(this.Request) {
+		return this.Render("/weixin/dataSmt/index.html")
+	} else {
+		return this.Render("/pc/dataSmt/index.html")
+	}
+}
+
+func (this *Datasmt) List(dataType string) error {
+	this.T["dataType"] = dataType
+	if mobileReg.MatchString(this.UserAgent()) || public.CheckWxBrowser(this.Request) {
+		return this.Render("/weixin/dataSmt/list.html")
+	} else {
+		return this.Render("/pc/dataSmt/list.html")
+	}
+}
+
+func (this *Datasmt) Detail(dataType, id string) error {
+	this.T["dataType"] = dataType
+	this.T["id"] = id
+	if mobileReg.MatchString(this.UserAgent()) || public.CheckWxBrowser(this.Request) {
+		return this.Render("/weixin/dataSmt/detail.html")
+	} else {
+		return this.Render("/pc/dataSmt/detail.html")
+	}
+}

+ 1 - 0
src/jfw/modules/app/src/app/filter/loginfilter.go

@@ -25,6 +25,7 @@ var urls = []*regexp.Regexp{
 	regexp.MustCompile("^/jyapp/structed/index"),
 	regexp.MustCompile("^/jyapp/exhibition/.*"),
 	regexp.MustCompile("^/jyapp/bank/scheme"),
+	regexp.MustCompile("^/jyapp/datasmt"),
 }
 
 type loginFilter struct {

+ 31 - 0
src/jfw/modules/app/src/app/front/datasmt.go

@@ -0,0 +1,31 @@
+package front
+
+import (
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+)
+
+type Datasmt struct {
+	*xweb.Action
+	index  xweb.Mapper `xweb:"/jyapp/datasmt"`            //落地页
+	list   xweb.Mapper `xweb:"/jyapp/datasmt/([^/]+$)"`   //列表
+	detail xweb.Mapper `xweb:"/jyapp/datasmt/(.+?)/(.+)"` //详情页面
+}
+
+func init() {
+	xweb.AddAction(&Datasmt{})
+}
+
+func (this *Datasmt) Index() error {
+	return this.Render("/dataSmt/index.html")
+}
+
+func (this *Datasmt) List(dataType string) error {
+	this.T["dataType"] = dataType
+	return this.Render("/dataSmt/list.html")
+}
+
+func (this *Datasmt) Detail(dataType, id string) error {
+	this.T["dataType"] = dataType
+	this.T["id"] = id
+	return this.Render("/dataSmt/detail.html")
+}

+ 3 - 0
src/jfw/modules/app/src/web/templates/dataSmt/detail.html

@@ -0,0 +1,3 @@
+pc 详情页
+{{.T.dataType}}
+{{.T.id}}

+ 1 - 0
src/jfw/modules/app/src/web/templates/dataSmt/index.html

@@ -0,0 +1 @@
+pc 落地页

+ 2 - 0
src/jfw/modules/app/src/web/templates/dataSmt/list.html

@@ -0,0 +1,2 @@
+pc 列表页
+{{.T.dataType}}

+ 3 - 0
src/web/templates/pc/dataSmt/detail.html

@@ -0,0 +1,3 @@
+pc 详情页
+{{.T.dataType}}
+{{.T.id}}

+ 1 - 0
src/web/templates/pc/dataSmt/index.html

@@ -0,0 +1 @@
+pc 落地页

+ 2 - 0
src/web/templates/pc/dataSmt/list.html

@@ -0,0 +1,2 @@
+pc 列表页
+{{.T.dataType}}

+ 3 - 0
src/web/templates/weixin/dataSmt/detail.html

@@ -0,0 +1,3 @@
+weixin 详情页
+{{.T.dataType}}
+{{.T.id}}

+ 1 - 0
src/web/templates/weixin/dataSmt/index.html

@@ -0,0 +1 @@
+weixin 落地页

+ 2 - 0
src/web/templates/weixin/dataSmt/list.html

@@ -0,0 +1,2 @@
+weixin 列表页
+{{.T.dataType}}