将redis的db修改为11,api/es/updateBookFieldsByISBN 接口 page_count与word_count 设置为可更新的字段

This commit is contained in:
ShenQiLun 2026-07-01 17:41:55 +08:00
parent 0546fce601
commit 5abefc21a9
4 changed files with 12 additions and 5 deletions

7
build.bat Normal file
View File

@ -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

View File

@ -47,8 +47,8 @@ func GetESFieldConfig() *ESFieldConfig {
"is_return": true, "is_return": true,
"is_filter": true, "is_filter": true,
"update_time": true, "update_time": true,
//"page_count": true, "page_count": true,
//"word_count": true, "word_count": true,
//"book_format": true, //"book_format": true,
"cat_id": true, "cat_id": true,
"other": true, // 允许更新 other 字段 "other": true, // 允许更新 other 字段

View File

@ -2301,7 +2301,7 @@ func (svc *ESSearchService) SearchBooksHandler(c *gin.Context) {
endpoint := c.FullPath() endpoint := c.FullPath()
// 获取监控的 Redis 客户端 // 获取监控的 Redis 客户端
db1Client, err := redisClient.GetClientByName("db1") db1Client, err := redisClient.GetClientByName("db11")
if err == nil { if err == nil {
monitoredRedis := monitor.NewMonitoredRedisClient(db1Client, endpoint) monitoredRedis := monitor.NewMonitoredRedisClient(db1Client, endpoint)
val, _, err := monitoredRedis.Get(ctx, isbn) val, _, err := monitoredRedis.Get(ctx, isbn)
@ -2353,7 +2353,7 @@ func (svc *ESSearchService) SearchBookByISBNHandler(c *gin.Context) {
endpoint := c.FullPath() endpoint := c.FullPath()
// Redis 查询(使用监控) // Redis 查询(使用监控)
db1Client, err := redisClient.GetClientByName("db1") db1Client, err := redisClient.GetClientByName("db11")
if err == nil { if err == nil {
monitoredRedis := monitor.NewMonitoredRedisClient(db1Client, endpoint) monitoredRedis := monitor.NewMonitoredRedisClient(db1Client, endpoint)
val, _, err := monitoredRedis.Get(ctx, isbn) val, _, err := monitoredRedis.Get(ctx, isbn)

View File

@ -850,7 +850,7 @@ func (svc *BookService) addBookToES(ctx context.Context, req *es.ESBook) (*es.ES
// SyncRedisByISBN 同步到Redis // SyncRedisByISBN 同步到Redis
func (svc *BookService) SyncRedisByISBN(isbn string, act string) error { func (svc *BookService) SyncRedisByISBN(isbn string, act string) error {
client, err := redisClient.GetClientByName("db1") client, err := redisClient.GetClientByName("db11")
if err != nil { if err != nil {
log.Printf("[SyncRedisByISBN] 获取 Redis 客户端失败:%v", err) log.Printf("[SyncRedisByISBN] 获取 Redis 客户端失败:%v", err)
return err return err