feat:完善项目
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"SciencesServer/serve/es"
|
||||
"SciencesServer/serve/logger"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ESPatent struct {
|
||||
@ -20,7 +21,11 @@ func (this *ESPatent) Index() string {
|
||||
|
||||
func (this *ESPatent) Create() error {
|
||||
_bytes, _ := json.Marshal(this)
|
||||
return es.Create(this.Index(), _bytes)
|
||||
return es.Create(this.Index(), fmt.Sprintf("%d", this.ID), _bytes)
|
||||
}
|
||||
|
||||
func (this *ESPatent) Update() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *ESPatent) Search(page, pageSize int) (interface{}, error) {
|
||||
|
Reference in New Issue
Block a user