将redis的db修改为11,api/es/updateBookFieldsByISBN 接口 page_count与word_count 设置为可更新的字段
This commit is contained in:
parent
0546fce601
commit
5abefc21a9
7
build.bat
Normal file
7
build.bat
Normal 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
|
||||||
@ -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 字段
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user