|
@@ -2,6 +2,7 @@ package service
|
|
|
|
|
|
import (
|
|
import (
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "sfbase/core"
|
|
"sfbase/global"
|
|
"sfbase/global"
|
|
"sfis/db"
|
|
"sfis/db"
|
|
)
|
|
)
|
|
@@ -9,9 +10,11 @@ import (
|
|
func ProjectDetailData(id string) map[string]interface{} {
|
|
func ProjectDetailData(id string) map[string]interface{} {
|
|
global.Logger.Info("id " + id)
|
|
global.Logger.Info("id " + id)
|
|
data := map[string]interface{}{}
|
|
data := map[string]interface{}{}
|
|
- query := `{"query":{"bool":{"must":[{"term":{"id":"%s"}}],"must_not":[],"should":[]}}}`
|
|
|
|
- querys := fmt.Sprintf(query, id)
|
|
|
|
- infos := db.Es.Get(INDEX, TYPE, querys)
|
|
|
|
|
|
+ _query := `{"query":{"bool":{"must":[{"term":{"id":"%s"}}],"must_not":[],"should":[]}}}`
|
|
|
|
+ query := fmt.Sprintf(_query, id)
|
|
|
|
+ INDEX := core.GetStringConf("es.project.index")
|
|
|
|
+ TYPE := core.GetStringConf("es.project.itype")
|
|
|
|
+ infos := db.Es.Get(INDEX, TYPE, query)
|
|
if infos != nil && len(*infos) > 0 {
|
|
if infos != nil && len(*infos) > 0 {
|
|
data = (*infos)[0]
|
|
data = (*infos)[0]
|
|
}
|
|
}
|