feat:优化项目信息
This commit is contained in:
@ -20,9 +20,6 @@ func (this *ESAchievement) Index() string {
|
||||
}
|
||||
|
||||
func (this *ESAchievement) Create() error {
|
||||
if this.Industry != "" {
|
||||
this.Title = this.Industry + " - " + this.Title
|
||||
}
|
||||
_bytes, _ := json.Marshal(this)
|
||||
return es.Create(this.Index(), fmt.Sprintf("%d", this.ID), _bytes)
|
||||
}
|
||||
|
14
app/service/es_test.go
Normal file
14
app/service/es_test.go
Normal file
@ -0,0 +1,14 @@
|
||||
package service
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestESAchievement_Create(t *testing.T) {
|
||||
manage := NewESAchievement(
|
||||
WithAchievementID(1),
|
||||
WithAchievementTitle("测试一"),
|
||||
WithAchievementIndustry("测试测试"),
|
||||
WithAchievementKeyword("关键词1;关键词2"),
|
||||
)
|
||||
err := manage.Create()
|
||||
t.Log(err)
|
||||
}
|
Reference in New Issue
Block a user