feat:完善项目信息

This commit is contained in:
henry
2022-01-20 11:51:02 +08:00
parent 9348c8970c
commit b87cd837be
23 changed files with 86 additions and 83 deletions

View File

@ -2,7 +2,6 @@ package service
import (
"SciencesServer/serve/es"
"SciencesServer/serve/logger"
"encoding/json"
"fmt"
)
@ -28,7 +27,7 @@ func (this *ESPatent) Update() error {
return nil
}
func (this *ESPatent) Search(page, pageSize int) (interface{}, error) {
func (this *ESPatent) Search(page, pageSize int) (interface{}, int64, error) {
termParams := make(map[string]interface{}, 0)
mustParams := make(map[string]interface{}, 0)
@ -38,15 +37,10 @@ func (this *ESPatent) Search(page, pageSize int) (interface{}, error) {
if this.Industry != "" {
termParams["industry"] = this.Industry
}
out, err := es.Search(this, this.Index(), &es.SearchParams{
return es.Search(this, this.Index(), &es.SearchParams{
TermParams: termParams,
MustParams: mustParams,
}, page, pageSize)
if err != nil {
logger.ErrorF("查询ES信息错误【%s】", err)
}
return out, nil
}
func WithPatentID(id uint64) ESPatentOption {