Merge pull request 'by Robin at 20240514' (#436) from feat-IRONFANS-117-Robin into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/436
This commit is contained in:
chenhao 2024-05-14 22:44:12 +08:00
commit 75338ff450
4 changed files with 9 additions and 15 deletions

View File

@ -23,8 +23,7 @@ const (
)
type ElasticSearch struct {
clientMix *elastic.Client
indexsuffix string
clientMix *elastic.Client
}
func NewElasticSearch(cfg *conf.ConfigSt) (es *ElasticSearch, err error) {
@ -36,8 +35,6 @@ func NewElasticSearch(cfg *conf.ConfigSt) (es *ElasticSearch, err error) {
return
}
es.indexsuffix = cfg.ElasticSearch.IndexSuffix
return
}
@ -47,7 +44,7 @@ const (
)
func (es *ElasticSearch) getIndexStreamerAcct() string {
return IndexStreamerAcct + es.indexsuffix
return IndexStreamerAcct
}
func (es *ElasticSearch) CreateStreamerAcct(ctx *gin.Context, streameraccts []*dbstruct.EsStreamerAcct) error {

View File

@ -142,5 +142,4 @@ elastic_search:
uri: "http://172.31.37.67:9200"
username: "elastic"
password: "Wishpal@2024"
sniff: false
index_suffix: "_prod"
sniff: false

View File

@ -140,8 +140,7 @@ ding_talk_robot:
secret: "SECcc49257b2681b6488ab4be8ee815c61027a7254e2be3239c229de38b22207b5b"
elastic_search:
uri: "http://172.31.37.67:9200"
uri: "http://127.0.0.1:9200"
username: "elastic"
password: "Wishpal@2024"
sniff: false
index_suffix: "_test"
sniff: false

View File

@ -167,11 +167,10 @@ type XxlJobConfig struct {
// elasticsearch服务配置
type ElasticSearchConfig struct {
Uri string `json:"uri" yaml:"uri"` // 实例地址
Username string `json:"username" yaml:"username"` // 用户名
Password string `json:"password" yaml:"password"` // 密码
Sniff bool `json:"sniff" yaml:"sniff"` // sniffer
IndexSuffix string `json:"index_suffix" yaml:"index_suffix"` // 索引后缀
Uri string `json:"uri" yaml:"uri"` // 实例地址
Username string `json:"username" yaml:"username"` // 用户名
Password string `json:"password" yaml:"password"` // 密码
Sniff bool `json:"sniff" yaml:"sniff"` // sniffer
}
func LoadConfig(configFilePath string, cfg interface{}) error {