优化HTTP请求处理和模块租户检查逻辑:支持GET请求参数转换,简化日志消费者配置,改进RPC调用方式
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user