1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package controller
- import (
- "fmt"
- "github.com/gogf/gf/v2/frame/g"
- "github.com/gogf/gf/v2/net/ghttp"
- "jyseo/internal/consts"
- "jyseo/internal/service"
- )
- func PinyinIndexHandler(r *ghttp.Request) {
- service.HtmlRender.Render(r, "keywordPinyin_index.html",
- g.Map{
- "nodeList": service.JySeoKeyWordPinyinRoot.GetPinyinNodeByIndustry(),
- "showSort": service.JySeoKeyWordPinyinRoot.GetPinyinIndustryShowSort(),
- })
- }
- // PinyinHandler 行业拼音关键词列表页面
- func PinyinHandler(r *ghttp.Request) {
- pinyinCode := r.Get("pinyinCode").String()
- pinyinNode := service.JySeoKeyWordPinyinRoot.GetPinyinNode(pinyinCode)
- if pinyinNode == nil {
- service.HtmlRender.NotFound(r)
- return
- }
- // 查询数据
- query := service.NewBiddingQuery().EquipKeyWord(pinyinNode.Name).EquipIndustry(pinyinNode.Industry, "")
- rData, err := query.GetOnceData(r.Context(), consts.KeyWordPinyinMaxTotal, "PinyinHandler", service.JySeoKeyWordPinyinRoot.GetData)
- if err != nil {
- g.Log().Errorf(r.Context(), err.Error())
- service.HtmlRender.RenderError(r, fmt.Errorf("获取列表数据异常"))
- return
- }
- service.HtmlRender.Render(r, "keywordPinyin_list.html",
- g.Map{
- "list": rData,
- "pinyinNode": pinyinNode,
- "tdk": service.JySeoTdk.GetKeyWordPinyinListTdk(r.Context(), pinyinNode.Name),
- })
- }
|