feat:完善项目信息
This commit is contained in:
@ -2,7 +2,6 @@ package service
|
||||
|
||||
import (
|
||||
"SciencesServer/serve/es"
|
||||
"SciencesServer/serve/logger"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
@ -30,7 +29,7 @@ func (this *ESManage) Create() error {
|
||||
return es.Create(this.Index(), fmt.Sprintf("%d", this.ID), _bytes)
|
||||
}
|
||||
|
||||
func (this *ESManage) Search(page, pageSize int, params map[string]interface{}) (interface{}, error) {
|
||||
func (this *ESManage) Search(page, pageSize int, params map[string]interface{}) (interface{}, int64, error) {
|
||||
termParams := make(map[string]interface{}, 0)
|
||||
shouldParams := make(map[string]interface{}, 0)
|
||||
|
||||
@ -51,15 +50,10 @@ func (this *ESManage) Search(page, pageSize int, params map[string]interface{})
|
||||
shouldParams[k] = v
|
||||
}
|
||||
}
|
||||
out, err := es.Search(this, this.Index(), &es.SearchParams{
|
||||
return es.Search(this, this.Index(), &es.SearchParams{
|
||||
TermParams: termParams,
|
||||
ShouldParams: shouldParams,
|
||||
}, page, pageSize)
|
||||
|
||||
if err != nil {
|
||||
logger.ErrorF("查询ES信息错误:【%s】", err)
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func WithManageID(id uint64) ESManageOption {
|
||||
|
Reference in New Issue
Block a user