From 7ab0b8ae82dd729c6bd3d6fbf1b349ab3491b9dc Mon Sep 17 00:00:00 2001 From: Leufolium Date: Tue, 14 May 2024 22:43:52 +0800 Subject: [PATCH] by Robin at 20240514 --- app/mix/dao/elasticsearch.go | 7 ++----- etc/mix/mix-prod.yaml | 3 +-- etc/mix/mix-test.yaml | 5 ++--- library/configcenter/configcenter.go | 9 ++++----- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/app/mix/dao/elasticsearch.go b/app/mix/dao/elasticsearch.go index 99c54100..3bee31ce 100644 --- a/app/mix/dao/elasticsearch.go +++ b/app/mix/dao/elasticsearch.go @@ -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 { diff --git a/etc/mix/mix-prod.yaml b/etc/mix/mix-prod.yaml index 411175b6..a1b66eb1 100644 --- a/etc/mix/mix-prod.yaml +++ b/etc/mix/mix-prod.yaml @@ -142,5 +142,4 @@ elastic_search: uri: "http://172.31.37.67:9200" username: "elastic" password: "Wishpal@2024" - sniff: false - index_suffix: "_prod" \ No newline at end of file + sniff: false \ No newline at end of file diff --git a/etc/mix/mix-test.yaml b/etc/mix/mix-test.yaml index 7234c8c8..d25f9085 100644 --- a/etc/mix/mix-test.yaml +++ b/etc/mix/mix-test.yaml @@ -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" \ No newline at end of file + sniff: false \ No newline at end of file diff --git a/library/configcenter/configcenter.go b/library/configcenter/configcenter.go index e38dc496..ae463e08 100644 --- a/library/configcenter/configcenter.go +++ b/library/configcenter/configcenter.go @@ -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 {