feat:优化项目信息

This commit is contained in:
henry
2022-02-08 11:05:47 +08:00
parent 252182f089
commit 46476267aa
13 changed files with 125 additions and 37 deletions

View File

@ -33,13 +33,27 @@ func _new() *elastic.Client {
return client
}
type ESAchievement struct {
ID uint64 `json:"id"` // 成果ID
Title string `json:"title"` // 成果名称
Industry string `json:"industry"` // 行业领域
Keyword string `json:"keyword"` // 关键词
}
func TestNewInstanceCreate(t *testing.T) {
client := _new()
//client.Delete()
src := Student{ID: 2, Name: "henry", Age: 28}
client.Index().Index("student").Id(fmt.Sprintf("%d", src.ID)).BodyJson(utils.AnyToJSON(src)).
//src := Student{ID: 2, Name: "henry", Age: 28}
src := &ESAchievement{
ID: 6,
Title: "测试6",
Industry: "测试测试",
Keyword: "关键词1关键词2",
}
_, err := client.Index().Index("es_achievement_index").Id(fmt.Sprintf("%d", src.ID)).BodyJson(utils.AnyToJSON(src)).
Do(context.Background())
t.Log(err)
}
func TestNewInstanceUpdate(t *testing.T) {