diff --git a/c2c.http b/c2c.http new file mode 100644 index 0000000000000000000000000000000000000000..fdc3c3b267ed7119a390574a213f212c970a6d22 --- /dev/null +++ b/c2c.http @@ -0,0 +1,62 @@ +#POST https://nlu.gree.com/semantic/unisoundc2c/querys +POST https://testnlu.gree.com/semantic/unisoundc2c/querys +#POST http://172.28.124.216:9999/semantic/unisoundc2c/querys +#POST http://172.28.5.39:9999/semantic/unisoundc2c/querys +Content-Type: application/json + +{ + "reqParam": { + "common": { + "appKey": "ilcsnav5otwalqnkzliyfh5tbrbjkjomtjgiojih", + "imei": "hb-0242DFEC61F4", + "remoteIP": "47.103.18.223", + "requestId": "123456111", + "trafficParameter": "mode=childxxx;macWifi=28b77c218ed1;mid=10f05;vender=7e000025;macVoice=testyuntiancloud;ver=3.0;scenario=smarthome;filterName=nlu;req_nlu_length=1;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu2;version=0.5;filterUrl=https://testnlu.gree.com:443/semantic/unisoundc2c/querys;" + }, + "nluRet": { + "text": "明天的呢" + }, + "postProc": {} + } +} + +### +POST http://localhost:19992/semantic/unisoundc2c/child/querys/v2 +Content-Type: application/json + +{ + "reqParam": { + "common": { + "remoteIP": "14.215.222.17", + "requestId": "1234568222", + "trafficParameter": "ver=3.0;scenario=smarthome;filterName=nlu2;req_nlu_length=2;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu;mid=11011;version=0.5;macWifi=28b77c23817b1234111111;macVoice=28b77c23817b1234111111" + }, + "nluRet": { + "asr_recongize": "", + "text": "明天呢" + } + }, + "version": "v0" +} + +### +# POST https://nlu.gree.com/semantic/unisoundc2c/querys +POST https://nlu.gree.com/semantic/unisoundc2c/querys +Content-Type: application/json + +# ;macWifi=f4911e968a48;macVoice=c46e7b7624fc +{ + "reqParam": { + "common": { + "appKey": "nq3qd4ur4pt6c6pjulf4tfpirl6jkzxakueuy4yr", + "imei": "hb-0242DFEC61F4", + "remoteIP": "182.84.16.132", + "requestId": "123456456456465456", + "trafficParameter": "mode=childxx;macWifi=ece154a73d38;mid=11011;macVoice=testyuntiancloud;ver=3.0;scenario=smarthome;filterName=nlu;req_nlu_length=1;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu2;version=0.5;filterUrl=https://testnlu.gree.com:443/semantic/unisoundc2c/querys;" + }, + "nluRet": { + "text": "播放音乐" + }, + "postProc": {} + } +} \ No newline at end of file diff --git a/conf/config.yaml b/conf/config.yaml index a581103f5f9b575e3d74918a844dff73ded832b8..8df12d86530d58a096405708400770aa4084386b 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -12,6 +12,7 @@ RabbitMq: Url: amqp://iot:qwe!23@172.28.124.106:5672/voice ExchangeName: voice.media.ctrl ExchangeType: direct + RoutingKey: mqHandle Logger: LogFileName: tencent-nlu-parse diff --git a/main.go b/main.go index 2209a425d2b1b8aca64d87dee4b4e9186dfeef0b..fb0cb6491366f8d3ee555cdbe4622c3831af4f9a 100644 --- a/main.go +++ b/main.go @@ -152,7 +152,7 @@ func setupFlag() error { flag.StringVar(&serverTag, "tag", "", "注册到注册中心的标签") flag.StringVar(&ip, "ip", "", "IP") flag.IntVar(&port, "port", 0, "端口") - flag.StringVar(&consulUrl, "consul", "http://172.28.124.105:8500", "consul服务地址") + flag.StringVar(&consulUrl, "consul", "http://172.28.124.106:8500", "consul服务地址") flag.StringVar(&config, "config", "env/v2,speech_nlu_parse/conf", "指定要使用的配置文件路径") flag.BoolVar(&isVersion, "version", false, "编译信息") flag.StringVar(&consulToken, "token", "092288b5-824f-854c-39aa-a958afd9a633", "consul token") diff --git a/pkg/setting/section.go b/pkg/setting/section.go index 38c07b71982fafdcfac0da74a0268747e88a39f0..a3ff931a85cd924cb9d9b41e1da687656c8f5b82 100644 --- a/pkg/setting/section.go +++ b/pkg/setting/section.go @@ -101,6 +101,7 @@ type RabbitMqSettings struct { Url string ExchangeName string ExchangeType string + RoutingKey string } func (s *Setting) ReadSection(k string, v interface{}) error { diff --git a/service/speechNlu/rabbitmq.go b/service/speechNlu/rabbitmq.go index 84d956fa4315407186872ff0581aac6592e782e4..495c94850a0782b3084f3712b78c2035bcbc37c4 100644 --- a/service/speechNlu/rabbitmq.go +++ b/service/speechNlu/rabbitmq.go @@ -103,7 +103,7 @@ func (c *Consumer) setup() error { } // 绑定队列 - routingKey := "mqhandle" + routingKey := global.RabbitMqSetting.RoutingKey if err := c.channel.QueueBind( queue, routingKey,