Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
speech_nlu_parse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵文静
speech_nlu_parse
Commits
b9a86129
Commit
b9a86129
authored
May 20, 2025
by
赵文静
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'test'
修复相关问题 See merge request
!2
parents
cf7e71c6
5cc11c43
Pipeline
#5241
passed with stage
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
5 deletions
+30
-5
model/speech.go
model/speech.go
+6
-0
service/speechNlu/domain.go
service/speechNlu/domain.go
+18
-0
service/speechNlu/news.go
service/speechNlu/news.go
+3
-3
service/speechNlu/rabbitmq.go
service/speechNlu/rabbitmq.go
+2
-2
service/speechNlu/register.go
service/speechNlu/register.go
+1
-0
No files found.
model/speech.go
View file @
b9a86129
package
model
import
"encoding/json"
type
SpeechDomainParams
struct
{
SpeechWsResp
*
SpeechWsResp
Query
string
...
...
@@ -121,3 +123,7 @@ type Result struct {
Year
int
`json:"year"`
Event
string
`json:"event"`
}
type
ExtraParams
struct
{
Content
json
.
RawMessage
`json:"content"`
}
service/speechNlu/domain.go
View file @
b9a86129
...
...
@@ -432,6 +432,24 @@ func alarmDomain(params *model.SpeechDomainParams) []byte {
extra
:=
params
.
SpeechWsResp
.
Dm
.
Command
.
Param
.
Extra
object
:=
params
.
SpeechWsResp
.
Dm
.
Command
.
Param
.
Object
var
extraParam
model
.
ExtraParams
if
err
:=
json
.
Unmarshal
([]
byte
(
extra
),
&
extraParam
);
err
!=
nil
{
global
.
Logger
.
WithFields
(
logger
.
Fields
{
"requestId"
:
params
.
RequestId
,
"mac"
:
params
.
Mac
,
"mid"
:
params
.
Mid
,
"vender"
:
params
.
MidType
,
})
.
Errorf
(
"json.Unmarshal error: %v"
,
err
)
}
if
len
(
extraParam
.
Content
)
>
0
{
var
content
map
[
string
]
interface
{}
if
err
:=
json
.
Unmarshal
(
extraParam
.
Content
,
&
content
);
err
==
nil
{
if
len
(
content
)
==
0
{
return
Marshal
(
params
,
&
result
)
}
}
}
if
object
==
"闹钟"
{
result
.
Header
.
Semantic
.
Domain
=
"alarm"
}
else
{
...
...
service/speechNlu/news.go
View file @
b9a86129
...
...
@@ -37,14 +37,14 @@ type FeedBackResp struct {
Source
string
`json:"source"`
}
func
FeedBackNews
(
actionType
,
duration
int
,
ip
,
sid
,
uid
string
)
(
*
FeedBackResp
,
error
)
{
func
FeedBackNews
(
actionType
,
duration
int
,
sid
,
uid
string
)
(
*
FeedBackResp
,
error
)
{
url
:=
"http://apis.duiopen.com/feedback/letingv4?productId=279629895&apikey=0c74988953dd4ed4bf31955527802cf3&uid=111"
//url := global.SpeechSetting.FeedBackUrl + "?productId=" + global.SpeechSetting.ProductId + "&apikey=" + global.SpeechSetting.ApiKey + "&uid=" + uid
request
:=
FeedBackReq
{
ActionType
:
actionType
,
Timestamp
:
time
.
Now
()
.
Unix
(),
ClientIp
:
ip
,
//ip
Brand
:
"gree"
,
//
ClientIp: ip, //ip
Brand
:
"gree"
,
Data
:
[]
map
[
string
]
interface
{}{
{
"sid"
:
sid
,
//"m6J2LW-4z-H2dtxea5Sv6_voziweppX1K_aGb7fKtdjq3y36awwXd_NeoKgBXD7a"
...
...
service/speechNlu/rabbitmq.go
View file @
b9a86129
...
...
@@ -194,8 +194,8 @@ func (c *Consumer) Consume() {
// 处理消息逻辑
state
,
offset
,
mediaId
:=
parseData
(
&
resp
)
uid
:=
util
.
EncodeMD5
(
resp
.
Mac
)
ip
:=
"14.215.222.17"
//todo:待改
if
_
,
err
:=
FeedBackNews
(
state
,
offset
,
ip
,
mediaId
,
uid
);
err
!=
nil
{
//
ip := "14.215.222.17" //todo:待改
if
_
,
err
:=
FeedBackNews
(
state
,
offset
,
mediaId
,
uid
);
err
!=
nil
{
global
.
Logger
.
Errorf
(
"Feedback error: %v"
,
err
)
_
=
d
.
Nack
(
false
,
true
)
continue
...
...
service/speechNlu/register.go
View file @
b9a86129
...
...
@@ -51,6 +51,7 @@ func register() {
DomainRegister
(
HOLIDAY
,
holidayDomain
)
DomainRegister
(
RELATION
,
speechOtherDomain
)
DomainRegister
(
WASTESORTING
,
speechOtherDomain
)
DomainRegister
(
""
,
speechOtherDomain
)
//
//DomainRegisterV2(CHAT, chatDomainV2)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment