优化HTTP请求处理和模块租户检查逻辑:支持GET请求参数转换,简化日志消费者配置,改进RPC调用方式

This commit is contained in:
2026-03-12 08:51:59 +08:00
committed by admin
parent dd2cba70f6
commit 62dab53108
4 changed files with 50 additions and 13 deletions
+4 -5
View File
@@ -16,10 +16,9 @@ const (
)
// 消费者配置(从 Redis Stream 消费请求)
const StreamKey = "log:%s" // 请求 Stream 键名(与发消息的key一致)
const GroupName = "log:consumer:group" // 消费者
const ConsumerName = "message-consumer-1" // 消费者名称(唯一标识
const BatchSize = 1 // 批处理大小(每次读取1条
const AutoAck = true // ACK是否自动确认(true自动确认,false不确认)
const StreamKey = "log:%s" // 请求 Stream 键名(与发消息的key一致)
const ConsumerName = "log-consumer" // 消费者名称(唯一标识)
const BatchSize = 1 // 批处理大小(每次读取1条
const AutoAck = true // ACK是否自动确认(true自动确认,false不确认
const LogSubject = "log:subject"
+2 -1
View File
@@ -15,7 +15,8 @@ type operationLog struct{}
// OperationLog 操作日志服务
var OperationLog = &operationLog{}
func (s *operationLog) AddOperationLog(ctx context.Context, msg map[string]interface{}) error {
func (s *operationLog) AddOperationLog(ctx context.Context, msgData any) error {
msg := gconv.MapStrStr(msgData)
serviceName := gconv.String(msg["service_name"])
collection := gconv.String(msg["collection"])
collectionId := gconv.Strings(msg["collection_id"])