sanlin.shi 1 month ago
parent
commit
a1a89c7ff3

+ 8 - 1
sql.md

@@ -850,5 +850,12 @@ ADD COLUMN `transit_push_encrypt_app_secret` varchar(100) NULL COMMENT '进出
 ADD COLUMN `transit_push_encrypt_private_secret` varchar(100) NULL COMMENT '进出记录推送数据是否加解密PrivateKey' AFTER `transit_push_encrypt_app_secret`,
 ADD COLUMN `transit_push_encrypt_private_key` varchar(100) NULL COMMENT '进出记录推送数据是否加解密PrivateKey' AFTER `transit_push_encrypt_private_secret`;
 
-
+ALTER TABLE `hanghui_outapi_platform`.`iot_device_config`
+ADD COLUMN `is_open_microphone` tinyint(1) DEFAULT '0' COMMENT '是否开启麦克风 默认false' AFTER `applet_enter_page_url`,
+ADD COLUMN `microphone_type` int DEFAULT NULL COMMENT '麦克风类型MicrophoneTypeEnum' AFTER `is_open_microphone`;
+
+ALTER TABLE `hanghui_outapi_platform`.`iot_device_config_template`
+ADD COLUMN `is_open_microphone` tinyint(1) DEFAULT '0' COMMENT '是否开启麦克风 默认false' AFTER `applet_enter_page_url`,
+ADD COLUMN `microphone_type` int DEFAULT NULL COMMENT '麦克风类型MicrophoneTypeEnum' AFTER `is_open_microphone`;
+  
 

+ 27 - 2
src/main/java/cn/hanghui/outapi/platform/HanghuiOutapiPlatformApplication.java

@@ -1,21 +1,46 @@
 package cn.hanghui.outapi.platform;
 
+import lombok.extern.slf4j.Slf4j;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.env.Environment;
 import org.springframework.scheduling.annotation.EnableAsync;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
 @EnableAsync
 @SpringBootApplication()
 @MapperScan("cn.hanghui.outapi.platform.**.mapper")
+@Slf4j
 public class HanghuiOutapiPlatformApplication {
 
     static {
         System.setProperty("druid.mysql.usePingMethod", "false");
     }
 
-    public static void main(String[] args) {
-        SpringApplication.run(HanghuiOutapiPlatformApplication.class, args);
+    public static void main(String[] args) throws UnknownHostException {
+        ConfigurableApplicationContext application = SpringApplication.run(HanghuiOutapiPlatformApplication.class, args);
+
+
+        Environment env = application.getEnvironment();
+        log.info("custom:{}",env.getProperty("custom.title"));
+        log.info("\n----------------------------------------------------------\n\t" +
+                        "Application '{}' is running! Access URLs:\n\t" +
+                        "Local: \t\thttp://localhost:{}\n\t" +
+                        "External: \thttp://{}:{}\n\t"+
+                        "Doc: \thttp://{}:{}{}/doc.html\n"+
+                        "----------------------------------------------------------",
+                env.getProperty("spring.application.name"),
+                env.getProperty("server.port"),
+                InetAddress.getLocalHost().getHostAddress(),
+                env.getProperty("server.port"),
+                InetAddress.getLocalHost().getHostAddress(),
+                env.getProperty("server.port"),
+                env.getProperty("server.servlet.context-path")
+        );
     }
 
 }

+ 7 - 0
src/main/java/cn/hanghui/outapi/platform/tenant/controller/IotDeviceConfigController.java

@@ -15,6 +15,7 @@ import cn.hanghui.outapi.platform.tenant.entity.config.iot.template.IotDeviceCon
 import cn.hanghui.outapi.platform.tenant.entity.config.iot.template.IotDeviceConfigTemplateVo;
 import cn.hanghui.outapi.platform.tenant.entity.dto.*;
 import cn.hanghui.outapi.platform.tenant.entity.enums.InterfaceTypeEnum;
+import cn.hanghui.outapi.platform.tenant.entity.enums.MicrophoneTypeEnum;
 import cn.hanghui.outapi.platform.tenant.entity.enums.PrinterConfigEnum;
 import cn.hanghui.outapi.platform.tenant.service.AmpeService;
 import cn.hanghui.outapi.platform.tenant.service.IotDeviceConfigService;
@@ -118,6 +119,12 @@ public class IotDeviceConfigController extends BaseController {
     public RestResult<List<Map<Integer, String>>> printerConfigList() {
         return RestResult.ok(EnumUtils.enumToListMap(PrinterConfigEnum.class));
     }
+    @ApiOperation(value = "HHArome麦克风类型列表")
+    @GetMapping("/microphoneTypeList")
+    @ApiOperationSupport(order = 299)
+    public RestResult<List<Map<Integer, String>>> microphoneTypeList() {
+        return RestResult.ok(EnumUtils.enumToListMap(MicrophoneTypeEnum.class));
+    }
     @ApiOperation(value = "容器配置-添加/编辑")
     @PostMapping("/add")
     @ApiOperationSupport(order = 300)

+ 6 - 0
src/main/java/cn/hanghui/outapi/platform/tenant/entity/config/iot/template/IotDeviceConfigTemplateDto.java

@@ -183,5 +183,11 @@ public class IotDeviceConfigTemplateDto {
     @ApiModelProperty(value = "小程序入口页面地址")
     private String appletEnterPageUrl;
 
+    @ApiModelProperty(value = "是否开启麦克风 默认false")
+    private Boolean isOpenMicrophone;
+    /** @see cn.hanghui.outapi.platform.tenant.entity.enums.MicrophoneTypeEnum*/
+    @ApiModelProperty(value = "麦克风类型")
+    private Integer microphoneType;
+
 
 }

+ 6 - 0
src/main/java/cn/hanghui/outapi/platform/tenant/entity/dto/IotDeviceAppletConfigVo.java

@@ -152,4 +152,10 @@ public class IotDeviceAppletConfigVo {
     @ApiModelProperty(value = "小程序入口页面地址")
     private String appletEnterPageUrl;
 
+    @ApiModelProperty(value = "是否开启麦克风 默认false")
+    private Boolean isOpenMicrophone;
+    /** @see cn.hanghui.outapi.platform.tenant.entity.enums.MicrophoneTypeEnum*/
+    @ApiModelProperty(value = "麦克风类型")
+    private Integer microphoneType;
+
 }

+ 6 - 0
src/main/java/cn/hanghui/outapi/platform/tenant/entity/dto/IotDeviceConfigDto.java

@@ -183,4 +183,10 @@ public class IotDeviceConfigDto {
     @ApiModelProperty(value = "小程序入口页面地址")
     private String appletEnterPageUrl;
 
+    @ApiModelProperty(value = "是否开启麦克风 默认false")
+    private Boolean isOpenMicrophone;
+    /** @see cn.hanghui.outapi.platform.tenant.entity.enums.MicrophoneTypeEnum*/
+    @ApiModelProperty(value = "麦克风类型")
+    private Integer microphoneType;
+
 }

+ 15 - 0
src/main/java/cn/hanghui/outapi/platform/tenant/entity/enums/MicrophoneTypeEnum.java

@@ -0,0 +1,15 @@
+package cn.hanghui.outapi.platform.tenant.entity.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum MicrophoneTypeEnum {
+
+    NATIVE_AUDIO(1, "原生音频流"),
+    ASR(2, "数科asr");
+
+    private Integer code;
+    private String desc;
+}

+ 6 - 0
src/main/java/cn/hanghui/outapi/platform/tenant/entity/po/IotDeviceConfig.java

@@ -215,4 +215,10 @@ public class IotDeviceConfig extends Base {
     @ApiModelProperty(value = "小程序入口页面地址")
     private String appletEnterPageUrl;
 
+    @ApiModelProperty(value = "是否开启麦克风 默认false")
+    private Boolean isOpenMicrophone;
+    /** @see cn.hanghui.outapi.platform.tenant.entity.enums.MicrophoneTypeEnum*/
+    @ApiModelProperty(value = "麦克风类型")
+    private Integer microphoneType;
+
 }

+ 6 - 0
src/main/java/cn/hanghui/outapi/platform/tenant/entity/po/IotDeviceConfigTemplate.java

@@ -185,4 +185,10 @@ public class IotDeviceConfigTemplate extends Base {
     @ApiModelProperty(value = "小程序入口页面地址")
     private String appletEnterPageUrl;
 
+    @ApiModelProperty(value = "是否开启麦克风 默认false")
+    private Boolean isOpenMicrophone;
+    /** @see cn.hanghui.outapi.platform.tenant.entity.enums.MicrophoneTypeEnum*/
+    @ApiModelProperty(value = "麦克风类型")
+    private Integer microphoneType;
+
 }