diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..8698536 --- /dev/null +++ b/build.bat @@ -0,0 +1,7 @@ +@cd /d %~dp0 +SET CGO_ENABLED=0 +SET GOOS=linux +SET GOARCH=amd64 +SET GIN_MODE=release +go build -ldflags="-s -w" +pause \ No newline at end of file diff --git a/es/es_config.go b/es/es_config.go index ee4765f..61a4e1a 100644 --- a/es/es_config.go +++ b/es/es_config.go @@ -47,8 +47,8 @@ func GetESFieldConfig() *ESFieldConfig { "is_return": true, "is_filter": true, "update_time": true, - //"page_count": true, - //"word_count": true, + "page_count": true, + "word_count": true, //"book_format": true, "cat_id": true, "other": true, // 允许更新 other 字段 diff --git a/es/es_search.go b/es/es_search.go index df3e785..092fdbf 100644 --- a/es/es_search.go +++ b/es/es_search.go @@ -2301,7 +2301,7 @@ func (svc *ESSearchService) SearchBooksHandler(c *gin.Context) { endpoint := c.FullPath() // 获取监控的 Redis 客户端 - db1Client, err := redisClient.GetClientByName("db1") + db1Client, err := redisClient.GetClientByName("db11") if err == nil { monitoredRedis := monitor.NewMonitoredRedisClient(db1Client, endpoint) val, _, err := monitoredRedis.Get(ctx, isbn) @@ -2353,7 +2353,7 @@ func (svc *ESSearchService) SearchBookByISBNHandler(c *gin.Context) { endpoint := c.FullPath() // Redis 查询(使用监控) - db1Client, err := redisClient.GetClientByName("db1") + db1Client, err := redisClient.GetClientByName("db11") if err == nil { monitoredRedis := monitor.NewMonitoredRedisClient(db1Client, endpoint) val, _, err := monitoredRedis.Get(ctx, isbn) diff --git a/service/book.go b/service/book.go index e501ae5..df3554e 100644 --- a/service/book.go +++ b/service/book.go @@ -850,7 +850,7 @@ func (svc *BookService) addBookToES(ctx context.Context, req *es.ESBook) (*es.ES // SyncRedisByISBN 同步到Redis func (svc *BookService) SyncRedisByISBN(isbn string, act string) error { - client, err := redisClient.GetClientByName("db1") + client, err := redisClient.GetClientByName("db11") if err != nil { log.Printf("[SyncRedisByISBN] 获取 Redis 客户端失败:%v", err) return err