feat: add message audit foundation
This commit is contained in:
@@ -60,6 +60,7 @@ func (s *Server) ask(w http.ResponseWriter, r *http.Request) {
|
||||
ExternalUserID string `json:"external_user_id"`
|
||||
ExternalMessageID string `json:"external_message_id"`
|
||||
SenderName string `json:"sender_name"`
|
||||
MessageType string `json:"message_type"`
|
||||
Query string `json:"query"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&request); err != nil {
|
||||
@@ -70,7 +71,7 @@ func (s *Server) ask(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
return
|
||||
}
|
||||
result, err := s.service.Ask(r.Context(), core.QARequest{TenantKey: request.TenantKey, Channel: request.Channel, ConversationType: request.ConversationType, ExternalChatID: request.ExternalChatID, ExternalUserID: request.ExternalUserID, ExternalMessageID: request.ExternalMessageID, SenderName: request.SenderName, Query: request.Query})
|
||||
result, err := s.service.Ask(r.Context(), core.QARequest{TenantKey: request.TenantKey, Channel: request.Channel, ConversationType: request.ConversationType, ExternalChatID: request.ExternalChatID, ExternalUserID: request.ExternalUserID, ExternalMessageID: request.ExternalMessageID, SenderName: request.SenderName, MessageType: request.MessageType, Query: request.Query})
|
||||
if err != nil {
|
||||
if errors.Is(err, core.ErrTurnInProgress) {
|
||||
writeError(w, http.StatusConflict, "message is already processing")
|
||||
|
||||
Reference in New Issue
Block a user