Browse Source

no message

xingzai 1 year ago
parent
commit
2129997829

+ 5 - 0
controllers/home.go

@@ -19,6 +19,7 @@ type BaseHomeController struct {
 // @Title 最新首页列表接口
 // @Description 最新首页列表接口
 // @Param   LabelKeyword   query   string  true       "标签关键词"
+// @Param   KeyWord   query   string  true       "搜索关键词"
 // @Param   PageSize   query   int  true       "每页数据条数"
 // @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
 // @Success 200 {object} models.HomeArtAndChartListResp
@@ -39,6 +40,7 @@ func (this *HomeController) NewList() {
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	labelKeyword := this.GetString("LabelKeyword")
+	keyWord := this.GetString("KeyWord")
 
 	var startSize int
 	if pageSize <= 0 {
@@ -102,6 +104,9 @@ func (this *HomeController) NewList() {
 		return
 	}
 	page = paging.GetPaging(currentIndex, pageSize, total)
+	if currentIndex == 1 && keyWord != "" {
+		go services.AddSearchKeyWord(user, keyWord, 1)
+	}
 	resp.Paging = page
 	resp.List = list
 	br.Ret = 200

+ 2 - 506
controllers/search.go

@@ -5,7 +5,6 @@ import (
 	"hongze/hongze_mfyx/models"
 	"hongze/hongze_mfyx/services"
 	"hongze/hongze_mfyx/utils"
-	"strings"
 )
 
 type SearchController struct {
@@ -16,517 +15,14 @@ type BaseSearchController struct {
 	BaseCommonController
 }
 
-// @Title 搜索接口
-// @Description 搜索接口
-// @Param   PageSize   query   int  true       "每页数据条数"
-// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
-// @Param   KeyWord   query   string  true       "搜索关键词"
-// @Param   OrderColumn   query   int  true       "排序字段 ,Comprehensive综合 ,Matching匹配度 ,PublishDate 发布时间 "
-// @Success 200 {object} models.SearchItem
-// @router /list [get]
-func (this *SearchController) SearchList() {
-	br := new(models.BaseResponse).Init()
-	defer func() {
-		this.Data["json"] = br
-		this.ServeJSON()
-	}()
-	pageSize, _ := this.GetInt("PageSize")
-	currentIndex, _ := this.GetInt("CurrentIndex")
-	var startSize int
-	if pageSize <= 0 {
-		pageSize = utils.PageSize20
-	}
-	if currentIndex <= 0 {
-		currentIndex = 1
-	}
-	startSize = paging.StartIndex(currentIndex, pageSize)
-	keyWord := this.GetString("KeyWord")
-	orderColumn := this.GetString("OrderColumn")
-	if keyWord == "" {
-		br.Msg = "请输入搜索词"
-		br.ErrMsg = "请输入搜索词"
-		return
-	}
-	user := this.User
-	if user == nil {
-		br.Msg = "请重新登录"
-		br.Ret = 408
-		return
-	}
-
-	//研选的五张图片
-	detailResearch, errConfig := models.GetConfigByCode("category_research_img_url")
-	if errConfig != nil {
-		br.Msg = "获取数据失败"
-		br.ErrMsg = "获取数据研选分类图片失败,Err:" + errConfig.Error()
-		return
-	}
-	researchList := strings.Split(detailResearch.ConfigValue, "{|}")
-	//对应分类的所图片
-	detailCategoryUrl, errConfig := models.GetConfigByCode("category_map_img_url")
-	if errConfig != nil {
-		br.Msg = "获取数据失败"
-		br.ErrMsg = "行业配置信息失败,Err:" + errConfig.Error()
-		return
-	}
-	categoryUrlList := strings.Split(detailCategoryUrl.ConfigValue, "{|}")
-	mapCategoryUrl := make(map[string]string)
-	var categoryId string
-	var imgUrlChart string
-	for _, v := range categoryUrlList {
-		vslice := strings.Split(v, "_")
-		categoryId = vslice[0]
-		imgUrlChart = vslice[len(vslice)-1]
-		mapCategoryUrl[categoryId] = imgUrlChart
-	}
-	if orderColumn == "" {
-		orderColumn = "Matching"
-	}
-	indexName := utils.IndexName
-	pageSize = 20
-	var result []*models.SearchItem
-	var total int64
-	var err error
-	if orderColumn == "PublishDate" {
-		tmpResult, tmpTotal, tmpErr := services.EsMultiMatchFunctionScoreQueryTimeSort(indexName, keyWord, startSize, 100, user.UserId)
-		result = tmpResult
-		total = tmpTotal
-		err = tmpErr
-	} else {
-		tmpResult, tmpTotal, tmpErr := services.EsMultiMatchFunctionScoreQuerySort(indexName, keyWord, startSize, pageSize, user.UserId, orderColumn)
-		result = tmpResult
-		total = tmpTotal
-		err = tmpErr
-	}
-	if err != nil {
-		br.Msg = "检索失败"
-		br.ErrMsg = "检索失败,Err:" + err.Error()
-		return
-	}
-	if len(result) == 0 {
-		result = make([]*models.SearchItem, 0)
-	}
-	//记录用户搜索关键词
-	go services.AddSearchKeyWord(user, keyWord, 1)
-	for k, v := range result {
-		//如果是研选系列的任意取五张图片的中的一张
-		if v.CategoryId == "0" {
-			knum := v.ArticleId % 5
-			result[k].ImgUrlPc = researchList[knum]
-		} else {
-			result[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
-		}
-	}
-	resp := new(models.SearchResp)
-	page := paging.GetPaging(currentIndex, pageSize, int(total))
-	resp.Paging = page
-	resp.List = result
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "获取成功"
-	br.Data = resp
-}
-
-//https://blog.csdn.net/my_miuye/article/details/110496025
-//search
-
-// @Title 报告搜索接口
-// @Description 报告搜索接口
-// @Param   PageSize   query   int  true       "每页数据条数"
-// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
-// @Param   KeyWord   query   string  true       "搜索关键词"
-// @Success 200 {object} models.SearchItem
-// @router /report/list [get]
-func (this *SearchController) SearchReport() {
-	br := new(models.BaseResponse).Init()
-	defer func() {
-		this.Data["json"] = br
-		this.ServeJSON()
-	}()
-	pageSize, _ := this.GetInt("PageSize")
-	currentIndex, _ := this.GetInt("CurrentIndex")
-	var startSize int
-	if pageSize <= 0 {
-		pageSize = utils.PageSize20
-	}
-	if currentIndex <= 0 {
-		currentIndex = 1
-	}
-	startSize = paging.StartIndex(currentIndex, pageSize)
-	keyWord := this.GetString("KeyWord")
-	if keyWord == "" {
-		br.Msg = "请输入搜索词"
-		br.ErrMsg = "请输入搜索词"
-		return
-	}
-	user := this.User
-	if user == nil {
-		br.Msg = "请重新登录"
-		br.Ret = 408
-		return
-	}
-	//indexName := "article_list"
-	indexName := utils.IndexName
-	pageSize = 100
-	var result []*models.SearchItem
-	var total int64
-	var err error
-	tmpResult, tmpTotal, tmpErr := services.EsSearchReport(indexName, keyWord, startSize, pageSize, user.UserId)
-	result = tmpResult
-	total = tmpTotal
-	err = tmpErr
-	if err != nil {
-		br.Msg = "检索失败"
-		br.ErrMsg = "检索失败,Err:" + err.Error()
-		return
-	}
-	if len(result) == 0 {
-		result = make([]*models.SearchItem, 0)
-	}
-	//记录用户搜索关键词
-	go services.AddSearchKeyWord(user, keyWord, 1)
-	resp := new(models.SearchResp)
-	page := paging.GetPaging(currentIndex, pageSize, int(total))
-	resp.Paging = page
-	resp.List = result
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "获取成功"
-	br.Data = resp
-}
-
-// @Title 搜索接口
-// @Description 搜索接口
-// @Param   PageSize   query   int  true       "每页数据条数"
-// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
-// @Param   KeyWord   query   string  true       "搜索关键词"
-// @Param   OrderColumn   query   int  true       "排序字段 ,Comprehensive综合 ,Matching匹配度 ,PublishDate 发布时间 "
-// @Param   ListType   query   int  true       "列表类型,1最新/全部,2 纪要 ,3图表 默认1"
-// @Success 200 {object} models.SearchItem
-// @router /artAndChart/list [get]
-func (this *SearchController) ListHomeArtAndChart() {
-	br := new(models.BaseResponse).Init()
-	defer func() {
-		this.Data["json"] = br
-		this.ServeJSON()
-	}()
-	pageSize, _ := this.GetInt("PageSize")
-	currentIndex, _ := this.GetInt("CurrentIndex")
-	listType, _ := this.GetInt("ListType")
-	var startSize int
-	if pageSize <= 0 {
-		pageSize = utils.PageSize20
-	}
-	if currentIndex <= 0 {
-		currentIndex = 1
-	}
-	startSize = paging.StartIndex(currentIndex, pageSize)
-	keyWord := this.GetString("KeyWord")
-	orderColumn := this.GetString("OrderColumn")
-	if keyWord == "" {
-		br.Msg = "请输入搜索词"
-		br.ErrMsg = "请输入搜索词"
-		return
-	}
-	user := this.User
-	if user == nil {
-		br.Msg = "请重新登录"
-		br.Ret = 408
-		return
-	}
-
-	//研选的五张图片
-	detailResearch, errConfig := models.GetConfigByCode("category_research_img_url")
-	if errConfig != nil {
-		br.Msg = "获取数据失败"
-		br.ErrMsg = "获取数据研选分类图片失败,Err:" + errConfig.Error()
-		return
-	}
-	researchList := strings.Split(detailResearch.ConfigValue, "{|}")
-	//对应分类的所图片
-	detailCategoryUrl, errConfig := models.GetConfigByCode("category_map_img_url")
-	if errConfig != nil {
-		br.Msg = "获取数据失败"
-		br.ErrMsg = "行业配置信息失败,Err:" + errConfig.Error()
-		return
-	}
-	categoryUrlList := strings.Split(detailCategoryUrl.ConfigValue, "{|}")
-	mapCategoryUrl := make(map[string]string)
-	var categoryId string
-	var imgUrlChart string
-	for _, v := range categoryUrlList {
-		vslice := strings.Split(v, "_")
-		categoryId = vslice[0]
-		imgUrlChart = vslice[len(vslice)-1]
-		mapCategoryUrl[categoryId] = imgUrlChart
-	}
-	if orderColumn == "" {
-		orderColumn = "Matching"
-	}
-	indexName := utils.IndexName
-	pageSize = 20
-	var chartTotal int
-	resp := new(models.SearchResp)
-	//page := paging.GetPaging(currentIndex, pageSize, total)
-
-	var err error
-
-	var result []*models.SearchItem
-	var total int64
-	if listType == 1 || listType == 2 {
-		if orderColumn == "PublishDate" {
-			tmpResult, tmpTotal, tmpErr := services.EsMultiMatchFunctionScoreQueryTimeSort(indexName, keyWord, startSize, 100, user.UserId)
-			result = tmpResult
-			total = tmpTotal
-			err = tmpErr
-		} else {
-			tmpResult, tmpTotal, tmpErr := services.EsMultiMatchFunctionScoreQuerySort(indexName, keyWord, startSize, pageSize, user.UserId, orderColumn)
-			result = tmpResult
-			total = tmpTotal
-			err = tmpErr
-		}
-		if err != nil {
-			br.Msg = "检索失败"
-			br.ErrMsg = "检索失败,Err:" + err.Error()
-			return
-		}
-		if len(result) == 0 {
-			result = make([]*models.SearchItem, 0)
-		}
-
-		for k, v := range result {
-			//如果是研选系列的任意取五张图片的中的一张
-			if v.CategoryId == "0" {
-				knum := v.ArticleId % 5
-				result[k].ImgUrlPc = researchList[knum]
-			} else {
-				result[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
-			}
-			result[k].Source = 1
-			result[k].PublishDate = utils.StrTimeToTime(result[k].PublishDate).Format(utils.FormatDate)
-		}
-	}
-	// ListType   query   int  true       "列表类型,1最新/全部,2 纪要 ,3图表 默认1"
-	//记录用户搜索关键词
-	var source int
-	if listType == 1 {
-		source = 3
-	} else if listType == 2 {
-		source = 1
-	} else {
-		source = 2
-	}
-	go services.AddSearchKeyWord(user, keyWord, source)
-
-	if chartTotal > int(total) {
-		total = int64(chartTotal)
-	}
-	if listType == 1 {
-		total = total + int64(chartTotal)
-	}
-	if len(result) == 0 {
-		result = make([]*models.SearchItem, 0)
-	}
-	page := paging.GetPaging(currentIndex, pageSize, int(total))
-	resp.Paging = page
-	resp.List = result
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "获取成功"
-	br.Data = resp
-}
-
-// @Title 搜索接口
-// @Description 搜索接口
-// @Param   PageSize   query   int  true       "每页数据条数"
-// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
-// @Param   KeyWord   query   string  true       "搜索关键词"
-// @Param   OrderColumn   query   int  true       "排序字段 ,Comprehensive综合 ,Matching匹配度 ,PublishDate 发布时间 "
-// @Success 200 {object} models.SearchItem
-// @router /artAndChart/listPage [get]
-func (this *SearchController) ListHomeArtAndChartPage() {
-	br := new(models.BaseResponse).Init()
-	defer func() {
-		this.Data["json"] = br
-		this.ServeJSON()
-	}()
-	pageSize, _ := this.GetInt("PageSize")
-	currentIndex, _ := this.GetInt("CurrentIndex")
-	// @Param   ListType   query   int  true       "列表类型,1最新/全部,2 纪要 ,3图表 默认1"
-	listType, _ := this.GetInt("ListType")
-	var startSize int
-	if pageSize <= 0 {
-		pageSize = utils.PageSize20
-	}
-	if currentIndex <= 0 {
-		currentIndex = 1
-	}
-	listType = 1
-	startSize = paging.StartIndex(currentIndex, pageSize)
-	keyWord := this.GetString("KeyWord")
-	orderColumn := this.GetString("OrderColumn")
-	if keyWord == "" {
-		br.Msg = "请输入搜索词"
-		br.ErrMsg = "请输入搜索词"
-		return
-	}
-	user := this.User
-	if user == nil {
-		br.Msg = "请重新登录"
-		br.Ret = 408
-		return
-	}
-
-	//研选的五张图片
-	detailResearch, errConfig := models.GetConfigByCode("category_research_img_url")
-	if errConfig != nil {
-		br.Msg = "获取数据失败"
-		br.ErrMsg = "获取数据研选分类图片失败,Err:" + errConfig.Error()
-		return
-	}
-	researchList := strings.Split(detailResearch.ConfigValue, "{|}")
-	//对应分类的所图片
-	detailCategoryUrl, errConfig := models.GetConfigByCode("category_map_img_url")
-	if errConfig != nil {
-		br.Msg = "获取数据失败"
-		br.ErrMsg = "行业配置信息失败,Err:" + errConfig.Error()
-		return
-	}
-	categoryUrlList := strings.Split(detailCategoryUrl.ConfigValue, "{|}")
-	mapCategoryUrl := make(map[string]string)
-	var categoryId string
-	var imgUrlChart string
-	for _, v := range categoryUrlList {
-		vslice := strings.Split(v, "_")
-		categoryId = vslice[0]
-		imgUrlChart = vslice[len(vslice)-1]
-		mapCategoryUrl[categoryId] = imgUrlChart
-	}
-	if orderColumn == "" {
-		orderColumn = "Matching"
-	}
-	var chartTotal int
-	resp := new(models.SearchResp)
-	var result []*models.SearchItem
-	var total int64
-	var articleIds []int
-	if listType == 1 || listType == 2 {
-		//添加映射关系
-		keyWord = strings.ToUpper(keyWord)
-		keyWordDetail, _ := models.GetCygxCygxIkWordMapDetail(keyWord)
-		if keyWordDetail != nil {
-			keyWord = keyWordDetail.KeyWordMap
-		}
-		_, tmpTotal, err := services.EsArticleSearch(keyWord, startSize, pageSize, orderColumn, 0)
-		if err != nil {
-			br.Msg = "检索失败"
-			br.ErrMsg = "检索失败,Err:" + err.Error()
-			return
-		}
-		tmpResult, tmpTotalResult, err := services.EsArticleSearchBody(keyWord, startSize, pageSize, orderColumn, 1)
-		if err != nil {
-			br.Msg = "检索失败"
-			br.ErrMsg = "检索失败,Err:" + err.Error()
-			return
-		}
-		result = tmpResult
-		if int(tmpTotalResult) < currentIndex*pageSize {
-			startSizeBody := startSize - int(tmpTotalResult)
-			if startSizeBody < 0 {
-				startSizeBody = 0
-			}
-			var pageSizeBody int
-			pageSizeBody = pageSize - len(tmpResult)
-			tmpResultBody, tmpTotalBody, err := services.EsArticleSearchBody(keyWord, startSizeBody, pageSizeBody, orderColumn, 2)
-			if err != nil {
-				br.Msg = "检索失败"
-				br.ErrMsg = "检索失败,Err:" + err.Error()
-				return
-			}
-			for _, v := range tmpResultBody {
-				result = append(result, v)
-			}
-			tmpTotalResult += tmpTotalBody
-		}
-
-		if int(tmpTotalResult) < currentIndex*pageSize {
-			startSizeIk := startSize - int(tmpTotalResult)
-			if startSizeIk < 0 {
-				startSizeIk = 0
-			}
-			var pageSizeIk int
-			pageSizeIk = pageSize - len(result)
-			tmpResultIk, _, err := services.EsArticleSearch(keyWord, startSizeIk, pageSizeIk, orderColumn, 2)
-			if err != nil {
-				br.Msg = "检索失败"
-				br.ErrMsg = "检索失败,Err:" + err.Error()
-				return
-			}
-			for _, v := range tmpResultIk {
-				result = append(result, v)
-			}
-		}
-		total = tmpTotal
-		if len(result) == 0 {
-			result = make([]*models.SearchItem, 0)
-		}
-
-		for k, v := range result {
-			//如果是研选系列的任意取五张图片的中的一张
-			if v.CategoryId == "0" {
-				knum := v.ArticleId % 5
-				result[k].ImgUrlPc = researchList[knum]
-			} else {
-				result[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
-			}
-			result[k].Source = 1
-			v.PublishDate = utils.TimeRemoveHms(v.PublishDate)
-			articleIds = append(articleIds, v.ArticleId)
-		}
-	}
-	//记录用户搜索关键词
-	//var source int
-	//if listType == 1 {
-	//	source = 3
-	//} else if listType == 2 {
-	//	source = 1
-	//} else {
-	//	source = 2
-	//}
-
-	if chartTotal > int(total) {
-		total = int64(chartTotal)
-	}
-	if listType == 1 {
-		total = total + int64(chartTotal)
-	}
-	if len(result) == 0 {
-		result = make([]*models.SearchItem, 0)
-	} else {
-		yxArticleIdMap := services.GetYxArticleIdMap(articleIds)
-		articleMapPv := services.GetArticleHistoryByArticleId(articleIds) //文章Pv
-		for _, v := range result {
-			v.IsResearch = yxArticleIdMap[v.ArticleId] // 添加是否属于研选的标识
-			v.Pv = articleMapPv[v.ArticleId]           // Pv
-		}
-	}
-	page := paging.GetPaging(currentIndex, pageSize, int(total))
-	resp.Paging = page
-	resp.List = result
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "获取成功"
-	br.Data = resp
-}
-
 // @Title 综合搜索接口
 // @Description 综合搜索接口
 // @Param   PageSize   query   int  true       "每页数据条数"
 // @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
 // @Param   KeyWord   query   string  true       "搜索关键词"
 // @Success 200 {object} models.SearchItem
-// @router /comprehensive/list [get]
-func (this *SearchController) ComprehensiveList() {
+// @router /list [get]
+func (this *SearchController) List() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
 		this.Data["json"] = br

+ 0 - 28
models/about_us_video_history.go

@@ -1,28 +0,0 @@
-package models
-
-import (
-	"github.com/beego/beego/v2/client/orm"
-	"time"
-)
-
-type CygxAboutUsVideoHistory struct {
-	Id               int `orm:"column(id);pk"`
-	UserId           int
-	CreateTime       time.Time
-	Mobile           string    `description:"手机号"`
-	Email            string    `description:"邮箱"`
-	CompanyId        int       `description:"公司id"`
-	CompanyName      string    `description:"公司名称"`
-	ModifyTime       time.Time `description:"修改时间"`
-	RealName         string    `description:"用户实际名称"`
-	SellerName       string    `description:"所属销售"`
-	RegisterPlatform int       `description:"来源 1小程序,2:网页"`
-}
-
-// 添加历史信息
-func AddCygxAboutUsVideoHistory(item *CygxAboutUsVideoHistory) (lastId int64, err error) {
-	o := orm.NewOrm()
-	item.ModifyTime = time.Now()
-	lastId, err = o.Insert(item)
-	return
-}

+ 0 - 1
models/db.go

@@ -140,7 +140,6 @@ func init() {
 		new(CygxArticleCategoryMapping),
 		new(CygxReportMappingCygx),
 		new(CygxReportMappingGroup),
-		new(CygxAboutUsVideoHistory),
 		new(CygxActivitySignin),
 		new(CygxActivitySigninLog),
 		new(CygxActivityOfflineMeetingDetail),

+ 10 - 9
models/search_key_word.go

@@ -6,15 +6,16 @@ import (
 )
 
 type CygxSearchKeyWord struct {
-	Id          int `orm:"column(id);" description:"id"`
-	KeyWord     string
-	UserId      int
-	CreateTime  time.Time
-	Mobile      string `description:"手机号"`
-	Email       string `description:"邮箱"`
-	CompanyId   int    `description:"公司id"`
-	CompanyName string `description:"公司名称"`
-	RealName    string `description:"用户实际名称"`
+	Id               int `orm:"column(id);" description:"id"`
+	KeyWord          string
+	UserId           int
+	CreateTime       time.Time
+	Mobile           string `description:"手机号"`
+	Email            string `description:"邮箱"`
+	CompanyId        int    `description:"公司id"`
+	CompanyName      string `description:"公司名称"`
+	RealName         string `description:"用户实际名称"`
+	RegisterPlatform int    // 来源 1小程序,2:网页、5:研选小程序
 }
 
 // 新增搜索

+ 10 - 37
routers/commentsRouter.go

@@ -277,6 +277,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:IndustryController"] = append(beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:IndustryController"],
+        beego.ControllerComments{
+            Method: "Fllow",
+            Router: `/follow`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:ResearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:ResearchController"],
         beego.ControllerComments{
             Method: "ArticleHotList",
@@ -378,49 +387,13 @@ func init() {
 
     beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"],
         beego.ControllerComments{
-            Method: "ListHomeArtAndChart",
-            Router: `/artAndChart/list`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
-
-    beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"],
-        beego.ControllerComments{
-            Method: "ListHomeArtAndChartPage",
-            Router: `/artAndChart/listPage`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
-
-    beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"],
-        beego.ControllerComments{
-            Method: "ComprehensiveList",
-            Router: `/comprehensive/list`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
-
-    beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"],
-        beego.ControllerComments{
-            Method: "SearchList",
+            Method: "List",
             Router: `/list`,
             AllowHTTPMethods: []string{"get"},
             MethodParams: param.Make(),
             Filters: nil,
             Params: nil})
 
-    beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:SearchController"],
-        beego.ControllerComments{
-            Method: "SearchReport",
-            Router: `/report/list`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
-
     beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:TagController"] = append(beego.GlobalControllerRouter["hongze/hongze_mfyx/controllers:TagController"],
         beego.ControllerComments{
             Method: "ListLabel",

+ 1 - 5
services/keyword.go

@@ -10,11 +10,6 @@ import (
 
 // AddSearchKeyWord 记录用户搜索关键词
 func AddSearchKeyWord(user *models.WxUserItem, keyWord string, source int) (err error) {
-	//cacheKey := fmt.Sprint("Search_uid:", user.UserId, "_KeyWord:", keyWord, "_Source:", source)
-	//isExist := utils.Rc.IsExist(cacheKey)
-	//if isExist {
-	//	return err
-	//}
 	defer func() {
 		if err != nil {
 			go utils.SendAlarmMsg(" 记录用户搜索关键词失败"+err.Error(), 2)
@@ -30,6 +25,7 @@ func AddSearchKeyWord(user *models.WxUserItem, keyWord string, source int) (err
 	keyWordItem.CompanyId = user.CompanyId
 	keyWordItem.CompanyName = user.CompanyName
 	keyWordItem.RealName = user.RealName
+	keyWordItem.RegisterPlatform = utils.REGISTER_PLATFORM
 	_, err = models.AddSearchKeyWord(keyWordItem)
 	go AddUserSearchLog(user, keyWord, source)
 	go SearchKeywordUserRmind(user, keyWord)