123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- package cmd
- import (
- "context"
- "github.com/gogf/gf/v2/frame/g"
- "github.com/gogf/gf/v2/net/ghttp"
- "github.com/gogf/gf/v2/os/gcmd"
- "jyseo/internal/controller"
- "jyseo/internal/logic/middleware"
- "jyseo/internal/service"
- _ "jyseo/internal/service"
- _ "jyseo/internal/tags"
- _ "jyseo/utility"
- )
- var (
- Main = gcmd.Command{
- Name: "main",
- Usage: "main",
- Brief: "start http jyseo server",
- Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
- s := g.Server()
- middleware.SaveLogTask()
- s.BindMiddlewareDefault(
- service.Middleware().Log, //访问日志
- service.Middleware().SetSeoRefer, // SetSeoRefer seo来源标记
- )
- s.Group("/", func(group *ghttp.RouterGroup) {
- group.GET("/jyseo/index.html", controller.IndexHandler) //首页
- s.Group("/list", func(group *ghttp.RouterGroup) {
- group.GET("/area/{areaCode}.html", controller.AreaIndexHandler) //地区首页
- group.GET("/city/{areaCode}.html", controller.AreaIndexHandler) //地区首页
- group.GET("/{type}/{areaCode}_{sId}/", controller.AreaPageHandler) //地区列表页面
- group.GET("/{type}/{areaCode}_{sId}/p{pageNum}", controller.AreaPageHandler) //地区列表页面
- group.GET("/stype/{code}.html", controller.STypePageHandler) //信息类型
- group.GET("/stype/{code}/p{pageNum}", controller.STypePageHandler) //信息类型
- group.GET("/industry/{industryCode}.html", controller.ListIndustryHandler) //行业列表
- group.GET("/{code}/", controller.SignPageHandler) //项目标签列表
- group.GET("/{code}/p{pageNum}", controller.SignPageHandler) //项目标签列表
- group.GET("/area/", controller.SiteAreaIndexHandler) //site省份汇总页
- group.GET("/city/", controller.SiteCityIndexHandler) //site城市汇总页
- group.GET("/area/{areaCode}_S{siteCode}/", controller.SiteHandler) //site关键词列表页面-省
- group.GET("/city/{areaCode}_{cityCode}_S{siteCode}/", controller.SiteHandler) //site关键词列表页面-市
- group.GET("/city/{areaCode}_{cityCode}_{districtCode}_S{siteCode}/", controller.SiteHandler) //site关键词列表页面-区县
- group.GET("/", controller.PinyinIndexHandler) //行业拼音关键词聚合页
- group.GET("/keywords/{pinyinCode}.html", controller.PinyinHandler) //行业拼音关键词列表页面
- group.GET("/{hyCode}_{kwId}.html", controller.KeywordLandingListHandler) //landing关键词列表页
- })
- s.Group("/tags", func(group *ghttp.RouterGroup) {
- group.GET("/industry/all.html", controller.IndustryIndexHandler) //行业首页
- group.GET("/industry/{industryClassId}_all_all_{keyWordId}.html", controller.IndustryListHandler) //行业列表
- group.GET("/industry/{industryClassId}_all_all_{keyWordId}_{pageNum}.html", controller.IndustryListHandler) //行业列表
- group.GET("/letter/{letterCode}_{pageNum}.html", controller.LetterIndexHandler) //字母标签页
- group.GET("/letter/{industryClassId}_{areaCode}_{sTypeId}_{letterCode}_{keywordCode}.html", controller.LetterListHandler) //字母列表页
- group.GET("/pt_{code}.html", controller.TagsPtHandler) //平台
- group.GET("/gs_{code}.html", controller.TagsGsHandler) //公司
- })
- // 行业报告
- s.Group("/hybg", func(group *ghttp.RouterGroup) {
- group.GET("/", controller.HybgIndexHandler) //行业报告首页
- group.GET("/{matchCode}/", controller.HybgListHandler) //行业报告列表页
- group.GET("/{matchCode}_{pageNum}/", controller.HybgListHandler) //行业报告列表页
- group.GET("/{keyword}/{dataCode}.html", controller.HybgListHandler) //行业报告关键词
- group.GET("/{detailId}.html", controller.HybgDetailHandler) //行业报告三级页
- group.POST("/marketAnalysis/analysisAudit", controller.AnalysisAudit) //中标企业详情
- })
- // 服务专栏
- s.Group("/fuwu", func(group *ghttp.RouterGroup) {
- group.GET("/", controller.FwIndexHandler) //服务专栏首页
- group.GET("/{fuWuCode}.html", controller.FwKeywordIndexHandler) //服务专栏关键词首页
- group.GET("/{fuWuCode}_{areaCode}.html", controller.FwKeywordAreaListHandler) //关键词地区列表页面
- })
- group.GET("/dw/", controller.EnterpriseList) //采购单位列表
- group.GET("/dw/p{pageNum}", controller.EnterpriseList) //采购单位列表
- group.GET("/dw/{seoId}.html", controller.EnterpriseDetail) //采购单位详情
- group.GET("/qy/", controller.EnterpriseList) //中标企业列表
- group.GET("/qy/p{pageNum}", controller.EnterpriseList) //中标企业列表
- group.GET("/qy/{seoId}.html", controller.EnterpriseDetail) //中标企业详情
- group.GET("/nologin/{stype}/*any", controller.DetailHandler) //标讯详情
- group.GET("/promotional/{code}.html", controller.DebrisProductHandler) //碎片化小程序
- })
- s.AddStaticPath("/jyseo", "/resource/staticres") //静态资源
- s.Run()
- return nil
- },
- }
- )
|