migrate project to new repository
This commit is contained in:
commit
04e0fc2684
56
.gitignore
vendored
Normal file
56
.gitignore
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
######################################################################
|
||||||
|
# Build Tools
|
||||||
|
|
||||||
|
.gradle
|
||||||
|
/build/
|
||||||
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# IDE
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### JRebel ###
|
||||||
|
rebel.xml
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
nbproject/private/
|
||||||
|
build/*
|
||||||
|
nbbuild/
|
||||||
|
dist/
|
||||||
|
nbdist/
|
||||||
|
.nb-gradle/
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Others
|
||||||
|
*.log
|
||||||
|
*.xml.versionsBackup
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
!*/build/*.java
|
||||||
|
!*/build/*.html
|
||||||
|
!*/build/*.xml
|
||||||
|
|
||||||
|
bin/
|
||||||
|
ry.bat
|
||||||
|
ry.sh
|
||||||
|
run.sh
|
||||||
|
package.bat
|
||||||
|
sql/quartz.sql
|
||||||
|
|
||||||
|
**/application-local.yml
|
||||||
26
DirectoryV3.xml
Normal file
26
DirectoryV3.xml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<trees>
|
||||||
|
<tree path="/cmvr-iot-system" title="系统模块"/>
|
||||||
|
<tree path="/cmvr-iot-admin" title="后台服务"/>
|
||||||
|
<tree path="/cmvr-iot-common" title="工具类"/>
|
||||||
|
<tree path="/cmvr-iot-framework" title="框架核心组件"/>
|
||||||
|
<tree path="/cmvr-iot-generator" title="代码生成"/>
|
||||||
|
<tree path="/cmvr-iot-quartz" title="定时任务"/>
|
||||||
|
<tree path="/cmvr-iot-common/src/main/java/com/cmvr/common/annotation" title="自定义注解"/>
|
||||||
|
<tree path="/cmvr-iot-common/src/main/java/com/cmvr/common/config" title="全局配置"/>
|
||||||
|
<tree path="/cmvr-iot-common/src/main/java/com/cmvr/common/constant" title="通用常量"/>
|
||||||
|
<tree path="/cmvr-iot-common/src/main/java/com/cmvr/common/core" title="核心控制"/>
|
||||||
|
<tree path="/cmvr-iot-common/src/main/java/com/cmvr/common/enums" title="通用枚举"/>
|
||||||
|
<tree path="/cmvr-iot-common/src/main/java/com/cmvr/common/exception" title="通用异常"/>
|
||||||
|
<tree path="/cmvr-iot-common/src/main/java/com/cmvr/common/filter" title="过滤器处理"/>
|
||||||
|
<tree path="/cmvr-iot-common/src/main/java/com/cmvr/common/utils" title="通用类处理"/>
|
||||||
|
<tree path="/cmvr-iot-common/src/main/java/com/cmvr/common/xss" title="自定义xss校验注解"/>
|
||||||
|
<tree path="/cmvr-iot-framework/src/main/java/com/cmvr/framework/aspectj" title="注解实现"/>
|
||||||
|
<tree path="/cmvr-iot-framework/src/main/java/com/cmvr/framework/config" title="系统配置"/>
|
||||||
|
<tree path="/cmvr-iot-framework/src/main/java/com/cmvr/framework/datasource" title="数据权限"/>
|
||||||
|
<tree path="/cmvr-iot-framework/src/main/java/com/cmvr/framework/interceptor" title="拦截器"/>
|
||||||
|
<tree path="/cmvr-iot-framework/src/main/java/com/cmvr/framework/manager" title="异步处理"/>
|
||||||
|
<tree path="/cmvr-iot-framework/src/main/java/com/cmvr/framework/security" title="权限控制"/>
|
||||||
|
<tree path="/cmvr-iot-framework/src/main/java/com/cmvr/framework/web" title="前端控制"/>
|
||||||
|
<tree path="/cmvr-iot-device" title="设备管理"/>
|
||||||
|
</trees>
|
||||||
43
Jenkinsfile
vendored
Normal file
43
Jenkinsfile
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh 'mvn clean install -Dmaven.test.skip=true'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy') {
|
||||||
|
parallel {
|
||||||
|
stage('Deploy to DEV') {
|
||||||
|
steps {
|
||||||
|
sh './ry.sh start dev'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy to TEST') {
|
||||||
|
steps {
|
||||||
|
sh './ry.sh start test'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy to PROD') {
|
||||||
|
steps {
|
||||||
|
sh './ry.sh start prod'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
archiveArtifacts artifacts: '**/*.jar', allowEmptyArchive: true
|
||||||
|
}
|
||||||
|
success {
|
||||||
|
echo 'Pipeline completed successfully.'
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
echo 'Pipeline failed.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
LICENSE
Normal file
20
LICENSE
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2018 RuoYi
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
91
cmvr-iot-admin/pom.xml
Normal file
91
cmvr-iot-admin/pom.xml
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>cmvr-iot</artifactId>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<version>3.8.9</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<artifactId>cmvr-iot-admin</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
web服务入口
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- spring-boot-devtools -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql驱动包 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 测试管理-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 核心模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-framework</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 定时任务-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-quartz</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 代码生成-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-generator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 设备管理-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-device</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<env>dev</env>
|
||||||
|
</properties>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<!-- Spring Boot Maven 插件 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>2.5.15</version>
|
||||||
|
<configuration>
|
||||||
|
<mainClass>com.cmvr.CmvrIotApplication</mainClass>
|
||||||
|
<fork>true</fork> <!-- 如果没有该配置, devtools 不会生效 -->
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<finalName>${project.artifactId}-${env}</finalName>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.cmvr;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动程序
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@EnableScheduling
|
||||||
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||||
|
public class CmvrIotApplication
|
||||||
|
{
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
|
SpringApplication.run(CmvrIotApplication.class, args);
|
||||||
|
System.out.println("招商车研物联网平台启动成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.cmvr;
|
||||||
|
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web容器中进行部署
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
public class CmvrIotServletInitializer extends SpringBootServletInitializer
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
|
||||||
|
{
|
||||||
|
return application.sources(CmvrIotApplication.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.cmvr.device.domain.DeDeviceRegistration;
|
||||||
|
import com.cmvr.device.service.IDeDeviceRegistrationService;
|
||||||
|
import com.cmvr.edge.client.service.EdgeSystemService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "设备信息获取")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/deviceList")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DeviceListController {
|
||||||
|
|
||||||
|
private final EdgeSystemService systemService;
|
||||||
|
private final IDeDeviceRegistrationService registrationService;
|
||||||
|
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:profile:list')")
|
||||||
|
@GetMapping("/addList")
|
||||||
|
@ApiOperation("同步设备信息列表")
|
||||||
|
public int addDeviceList(@RequestParam String terminalId){
|
||||||
|
|
||||||
|
List<DeDeviceRegistration> list = systemService.deviceList(terminalId);
|
||||||
|
|
||||||
|
return registrationService.addDeviceList(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.edge.client.model.biohead.EdgeCommonVO;
|
||||||
|
import com.cmvr.edge.client.model.biohead.EdgeFacialExpressionVO;
|
||||||
|
import com.cmvr.edge.client.service.EdgeBioHeadService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Api(tags = "机器人头部")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/biohead")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeBioHeadController extends BaseController {
|
||||||
|
|
||||||
|
private final EdgeBioHeadService edgeBioHeadService;
|
||||||
|
|
||||||
|
@ApiOperation("设置面部表情")
|
||||||
|
@PostMapping("/expression")
|
||||||
|
public AjaxResult expression(@RequestBody EdgeFacialExpressionVO facialExpressionVo) {
|
||||||
|
/*// 构建面部表情参数
|
||||||
|
EdgeFacialExpressionVo expression = EdgeFacialExpressionVo.builder()
|
||||||
|
.eyebrow(EdgeFacialExpressionVo.Eyebrow.builder()
|
||||||
|
.leftOutsideY(1f)
|
||||||
|
.leftInsideY(0.4f)
|
||||||
|
.rightOutsideY(0.2f)
|
||||||
|
.rightInsideY(0.2f)
|
||||||
|
.build())
|
||||||
|
.eyelid(EdgeFacialExpressionVo.Eyelid.builder()
|
||||||
|
.leftUpperY(0.4f)
|
||||||
|
.leftLowerY(0.4f)
|
||||||
|
.rightUpperY(0.4f)
|
||||||
|
.rightLowerY(0.5f)
|
||||||
|
.build())
|
||||||
|
.eyeball(EdgeFacialExpressionVo.Eyeball.builder()
|
||||||
|
.leftX(0.2f)
|
||||||
|
.leftY(0.3f)
|
||||||
|
.rightX(0.4f)
|
||||||
|
.rightY(0.5f)
|
||||||
|
.build())
|
||||||
|
.mouth(EdgeFacialExpressionVo.Mouth.builder()
|
||||||
|
.upperLipY(0.3f)
|
||||||
|
.lowerLipY(-0.3f)
|
||||||
|
.build())
|
||||||
|
.nose(EdgeFacialExpressionVo.Nose.builder()
|
||||||
|
.leftY(0f)
|
||||||
|
.rightY(0f)
|
||||||
|
.build())
|
||||||
|
.jaw(EdgeFacialExpressionVo.Jaw.builder()
|
||||||
|
.x(0f)
|
||||||
|
.y(0f)
|
||||||
|
.build())
|
||||||
|
.build();*/
|
||||||
|
return success(edgeBioHeadService.setExpression(facialExpressionVo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("紧急停止")
|
||||||
|
@PostMapping("/stop")
|
||||||
|
public AjaxResult emergencyStop(@RequestBody EdgeCommonVO edgeCommonVO) {
|
||||||
|
return success(edgeBioHeadService.emergencyStop(edgeCommonVO));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.test.enums.ActionEnum;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Api(tags = "API操作")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeDeviceController extends BaseController {
|
||||||
|
|
||||||
|
@ApiOperation("查询操作内容")
|
||||||
|
@GetMapping("/action")
|
||||||
|
public AjaxResult getAction() {
|
||||||
|
return success(ActionEnum.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.edge.client.model.biohead.EdgeFacialExpressionVO;
|
||||||
|
import com.cmvr.edge.client.service.EdgeBioHeadService;
|
||||||
|
import com.cmvr.edge.client.service.EdgeDexHandService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Api(tags = "机器人灵巧手")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/dexHand")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeDexHandController extends BaseController {
|
||||||
|
|
||||||
|
private final EdgeDexHandService edgeDexHandService;
|
||||||
|
|
||||||
|
@ApiOperation("获取灵巧手状态信息")
|
||||||
|
@GetMapping("/status")
|
||||||
|
public AjaxResult status(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId
|
||||||
|
) {
|
||||||
|
return success(JSON.parseObject(JSON.toJSONString(edgeDexHandService.getStatus(terminalId, deviceId)), Map.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("设置灵巧手弯曲角度")
|
||||||
|
@GetMapping("/angle")
|
||||||
|
public AjaxResult setAngle(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId,
|
||||||
|
@RequestParam("id") int id,
|
||||||
|
@RequestParam("value") float value
|
||||||
|
) {
|
||||||
|
edgeDexHandService.setDexHandAngle(terminalId, deviceId, id, value);
|
||||||
|
return success("ok");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("获取灵巧手按压力信息")
|
||||||
|
@GetMapping("/sensor")
|
||||||
|
public AjaxResult sensor(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId
|
||||||
|
) {
|
||||||
|
return success(JSON.parseObject(edgeDexHandService.getSensorData(terminalId, deviceId), Map.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import com.cmvr.llm.model.CallAgentVO;
|
||||||
|
import com.cmvr.llm.service.LargeModelRemoteService;
|
||||||
|
import com.cmvr.llm.util.LargeModelFileUploadUtil;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
|
||||||
|
@Api(tags = "大模型接口调用")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/call")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class LargeModelRemoteController {
|
||||||
|
|
||||||
|
private final LargeModelRemoteService largeModelRemoteService;
|
||||||
|
|
||||||
|
@ApiOperation("执行语音转文本工作流")
|
||||||
|
@PostMapping("/speechToText")
|
||||||
|
public AjaxResult runSpeechToText(@RequestBody CallAgentVO callAgentVO) {
|
||||||
|
String result = largeModelRemoteService.runSpeechToTextWorkflow(callAgentVO);
|
||||||
|
return AjaxResult.success("工作流执行成功", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询语音转文本结果")
|
||||||
|
@PostMapping("/result")
|
||||||
|
public AjaxResult queryResult(@RequestParam("processId") String processId) {
|
||||||
|
String result = largeModelRemoteService.querySpeechToTextResult(processId);
|
||||||
|
return AjaxResult.success("查询成功", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("上传文件到大模型")
|
||||||
|
@PostMapping("/upload/large")
|
||||||
|
public String uploadFileLarge(@RequestPart("file") MultipartFile file) throws Exception {
|
||||||
|
return LargeModelFileUploadUtil.uploadFile(file.getBytes());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,133 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import cmvr.api.MicrophoneCommand;
|
||||||
|
import com.cmvr.edge.client.service.EdgeMicrophoneService;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 麦克风管理
|
||||||
|
*/
|
||||||
|
@Api(tags = "麦克风")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/Microphone")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class MicrophoneController {
|
||||||
|
|
||||||
|
private final EdgeMicrophoneService microphoneService;
|
||||||
|
|
||||||
|
@ApiOperation("获取麦克风状态")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:microphone:query')")
|
||||||
|
@GetMapping("/status")
|
||||||
|
public AjaxResult getStatus(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
try {
|
||||||
|
MicrophoneCommand.GetMicStateCommand.Feedback feedback = microphoneService.getStatus(terminalId, deviceId);
|
||||||
|
MicrophoneCommand.MicState state = feedback.getState();
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
Map<String, Object> header = new HashMap<>();
|
||||||
|
header.put("deviceId", deviceId);
|
||||||
|
header.put("timestamp", feedback.getHeader().getTimestamp().getSeconds());
|
||||||
|
result.put("header", header);
|
||||||
|
|
||||||
|
Map<String, Object> stateMap = new HashMap<>();
|
||||||
|
stateMap.put("isInitialized", state.getIsInitialized());
|
||||||
|
stateMap.put("isRunning", state.getIsRunning());
|
||||||
|
stateMap.put("isRecording", state.getIsRecording());
|
||||||
|
stateMap.put("volume", state.getVolume());
|
||||||
|
stateMap.put("errorMessage", state.getErrorMessage());
|
||||||
|
result.put("state", stateMap);
|
||||||
|
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("获取麦克风状态失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("开始录音")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:microphone:record')")
|
||||||
|
@PostMapping("/start")
|
||||||
|
public AjaxResult startRecord(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId,
|
||||||
|
@ApiParam(value = "录音文件路径", required = true)
|
||||||
|
@RequestParam String filePath) {
|
||||||
|
microphoneService.startRecord(terminalId, deviceId, filePath);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("停止录音")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:microphone:stop')")
|
||||||
|
@PostMapping("/stop")
|
||||||
|
public AjaxResult stopRecord(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
microphoneService.stopRecord(terminalId, deviceId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("暂停录音")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:microphone:pause')")
|
||||||
|
@PostMapping("/pause")
|
||||||
|
public AjaxResult pauseRecord(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
microphoneService.pauseRecord(terminalId, deviceId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("恢复录音")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:microphone:resume')")
|
||||||
|
@PostMapping("/resume")
|
||||||
|
public AjaxResult resumeRecord(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
microphoneService.resumeRecord(terminalId, deviceId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("设置音量")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:microphone:volume')")
|
||||||
|
@PostMapping("/volume")
|
||||||
|
public AjaxResult setVolume(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId,
|
||||||
|
@ApiParam(value = "音量大小(0-100)", required = true)
|
||||||
|
@RequestParam int volume) {
|
||||||
|
microphoneService.setVolume(terminalId, deviceId, volume);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取音量")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:microphone:volume')")
|
||||||
|
@GetMapping("/volume")
|
||||||
|
public AjaxResult getVolume(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
return AjaxResult.success(microphoneService.getVolume(terminalId, deviceId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,166 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import cmvr.api.SpeakerCommand;
|
||||||
|
import com.cmvr.edge.client.service.EdgeSpeakerService;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扬声器管理
|
||||||
|
*
|
||||||
|
* @author cmvr
|
||||||
|
*/
|
||||||
|
@Api(tags = "扬声器")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/Speaker")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SpeakerController {
|
||||||
|
|
||||||
|
private final EdgeSpeakerService speakerService;
|
||||||
|
|
||||||
|
@ApiOperation("获取扬声器状态")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:speaker:query')")
|
||||||
|
@GetMapping("/status")
|
||||||
|
public AjaxResult getStatus(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
try {
|
||||||
|
// 获取扬声器状态
|
||||||
|
SpeakerCommand.GetSpeakerStateCommand.Feedback feedback = speakerService.getStatus(terminalId, deviceId);
|
||||||
|
SpeakerCommand.SpeakerState state = feedback.getState();
|
||||||
|
|
||||||
|
// 构建返回结果
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
// 添加 header 信息
|
||||||
|
Map<String, Object> header = new HashMap<>();
|
||||||
|
header.put("deviceId", deviceId);
|
||||||
|
header.put("timestamp", feedback.getHeader().getTimestamp().getSeconds());
|
||||||
|
result.put("header", header);
|
||||||
|
|
||||||
|
// 添加 state 信息
|
||||||
|
Map<String, Object> stateMap = new HashMap<>();
|
||||||
|
stateMap.put("isInitialized", state.getIsInitialized());
|
||||||
|
stateMap.put("isRunning", state.getIsRunning());
|
||||||
|
stateMap.put("isDecoding", state.getIsDecoding());
|
||||||
|
stateMap.put("isPaused", state.getIsPaused());
|
||||||
|
stateMap.put("volume", state.getVolume());
|
||||||
|
stateMap.put("errorMessage", state.getErrorMessage());
|
||||||
|
result.put("state", stateMap);
|
||||||
|
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("获取扬声器状态失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 播放音频
|
||||||
|
*/
|
||||||
|
@ApiOperation("播放音频")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:speaker:play')")
|
||||||
|
@PostMapping("/play")
|
||||||
|
public AjaxResult playAudio(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId,
|
||||||
|
@ApiParam(value = "音频文件路径", required = true)
|
||||||
|
@RequestParam String audioPath) {
|
||||||
|
speakerService.playAudio(terminalId, deviceId, audioPath);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止播放
|
||||||
|
*/
|
||||||
|
@ApiOperation("停止播放")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:speaker:stop')")
|
||||||
|
@PostMapping("/stop")
|
||||||
|
public AjaxResult stopPlayback(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
speakerService.stopPlayback(terminalId, deviceId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停播放
|
||||||
|
*/
|
||||||
|
@ApiOperation("暂停播放")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:speaker:pause')")
|
||||||
|
@PostMapping("/pause")
|
||||||
|
public AjaxResult pausePlayback(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
speakerService.pausePlayback(terminalId, deviceId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复播放
|
||||||
|
*/
|
||||||
|
@ApiOperation("恢复播放")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:speaker:resume')")
|
||||||
|
@PostMapping("/resume")
|
||||||
|
public AjaxResult resumePlayback(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
speakerService.resumePlayback(terminalId, deviceId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置音量
|
||||||
|
*/
|
||||||
|
@ApiOperation("设置音量")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:speaker:volume')")
|
||||||
|
@PostMapping("/volume")
|
||||||
|
public AjaxResult setVolume(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId,
|
||||||
|
@ApiParam(value = "音量大小(0-100)", required = true)
|
||||||
|
@RequestParam int volume) {
|
||||||
|
speakerService.setVolume(terminalId, deviceId, volume);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取音量
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取音量")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:speaker:volume')")
|
||||||
|
@GetMapping("/volume")
|
||||||
|
public AjaxResult getVolume(
|
||||||
|
@ApiParam(value = "终端设备ID", required = true)
|
||||||
|
@RequestParam String terminalId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam String deviceId) {
|
||||||
|
return AjaxResult.success(speakerService.getVolume(terminalId, deviceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取所有音频")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:speaker:getAll')")
|
||||||
|
@GetMapping("/getAll")
|
||||||
|
public AjaxResult getAll() {
|
||||||
|
return AjaxResult.success(speakerService.getAll());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.edge.client.service.EdgeCameraService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Api(tags = "测试相机服务")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/edge/camera")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TestGrpcController extends BaseController {
|
||||||
|
|
||||||
|
private final EdgeCameraService edgeCameraService;
|
||||||
|
|
||||||
|
@ApiOperation("获取相机状态")
|
||||||
|
@GetMapping("/status")
|
||||||
|
public AjaxResult status(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId
|
||||||
|
) {
|
||||||
|
return success(JSON.toJSONString(edgeCameraService.status(terminalId, deviceId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("开启相机")
|
||||||
|
@GetMapping("/start")
|
||||||
|
public AjaxResult start(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId
|
||||||
|
) {
|
||||||
|
return success(edgeCameraService.start(terminalId, deviceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("关闭相机")
|
||||||
|
@GetMapping("/stop")
|
||||||
|
public AjaxResult stop(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId
|
||||||
|
) {
|
||||||
|
return success(edgeCameraService.stop(terminalId, deviceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取图片")
|
||||||
|
@GetMapping("/getRGBImage")
|
||||||
|
public AjaxResult getRGBImage(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId
|
||||||
|
) {
|
||||||
|
return success(edgeCameraService.getRGBImage(terminalId, deviceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("开始录制视频")
|
||||||
|
@GetMapping("/startRecording")
|
||||||
|
public AjaxResult startRecording(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId
|
||||||
|
) {
|
||||||
|
return success(edgeCameraService.startRecording(terminalId, deviceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("停止录制视频")
|
||||||
|
@GetMapping("/stopRecording")
|
||||||
|
public AjaxResult stopRecording(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId
|
||||||
|
) {
|
||||||
|
return success(edgeCameraService.stopRecording(terminalId, deviceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取图片和视频")
|
||||||
|
@GetMapping("/getRGBDImages")
|
||||||
|
public AjaxResult getRGBDImages(
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("terminalId") String terminalId
|
||||||
|
) {
|
||||||
|
return success(edgeCameraService.getRGBDImages(terminalId, deviceId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
package com.cmvr.web.controller.common;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.FastByteArrayOutputStream;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.google.code.kaptcha.Producer;
|
||||||
|
import com.cmvr.common.config.CmvrIotConfig;
|
||||||
|
import com.cmvr.common.constant.CacheConstants;
|
||||||
|
import com.cmvr.common.constant.Constants;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.redis.RedisCache;
|
||||||
|
import com.cmvr.common.utils.sign.Base64;
|
||||||
|
import com.cmvr.common.utils.uuid.IdUtils;
|
||||||
|
import com.cmvr.system.service.ISysConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证码操作处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
public class CaptchaController
|
||||||
|
{
|
||||||
|
@Resource(name = "captchaProducer")
|
||||||
|
private Producer captchaProducer;
|
||||||
|
|
||||||
|
@Resource(name = "captchaProducerMath")
|
||||||
|
private Producer captchaProducerMath;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysConfigService configService;
|
||||||
|
/**
|
||||||
|
* 生成验证码
|
||||||
|
*/
|
||||||
|
@GetMapping("/captchaImage")
|
||||||
|
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||||
|
ajax.put("captchaEnabled", captchaEnabled);
|
||||||
|
if (!captchaEnabled)
|
||||||
|
{
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存验证码信息
|
||||||
|
String uuid = IdUtils.simpleUUID();
|
||||||
|
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
|
||||||
|
|
||||||
|
String capStr = null, code = null;
|
||||||
|
BufferedImage image = null;
|
||||||
|
|
||||||
|
// 生成验证码
|
||||||
|
String captchaType = CmvrIotConfig.getCaptchaType();
|
||||||
|
if ("math".equals(captchaType))
|
||||||
|
{
|
||||||
|
String capText = captchaProducerMath.createText();
|
||||||
|
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
||||||
|
code = capText.substring(capText.lastIndexOf("@") + 1);
|
||||||
|
image = captchaProducerMath.createImage(capStr);
|
||||||
|
}
|
||||||
|
else if ("char".equals(captchaType))
|
||||||
|
{
|
||||||
|
capStr = code = captchaProducer.createText();
|
||||||
|
image = captchaProducer.createImage(capStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||||
|
// 转换流信息写出
|
||||||
|
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ImageIO.write(image, "jpg", os);
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
return AjaxResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
ajax.put("uuid", uuid);
|
||||||
|
ajax.put("img", Base64.encode(os.toByteArray()));
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,140 @@
|
|||||||
|
package com.cmvr.web.controller.common;
|
||||||
|
|
||||||
|
import com.cmvr.common.config.CmvrIotConfig;
|
||||||
|
import com.cmvr.common.constant.Constants;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.common.utils.file.FileUploadUtils;
|
||||||
|
import com.cmvr.common.utils.file.FileUtils;
|
||||||
|
import com.cmvr.framework.config.ServerConfig;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "通用请求处理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/common")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CommonController {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
||||||
|
|
||||||
|
private final ServerConfig serverConfig;
|
||||||
|
|
||||||
|
private static final String FILE_DELIMETER = ",";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用下载请求
|
||||||
|
*
|
||||||
|
* @param fileName 文件名称
|
||||||
|
* @param delete 是否删除
|
||||||
|
*/
|
||||||
|
@GetMapping("/download")
|
||||||
|
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
if (!FileUtils.checkAllowDownload(fileName)) {
|
||||||
|
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||||
|
}
|
||||||
|
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||||
|
String filePath = CmvrIotConfig.getDownloadPath() + fileName;
|
||||||
|
|
||||||
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||||
|
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||||
|
FileUtils.writeBytes(filePath, response.getOutputStream());
|
||||||
|
if (delete) {
|
||||||
|
FileUtils.deleteFile(filePath);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("下载文件失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用上传请求(单个)
|
||||||
|
*/
|
||||||
|
@PostMapping("/upload")
|
||||||
|
public AjaxResult uploadFile(MultipartFile file) throws Exception {
|
||||||
|
try {
|
||||||
|
// 上传文件路径
|
||||||
|
String filePath = CmvrIotConfig.getUploadPath();
|
||||||
|
// 上传并返回新文件名称
|
||||||
|
String fileName = FileUploadUtils.upload(filePath, file);
|
||||||
|
String url = serverConfig.getUrl() + fileName;
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("url", url);
|
||||||
|
ajax.put("fileName", fileName);
|
||||||
|
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||||
|
ajax.put("originalFilename", file.getOriginalFilename());
|
||||||
|
return ajax;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用上传请求(多个)
|
||||||
|
*/
|
||||||
|
@PostMapping("/uploads")
|
||||||
|
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception {
|
||||||
|
try {
|
||||||
|
// 上传文件路径
|
||||||
|
String filePath = CmvrIotConfig.getUploadPath();
|
||||||
|
List<String> urls = new ArrayList<String>();
|
||||||
|
List<String> fileNames = new ArrayList<String>();
|
||||||
|
List<String> newFileNames = new ArrayList<String>();
|
||||||
|
List<String> originalFilenames = new ArrayList<String>();
|
||||||
|
for (MultipartFile file : files) {
|
||||||
|
// 上传并返回新文件名称
|
||||||
|
String fileName = FileUploadUtils.upload(filePath, file);
|
||||||
|
String url = serverConfig.getUrl() + fileName;
|
||||||
|
urls.add(url);
|
||||||
|
fileNames.add(fileName);
|
||||||
|
newFileNames.add(FileUtils.getName(fileName));
|
||||||
|
originalFilenames.add(file.getOriginalFilename());
|
||||||
|
}
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
||||||
|
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||||
|
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
|
||||||
|
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
|
||||||
|
return ajax;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本地资源通用下载
|
||||||
|
*/
|
||||||
|
@GetMapping("/download/resource")
|
||||||
|
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
||||||
|
throws Exception {
|
||||||
|
try {
|
||||||
|
if (!FileUtils.checkAllowDownload(resource)) {
|
||||||
|
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
||||||
|
}
|
||||||
|
// 本地资源路径
|
||||||
|
String localPath = CmvrIotConfig.getProfile();
|
||||||
|
// 数据库资源地址
|
||||||
|
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
|
||||||
|
// 下载名称
|
||||||
|
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
||||||
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||||
|
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
||||||
|
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("下载文件失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
package com.cmvr.web.controller.device;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.cmvr.device.domain.vo.ProfileVo;
|
||||||
|
import com.cmvr.device.domain.vo.TeMechanicalArmVo;
|
||||||
|
import com.cmvr.edge.client.service.EdgeSystemService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.device.domain.DeDeviceProfile;
|
||||||
|
import com.cmvr.device.service.IDeDeviceProfileService;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备配置信息Controller
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @date 2025-05-09
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/device/profile")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "设备配置信息")
|
||||||
|
public class DeDeviceProfileController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
private final IDeDeviceProfileService deDeviceProfileService;
|
||||||
|
|
||||||
|
private final EdgeSystemService systemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备配置信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:profile:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("查询设备信息列表")
|
||||||
|
public TableDataInfo list(DeDeviceProfile deDeviceProfile)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<ProfileVo> list = deDeviceProfileService.selectDeDeviceProfileList(deDeviceProfile);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据设备id获取设备详细配置信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:profile:query')")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
@ApiOperation("根据设备id获取当前设备配置信息")
|
||||||
|
public AjaxResult getInfo(@PathVariable String id)
|
||||||
|
{
|
||||||
|
return success(deDeviceProfileService.selectDeDeviceProfileById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据设备id和备注获取设备详细配置信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:profile:query')")
|
||||||
|
@GetMapping("/parameterInfo")
|
||||||
|
@ApiOperation("根据设备id获取当前设备配置信息")
|
||||||
|
public AjaxResult getParameterInfo(@RequestParam String id, @RequestParam String remark)
|
||||||
|
{
|
||||||
|
return success(deDeviceProfileService.selectProfileByIdAndRemark(id,remark));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备配置信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:profile:add')")
|
||||||
|
@Log(title = "设备配置信息", businessType = BusinessType.INSERT)
|
||||||
|
@ApiOperation("新增设备信息")
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody List<DeDeviceProfile> deDeviceProfiles)
|
||||||
|
{
|
||||||
|
|
||||||
|
return toAjax(deDeviceProfileService.insertDeDeviceProfile(deDeviceProfiles));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备配置信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:profile:edit')")
|
||||||
|
@Log(title = "设备配置信息", businessType = BusinessType.UPDATE)
|
||||||
|
@ApiOperation("修改设备信息")
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody List<DeDeviceProfile> deDeviceProfiles)
|
||||||
|
{
|
||||||
|
return toAjax(deDeviceProfileService.updateDeDeviceProfile(deDeviceProfiles));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备配置信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:profile:remove')")
|
||||||
|
@Log(title = "设备配置信息", businessType = BusinessType.DELETE)
|
||||||
|
@ApiOperation("删除设备配置信息")
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(deDeviceProfileService.deleteDeDeviceProfileByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,122 @@
|
|||||||
|
package com.cmvr.web.controller.device;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.cmvr.edge.client.service.EdgeSystemService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.device.domain.DeDeviceRegistration;
|
||||||
|
import com.cmvr.device.service.IDeDeviceRegistrationService;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备注册Controller
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @date 2025-05-08
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/device/register")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "设备注册")
|
||||||
|
public class DeDeviceRegistrationController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IDeDeviceRegistrationService deDeviceRegistrationService;
|
||||||
|
|
||||||
|
private final EdgeSystemService systemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备注册列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询设备注册列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:register:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(DeDeviceRegistration deDeviceRegistration)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<DeDeviceRegistration> list = deDeviceRegistrationService.selectDeDeviceRegistrationList(deDeviceRegistration);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出设备注册列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出设备注册列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:register:export')")
|
||||||
|
@Log(title = "设备注册", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, DeDeviceRegistration deDeviceRegistration)
|
||||||
|
{
|
||||||
|
List<DeDeviceRegistration> list = deDeviceRegistrationService.selectDeDeviceRegistrationList(deDeviceRegistration);
|
||||||
|
ExcelUtil<DeDeviceRegistration> util = new ExcelUtil<DeDeviceRegistration>(DeDeviceRegistration.class);
|
||||||
|
util.exportExcel(response, list, "设备注册数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备注册详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取设备注册详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:register:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(deDeviceRegistrationService.selectDeDeviceRegistrationById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备注册
|
||||||
|
*/
|
||||||
|
@ApiOperation("新增设备注册")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:register:add')")
|
||||||
|
@Log(title = "设备注册", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody DeDeviceRegistration deDeviceRegistration)
|
||||||
|
{
|
||||||
|
return toAjax(deDeviceRegistrationService.insertDeDeviceRegistration(deDeviceRegistration));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备注册
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改设备注册")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:register:edit')")
|
||||||
|
@Log(title = "设备注册", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody DeDeviceRegistration deDeviceRegistration)
|
||||||
|
{
|
||||||
|
return toAjax(deDeviceRegistrationService.updateDeDeviceRegistration(deDeviceRegistration));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备注册
|
||||||
|
*/
|
||||||
|
@ApiOperation("删除设备注册")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:register:remove')")
|
||||||
|
@Log(title = "设备注册", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(deDeviceRegistrationService.deleteDeDeviceRegistrationByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,102 @@
|
|||||||
|
package com.cmvr.web.controller.device;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.device.domain.DeDeviceTerminalConfig;
|
||||||
|
import com.cmvr.device.service.IDeDeviceTerminalConfigService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备终端配置Controller
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @date 2025-05-08
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/device/terminal")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "设备终端配置")
|
||||||
|
public class DeDeviceTerminalConfigController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IDeDeviceTerminalConfigService deDeviceTerminalConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备终端配置列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询设备终端配置列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:terminal:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(DeDeviceTerminalConfig deDeviceTerminalConfig) {
|
||||||
|
startPage();
|
||||||
|
List<DeDeviceTerminalConfig> list = deDeviceTerminalConfigService.selectDeDeviceTerminalConfigList(deDeviceTerminalConfig);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出设备终端配置列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出设备终端配置列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:terminal:export')")
|
||||||
|
@Log(title = "设备终端配置", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, DeDeviceTerminalConfig deDeviceTerminalConfig) {
|
||||||
|
List<DeDeviceTerminalConfig> list = deDeviceTerminalConfigService.selectDeDeviceTerminalConfigList(deDeviceTerminalConfig);
|
||||||
|
ExcelUtil<DeDeviceTerminalConfig> util = new ExcelUtil<DeDeviceTerminalConfig>(DeDeviceTerminalConfig.class);
|
||||||
|
util.exportExcel(response, list, "设备终端配置数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备终端配置详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取设备终端配置详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:terminal:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||||
|
return success(deDeviceTerminalConfigService.selectDeDeviceTerminalConfigById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备终端配置
|
||||||
|
*/
|
||||||
|
@ApiOperation("新增设备终端配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:terminal:add')")
|
||||||
|
@Log(title = "设备终端配置", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody DeDeviceTerminalConfig deDeviceTerminalConfig) {
|
||||||
|
return toAjax(deDeviceTerminalConfigService.insertDeDeviceTerminalConfig(deDeviceTerminalConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备终端配置
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改设备终端数据")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:terminal:edit')")
|
||||||
|
@Log(title = "设备终端配置", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody DeDeviceTerminalConfig deDeviceTerminalConfig) {
|
||||||
|
return toAjax(deDeviceTerminalConfigService.updateDeDeviceTerminalConfig(deDeviceTerminalConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备终端配置
|
||||||
|
*/
|
||||||
|
@ApiOperation("删除设备终端配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('device:terminal:remove')")
|
||||||
|
@Log(title = "设备终端配置", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids) {
|
||||||
|
return toAjax(deDeviceTerminalConfigService.deleteDeDeviceTerminalConfigByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,121 @@
|
|||||||
|
package com.cmvr.web.controller.monitor;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.TreeSet;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisCallback;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.constant.CacheConstants;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.system.domain.SysCache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存监控
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/monitor/cache")
|
||||||
|
public class CacheController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private RedisTemplate<String, String> redisTemplate;
|
||||||
|
|
||||||
|
private final static List<SysCache> caches = new ArrayList<SysCache>();
|
||||||
|
{
|
||||||
|
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
|
||||||
|
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
|
||||||
|
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
|
||||||
|
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
|
||||||
|
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
|
||||||
|
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
||||||
|
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
|
@GetMapping()
|
||||||
|
public AjaxResult getInfo() throws Exception
|
||||||
|
{
|
||||||
|
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
|
||||||
|
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
|
||||||
|
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>(3);
|
||||||
|
result.put("info", info);
|
||||||
|
result.put("dbSize", dbSize);
|
||||||
|
|
||||||
|
List<Map<String, String>> pieList = new ArrayList<>();
|
||||||
|
commandStats.stringPropertyNames().forEach(key -> {
|
||||||
|
Map<String, String> data = new HashMap<>(2);
|
||||||
|
String property = commandStats.getProperty(key);
|
||||||
|
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
|
||||||
|
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
||||||
|
pieList.add(data);
|
||||||
|
});
|
||||||
|
result.put("commandStats", pieList);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
|
@GetMapping("/getNames")
|
||||||
|
public AjaxResult cache()
|
||||||
|
{
|
||||||
|
return AjaxResult.success(caches);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
|
@GetMapping("/getKeys/{cacheName}")
|
||||||
|
public AjaxResult getCacheKeys(@PathVariable String cacheName)
|
||||||
|
{
|
||||||
|
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
||||||
|
return AjaxResult.success(new TreeSet<>(cacheKeys));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
|
@GetMapping("/getValue/{cacheName}/{cacheKey}")
|
||||||
|
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
|
||||||
|
{
|
||||||
|
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
|
||||||
|
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
|
||||||
|
return AjaxResult.success(sysCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
|
@DeleteMapping("/clearCacheName/{cacheName}")
|
||||||
|
public AjaxResult clearCacheName(@PathVariable String cacheName)
|
||||||
|
{
|
||||||
|
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
||||||
|
redisTemplate.delete(cacheKeys);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
|
@DeleteMapping("/clearCacheKey/{cacheKey}")
|
||||||
|
public AjaxResult clearCacheKey(@PathVariable String cacheKey)
|
||||||
|
{
|
||||||
|
redisTemplate.delete(cacheKey);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
|
@DeleteMapping("/clearCacheAll")
|
||||||
|
public AjaxResult clearCacheAll()
|
||||||
|
{
|
||||||
|
Collection<String> cacheKeys = redisTemplate.keys("*");
|
||||||
|
redisTemplate.delete(cacheKeys);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.cmvr.web.controller.monitor;
|
||||||
|
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.framework.web.domain.Server;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务器监控
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/monitor/server")
|
||||||
|
public class ServerController
|
||||||
|
{
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
|
||||||
|
@GetMapping()
|
||||||
|
public AjaxResult getInfo() throws Exception
|
||||||
|
{
|
||||||
|
Server server = new Server();
|
||||||
|
server.copyTo();
|
||||||
|
return AjaxResult.success(server);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
package com.cmvr.web.controller.monitor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.framework.web.service.SysPasswordService;
|
||||||
|
import com.cmvr.system.domain.SysLogininfor;
|
||||||
|
import com.cmvr.system.service.ISysLogininforService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统访问记录
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/monitor/logininfor")
|
||||||
|
public class SysLogininforController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysLogininforService logininforService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysPasswordService passwordService;
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysLogininfor logininfor)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysLogininfor logininfor)
|
||||||
|
{
|
||||||
|
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||||
|
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
||||||
|
util.exportExcel(response, list, "登录日志");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||||
|
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{infoIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] infoIds)
|
||||||
|
{
|
||||||
|
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||||
|
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
||||||
|
@DeleteMapping("/clean")
|
||||||
|
public AjaxResult clean()
|
||||||
|
{
|
||||||
|
logininforService.cleanLogininfor();
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
|
||||||
|
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
||||||
|
@GetMapping("/unlock/{userName}")
|
||||||
|
public AjaxResult unlock(@PathVariable("userName") String userName)
|
||||||
|
{
|
||||||
|
passwordService.clearLoginRecordCache(userName);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package com.cmvr.web.controller.monitor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.system.domain.SysOperLog;
|
||||||
|
import com.cmvr.system.service.ISysOperLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/monitor/operlog")
|
||||||
|
public class SysOperlogController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysOperLogService operLogService;
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysOperLog operLog)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysOperLog operLog)
|
||||||
|
{
|
||||||
|
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||||
|
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
||||||
|
util.exportExcel(response, list, "操作日志");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
||||||
|
@DeleteMapping("/{operIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] operIds)
|
||||||
|
{
|
||||||
|
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
||||||
|
@DeleteMapping("/clean")
|
||||||
|
public AjaxResult clean()
|
||||||
|
{
|
||||||
|
operLogService.cleanOperLog();
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package com.cmvr.web.controller.monitor;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.constant.CacheConstants;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.model.LoginUser;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.core.redis.RedisCache;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.system.domain.SysUserOnline;
|
||||||
|
import com.cmvr.system.service.ISysUserOnlineService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线用户监控
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/monitor/online")
|
||||||
|
public class SysUserOnlineController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysUserOnlineService userOnlineService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(String ipaddr, String userName)
|
||||||
|
{
|
||||||
|
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
|
||||||
|
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
||||||
|
for (String key : keys)
|
||||||
|
{
|
||||||
|
LoginUser user = redisCache.getCacheObject(key);
|
||||||
|
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
|
||||||
|
{
|
||||||
|
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
|
||||||
|
}
|
||||||
|
else if (StringUtils.isNotEmpty(ipaddr))
|
||||||
|
{
|
||||||
|
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
|
||||||
|
}
|
||||||
|
else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
|
||||||
|
{
|
||||||
|
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Collections.reverse(userOnlineList);
|
||||||
|
userOnlineList.removeAll(Collections.singleton(null));
|
||||||
|
return getDataTable(userOnlineList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 强退用户
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
|
||||||
|
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||||
|
@DeleteMapping("/{tokenId}")
|
||||||
|
public AjaxResult forceLogout(@PathVariable String tokenId)
|
||||||
|
{
|
||||||
|
redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
package com.cmvr.web.controller.show;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.llm.model.CallAgentVO;
|
||||||
|
import com.cmvr.llm.model.CallAgentAdvancedVO;
|
||||||
|
import com.cmvr.llm.model.CallTTSAdvancedVO;
|
||||||
|
import com.cmvr.llm.model.CallTTSVO;
|
||||||
|
import com.cmvr.llm.service.ShowIntelligentCockpitService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@Api(tags = "演示-智能座舱")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/show")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ShowIntelligentCockpitController extends BaseController {
|
||||||
|
|
||||||
|
private final ShowIntelligentCockpitService showIntelligentCockpitService;
|
||||||
|
|
||||||
|
// ----------------------------- 语音合成 -----------------------------
|
||||||
|
|
||||||
|
@Log(title = "演示-智能座舱-创建音色", businessType = BusinessType.OTHER)
|
||||||
|
@ApiOperation("创建音色")
|
||||||
|
@PostMapping("/tts/create")
|
||||||
|
public AjaxResult create(@RequestPart(value = "file") MultipartFile file) throws IOException {
|
||||||
|
return success(showIntelligentCockpitService.createTimbre(file));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询音色")
|
||||||
|
@GetMapping("/tts/query")
|
||||||
|
public AjaxResult query() {
|
||||||
|
return success(showIntelligentCockpitService.queryTimbre());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "演示-智能座舱-生成语料", businessType = BusinessType.OTHER)
|
||||||
|
@ApiOperation("生成语料")
|
||||||
|
@PostMapping("/tts/corpus")
|
||||||
|
public AjaxResult corpus(@Valid @RequestBody CallAgentVO callAgentVO) {
|
||||||
|
callAgentVO.setConvertWords(StrUtil.trim(callAgentVO.getConvertWords()));
|
||||||
|
return success(showIntelligentCockpitService.genCorpus(callAgentVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "演示-智能座舱-语音合成", businessType = BusinessType.OTHER)
|
||||||
|
@ApiOperation("语音合成")
|
||||||
|
@PostMapping("/tts/synthesize")
|
||||||
|
public ResponseEntity<byte[]> synthesize(@Valid @RequestBody CallTTSVO callTTSVO) {
|
||||||
|
callTTSVO.setText(StrUtil.trim(callTTSVO.getText()));
|
||||||
|
return showIntelligentCockpitService.synthesizeAudio(callTTSVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "演示-智能座舱-生成语料-增强", businessType = BusinessType.OTHER)
|
||||||
|
@ApiOperation("生成语料-增强")
|
||||||
|
@PostMapping("/tts/corpus/advanced")
|
||||||
|
public AjaxResult corpusAdvanced(@Valid @RequestBody CallAgentAdvancedVO callAgentAdvancedVO) {
|
||||||
|
callAgentAdvancedVO.setConvertWords(StrUtil.trim(callAgentAdvancedVO.getConvertWords()));
|
||||||
|
return success(showIntelligentCockpitService.genCorpusAdvanced(callAgentAdvancedVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "演示-智能座舱-语音合成-增强", businessType = BusinessType.OTHER)
|
||||||
|
@ApiOperation("语音合成-增强")
|
||||||
|
@PostMapping("/tts/synthesize/advanced")
|
||||||
|
public ResponseEntity<byte[]> synthesizeAdvanced(@Valid @RequestBody CallTTSAdvancedVO callTTSAdvancedVO) {
|
||||||
|
callTTSAdvancedVO.setText(StrUtil.trim(callTTSAdvancedVO.getText()));
|
||||||
|
return showIntelligentCockpitService.synthesizeAudioAdvanced(callTTSAdvancedVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------- 触控交互 -----------------------------
|
||||||
|
|
||||||
|
@Log(title = "演示-智能座舱-触控坐标", businessType = BusinessType.OTHER)
|
||||||
|
@ApiOperation("触控坐标")
|
||||||
|
@PostMapping("/touch/coordinates")
|
||||||
|
public AjaxResult coordinates(
|
||||||
|
@RequestPart(value = "image") MultipartFile image,
|
||||||
|
@RequestParam("words") String words
|
||||||
|
) throws Exception {
|
||||||
|
return success(showIntelligentCockpitService.getCoordinates(image.getBytes(), words));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,133 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.system.domain.SysConfig;
|
||||||
|
import com.cmvr.system.service.ISysConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数配置 信息操作处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/config")
|
||||||
|
public class SysConfigController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysConfigService configService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取参数配置列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysConfig config)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysConfig> list = configService.selectConfigList(config);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysConfig config)
|
||||||
|
{
|
||||||
|
List<SysConfig> list = configService.selectConfigList(config);
|
||||||
|
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
||||||
|
util.exportExcel(response, list, "参数数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据参数编号获取详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
||||||
|
@GetMapping(value = "/{configId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long configId)
|
||||||
|
{
|
||||||
|
return success(configService.selectConfigById(configId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据参数键名查询参数值
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/configKey/{configKey}")
|
||||||
|
public AjaxResult getConfigKey(@PathVariable String configKey)
|
||||||
|
{
|
||||||
|
return success(configService.selectConfigByKey(configKey));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增参数配置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysConfig config)
|
||||||
|
{
|
||||||
|
if (!configService.checkConfigKeyUnique(config))
|
||||||
|
{
|
||||||
|
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
|
}
|
||||||
|
config.setCreateBy(getUsername());
|
||||||
|
return toAjax(configService.insertConfig(config));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改参数配置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
||||||
|
{
|
||||||
|
if (!configService.checkConfigKeyUnique(config))
|
||||||
|
{
|
||||||
|
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
|
}
|
||||||
|
config.setUpdateBy(getUsername());
|
||||||
|
return toAjax(configService.updateConfig(config));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除参数配置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{configIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] configIds)
|
||||||
|
{
|
||||||
|
configService.deleteConfigByIds(configIds);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新参数缓存
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||||
|
@DeleteMapping("/refreshCache")
|
||||||
|
public AjaxResult refreshCache()
|
||||||
|
{
|
||||||
|
configService.resetConfigCache();
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,132 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.constant.UserConstants;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysDept;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.system.service.ISysDeptService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门信息
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/dept")
|
||||||
|
public class SysDeptController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list(SysDept dept)
|
||||||
|
{
|
||||||
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||||
|
return success(depts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询部门列表(排除节点)
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||||
|
@GetMapping("/list/exclude/{deptId}")
|
||||||
|
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
||||||
|
{
|
||||||
|
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||||
|
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
||||||
|
return success(depts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门编号获取详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dept:query')")
|
||||||
|
@GetMapping(value = "/{deptId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long deptId)
|
||||||
|
{
|
||||||
|
deptService.checkDeptDataScope(deptId);
|
||||||
|
return success(deptService.selectDeptById(deptId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增部门
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dept:add')")
|
||||||
|
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysDept dept)
|
||||||
|
{
|
||||||
|
if (!deptService.checkDeptNameUnique(dept))
|
||||||
|
{
|
||||||
|
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
|
}
|
||||||
|
dept.setCreateBy(getUsername());
|
||||||
|
return toAjax(deptService.insertDept(dept));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改部门
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
||||||
|
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
||||||
|
{
|
||||||
|
Long deptId = dept.getDeptId();
|
||||||
|
deptService.checkDeptDataScope(deptId);
|
||||||
|
if (!deptService.checkDeptNameUnique(dept))
|
||||||
|
{
|
||||||
|
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
|
}
|
||||||
|
else if (dept.getParentId().equals(deptId))
|
||||||
|
{
|
||||||
|
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||||
|
}
|
||||||
|
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
|
||||||
|
{
|
||||||
|
return error("该部门包含未停用的子部门!");
|
||||||
|
}
|
||||||
|
dept.setUpdateBy(getUsername());
|
||||||
|
return toAjax(deptService.updateDept(dept));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除部门
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||||
|
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{deptId}")
|
||||||
|
public AjaxResult remove(@PathVariable Long deptId)
|
||||||
|
{
|
||||||
|
if (deptService.hasChildByDeptId(deptId))
|
||||||
|
{
|
||||||
|
return warn("存在下级部门,不允许删除");
|
||||||
|
}
|
||||||
|
if (deptService.checkDeptExistUser(deptId))
|
||||||
|
{
|
||||||
|
return warn("部门存在用户,不允许删除");
|
||||||
|
}
|
||||||
|
deptService.checkDeptDataScope(deptId);
|
||||||
|
return toAjax(deptService.deleteDeptById(deptId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,121 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysDictData;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.system.service.ISysDictDataService;
|
||||||
|
import com.cmvr.system.service.ISysDictTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据字典信息
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/dict/data")
|
||||||
|
public class SysDictDataController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysDictDataService dictDataService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDictTypeService dictTypeService;
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysDictData dictData)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysDictData dictData)
|
||||||
|
{
|
||||||
|
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||||
|
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
||||||
|
util.exportExcel(response, list, "字典数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询字典数据详细
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||||
|
@GetMapping(value = "/{dictCode}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long dictCode)
|
||||||
|
{
|
||||||
|
return success(dictDataService.selectDictDataById(dictCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典类型查询字典数据信息
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/type/{dictType}")
|
||||||
|
public AjaxResult dictType(@PathVariable String dictType)
|
||||||
|
{
|
||||||
|
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
||||||
|
if (StringUtils.isNull(data))
|
||||||
|
{
|
||||||
|
data = new ArrayList<SysDictData>();
|
||||||
|
}
|
||||||
|
return success(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增字典类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||||
|
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
||||||
|
{
|
||||||
|
dict.setCreateBy(getUsername());
|
||||||
|
return toAjax(dictDataService.insertDictData(dict));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存字典类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||||
|
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
|
||||||
|
{
|
||||||
|
dict.setUpdateBy(getUsername());
|
||||||
|
return toAjax(dictDataService.updateDictData(dict));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除字典类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||||
|
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{dictCodes}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] dictCodes)
|
||||||
|
{
|
||||||
|
dictDataService.deleteDictDataByIds(dictCodes);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,131 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysDictType;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.system.service.ISysDictTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据字典信息
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/dict/type")
|
||||||
|
public class SysDictTypeController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysDictTypeService dictTypeService;
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysDictType dictType)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysDictType dictType)
|
||||||
|
{
|
||||||
|
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||||
|
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
||||||
|
util.exportExcel(response, list, "字典类型");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询字典类型详细
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||||
|
@GetMapping(value = "/{dictId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long dictId)
|
||||||
|
{
|
||||||
|
return success(dictTypeService.selectDictTypeById(dictId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增字典类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||||
|
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysDictType dict)
|
||||||
|
{
|
||||||
|
if (!dictTypeService.checkDictTypeUnique(dict))
|
||||||
|
{
|
||||||
|
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||||
|
}
|
||||||
|
dict.setCreateBy(getUsername());
|
||||||
|
return toAjax(dictTypeService.insertDictType(dict));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改字典类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||||
|
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
|
||||||
|
{
|
||||||
|
if (!dictTypeService.checkDictTypeUnique(dict))
|
||||||
|
{
|
||||||
|
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||||
|
}
|
||||||
|
dict.setUpdateBy(getUsername());
|
||||||
|
return toAjax(dictTypeService.updateDictType(dict));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除字典类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||||
|
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{dictIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] dictIds)
|
||||||
|
{
|
||||||
|
dictTypeService.deleteDictTypeByIds(dictIds);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新字典缓存
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||||
|
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||||
|
@DeleteMapping("/refreshCache")
|
||||||
|
public AjaxResult refreshCache()
|
||||||
|
{
|
||||||
|
dictTypeService.resetDictCache();
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典选择框列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/optionselect")
|
||||||
|
public AjaxResult optionselect()
|
||||||
|
{
|
||||||
|
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
||||||
|
return success(dictTypes);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysFileInfo;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.system.service.ISysFileService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "文件管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/file")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SysFileInfoController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysFileService sysFileService;
|
||||||
|
|
||||||
|
@ApiOperation("查询文件")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo query(SysFileInfo sysFileInfo) {
|
||||||
|
startPage();
|
||||||
|
List<SysFileInfo> list = sysFileService.selectFileList(sysFileInfo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "上传文件,上传后返回文件URL", notes = "0:其他、1:普通文件、2:图片、3:音频、4:视频")
|
||||||
|
@Log(title = "文件管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/upload")
|
||||||
|
public AjaxResult upload(
|
||||||
|
@RequestParam("fileType") Integer fileType,
|
||||||
|
@RequestPart("file") MultipartFile file
|
||||||
|
) {
|
||||||
|
return AjaxResult.success(sysFileService.uploadFile(file, fileType));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("删除文件")
|
||||||
|
@Log(title = "文件管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{groupIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] groupIds) {
|
||||||
|
return toAjax(sysFileService.deleteFileByIds(groupIds));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysGroup;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.system.service.ISysGroupService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "通用分组配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/group")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SysGroupController extends BaseController {
|
||||||
|
private final ISysGroupService sysGroupService;
|
||||||
|
|
||||||
|
@ApiOperation("查询通用分组配置列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:group:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysGroup sysGroup) {
|
||||||
|
startPage();
|
||||||
|
List<SysGroup> list = sysGroupService.selectSysGroupList(sysGroup);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取通用分组配置详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:group:query')")
|
||||||
|
@GetMapping(value = "/{groupId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("groupId") Long groupId) {
|
||||||
|
return success(sysGroupService.selectSysGroupByGroupId(groupId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增通用分组配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:group:add')")
|
||||||
|
@Log(title = "通用分组配置", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SysGroup sysGroup) {
|
||||||
|
return toAjax(sysGroupService.insertSysGroup(sysGroup));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改通用分组配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:group:edit')")
|
||||||
|
@Log(title = "通用分组配置", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SysGroup sysGroup) {
|
||||||
|
return toAjax(sysGroupService.updateSysGroup(sysGroup));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除通用分组配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:group:remove')")
|
||||||
|
@Log(title = "通用分组配置", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{groupIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] groupIds) {
|
||||||
|
return toAjax(sysGroupService.deleteSysGroupByGroupIds(groupIds));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.config.CmvrIotConfig;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
public class SysIndexController
|
||||||
|
{
|
||||||
|
/** 系统基础配置 */
|
||||||
|
@Autowired
|
||||||
|
private CmvrIotConfig cmvrIotConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 访问首页,提示语
|
||||||
|
*/
|
||||||
|
@RequestMapping("/")
|
||||||
|
public String index()
|
||||||
|
{
|
||||||
|
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", cmvrIotConfig.getName(), cmvrIotConfig.getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,102 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.constant.Constants;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysMenu;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysUser;
|
||||||
|
import com.cmvr.common.core.domain.model.LoginBody;
|
||||||
|
import com.cmvr.common.core.domain.model.LoginUser;
|
||||||
|
import com.cmvr.common.utils.SecurityUtils;
|
||||||
|
import com.cmvr.framework.web.service.SysLoginService;
|
||||||
|
import com.cmvr.framework.web.service.SysPermissionService;
|
||||||
|
import com.cmvr.framework.web.service.TokenService;
|
||||||
|
import com.cmvr.system.service.ISysMenuService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录验证
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@Api(tags = "登录验证")
|
||||||
|
@RestController
|
||||||
|
public class SysLoginController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SysLoginService loginService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysMenuService menuService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysPermissionService permissionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录方法
|
||||||
|
*
|
||||||
|
* @param loginBody 登录信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@ApiOperation("登录")
|
||||||
|
@PostMapping("/login")
|
||||||
|
public AjaxResult login(@RequestBody LoginBody loginBody)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
// 生成令牌
|
||||||
|
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||||
|
loginBody.getUuid());
|
||||||
|
ajax.put(Constants.TOKEN, token);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
*
|
||||||
|
* @return 用户信息
|
||||||
|
*/
|
||||||
|
@GetMapping("getInfo")
|
||||||
|
public AjaxResult getInfo()
|
||||||
|
{
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
SysUser user = loginUser.getUser();
|
||||||
|
// 角色集合
|
||||||
|
Set<String> roles = permissionService.getRolePermission(user);
|
||||||
|
// 权限集合
|
||||||
|
Set<String> permissions = permissionService.getMenuPermission(user);
|
||||||
|
if (!loginUser.getPermissions().equals(permissions))
|
||||||
|
{
|
||||||
|
loginUser.setPermissions(permissions);
|
||||||
|
tokenService.refreshToken(loginUser);
|
||||||
|
}
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("user", user);
|
||||||
|
ajax.put("roles", roles);
|
||||||
|
ajax.put("permissions", permissions);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取路由信息
|
||||||
|
*
|
||||||
|
* @return 路由信息
|
||||||
|
*/
|
||||||
|
@GetMapping("getRouters")
|
||||||
|
public AjaxResult getRouters()
|
||||||
|
{
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||||
|
return AjaxResult.success(menuService.buildMenus(menus));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,142 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.constant.UserConstants;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysMenu;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.system.service.ISysMenuService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单信息
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/menu")
|
||||||
|
public class SysMenuController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysMenuService menuService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取菜单列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:menu:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list(SysMenu menu)
|
||||||
|
{
|
||||||
|
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||||
|
return success(menus);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据菜单编号获取详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:menu:query')")
|
||||||
|
@GetMapping(value = "/{menuId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long menuId)
|
||||||
|
{
|
||||||
|
return success(menuService.selectMenuById(menuId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取菜单下拉树列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/treeselect")
|
||||||
|
public AjaxResult treeselect(SysMenu menu)
|
||||||
|
{
|
||||||
|
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||||
|
return success(menuService.buildMenuTreeSelect(menus));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载对应角色菜单列表树
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||||
|
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
|
||||||
|
{
|
||||||
|
List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
||||||
|
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增菜单
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:menu:add')")
|
||||||
|
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysMenu menu)
|
||||||
|
{
|
||||||
|
if (!menuService.checkMenuNameUnique(menu))
|
||||||
|
{
|
||||||
|
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
|
}
|
||||||
|
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
||||||
|
{
|
||||||
|
return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||||
|
}
|
||||||
|
menu.setCreateBy(getUsername());
|
||||||
|
return toAjax(menuService.insertMenu(menu));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改菜单
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
||||||
|
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
|
||||||
|
{
|
||||||
|
if (!menuService.checkMenuNameUnique(menu))
|
||||||
|
{
|
||||||
|
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
|
}
|
||||||
|
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
||||||
|
{
|
||||||
|
return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||||
|
}
|
||||||
|
else if (menu.getMenuId().equals(menu.getParentId()))
|
||||||
|
{
|
||||||
|
return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
||||||
|
}
|
||||||
|
menu.setUpdateBy(getUsername());
|
||||||
|
return toAjax(menuService.updateMenu(menu));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除菜单
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
|
||||||
|
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{menuId}")
|
||||||
|
public AjaxResult remove(@PathVariable("menuId") Long menuId)
|
||||||
|
{
|
||||||
|
if (menuService.hasChildByMenuId(menuId))
|
||||||
|
{
|
||||||
|
return warn("存在子菜单,不允许删除");
|
||||||
|
}
|
||||||
|
if (menuService.checkMenuExistRole(menuId))
|
||||||
|
{
|
||||||
|
return warn("菜单已分配,不允许删除");
|
||||||
|
}
|
||||||
|
return toAjax(menuService.deleteMenuById(menuId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.system.domain.SysNotice;
|
||||||
|
import com.cmvr.system.service.ISysNoticeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告 信息操作处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/notice")
|
||||||
|
public class SysNoticeController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysNoticeService noticeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取通知公告列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:notice:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysNotice notice)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据通知公告编号获取详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
||||||
|
@GetMapping(value = "/{noticeId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long noticeId)
|
||||||
|
{
|
||||||
|
return success(noticeService.selectNoticeById(noticeId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增通知公告
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:notice:add')")
|
||||||
|
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysNotice notice)
|
||||||
|
{
|
||||||
|
notice.setCreateBy(getUsername());
|
||||||
|
return toAjax(noticeService.insertNotice(notice));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改通知公告
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
||||||
|
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
|
||||||
|
{
|
||||||
|
notice.setUpdateBy(getUsername());
|
||||||
|
return toAjax(noticeService.updateNotice(notice));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除通知公告
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
||||||
|
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{noticeIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] noticeIds)
|
||||||
|
{
|
||||||
|
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,129 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.system.domain.SysPost;
|
||||||
|
import com.cmvr.system.service.ISysPostService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位信息操作处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/post")
|
||||||
|
public class SysPostController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysPostService postService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取岗位列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:post:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysPost post)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysPost> list = postService.selectPostList(post);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:post:export')")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysPost post)
|
||||||
|
{
|
||||||
|
List<SysPost> list = postService.selectPostList(post);
|
||||||
|
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
||||||
|
util.exportExcel(response, list, "岗位数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据岗位编号获取详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:post:query')")
|
||||||
|
@GetMapping(value = "/{postId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long postId)
|
||||||
|
{
|
||||||
|
return success(postService.selectPostById(postId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增岗位
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:post:add')")
|
||||||
|
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysPost post)
|
||||||
|
{
|
||||||
|
if (!postService.checkPostNameUnique(post))
|
||||||
|
{
|
||||||
|
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
|
}
|
||||||
|
else if (!postService.checkPostCodeUnique(post))
|
||||||
|
{
|
||||||
|
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||||
|
}
|
||||||
|
post.setCreateBy(getUsername());
|
||||||
|
return toAjax(postService.insertPost(post));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改岗位
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:post:edit')")
|
||||||
|
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysPost post)
|
||||||
|
{
|
||||||
|
if (!postService.checkPostNameUnique(post))
|
||||||
|
{
|
||||||
|
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
|
}
|
||||||
|
else if (!postService.checkPostCodeUnique(post))
|
||||||
|
{
|
||||||
|
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||||
|
}
|
||||||
|
post.setUpdateBy(getUsername());
|
||||||
|
return toAjax(postService.updatePost(post));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除岗位
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:post:remove')")
|
||||||
|
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{postIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] postIds)
|
||||||
|
{
|
||||||
|
return toAjax(postService.deletePostByIds(postIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取岗位选择框列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/optionselect")
|
||||||
|
public AjaxResult optionselect()
|
||||||
|
{
|
||||||
|
List<SysPost> posts = postService.selectPostAll();
|
||||||
|
return success(posts);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,140 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.config.CmvrIotConfig;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysUser;
|
||||||
|
import com.cmvr.common.core.domain.model.LoginUser;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.SecurityUtils;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.common.utils.file.FileUploadUtils;
|
||||||
|
import com.cmvr.common.utils.file.MimeTypeUtils;
|
||||||
|
import com.cmvr.framework.web.service.TokenService;
|
||||||
|
import com.cmvr.system.service.ISysUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人信息 业务处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/user/profile")
|
||||||
|
public class SysProfileController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人信息
|
||||||
|
*/
|
||||||
|
@GetMapping
|
||||||
|
public AjaxResult profile()
|
||||||
|
{
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
SysUser user = loginUser.getUser();
|
||||||
|
AjaxResult ajax = AjaxResult.success(user);
|
||||||
|
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
||||||
|
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户
|
||||||
|
*/
|
||||||
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult updateProfile(@RequestBody SysUser user)
|
||||||
|
{
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
SysUser currentUser = loginUser.getUser();
|
||||||
|
currentUser.setNickName(user.getNickName());
|
||||||
|
currentUser.setEmail(user.getEmail());
|
||||||
|
currentUser.setPhonenumber(user.getPhonenumber());
|
||||||
|
currentUser.setSex(user.getSex());
|
||||||
|
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
|
||||||
|
{
|
||||||
|
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
|
||||||
|
{
|
||||||
|
return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
|
||||||
|
}
|
||||||
|
if (userService.updateUserProfile(currentUser) > 0)
|
||||||
|
{
|
||||||
|
// 更新缓存用户信息
|
||||||
|
tokenService.setLoginUser(loginUser);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
return error("修改个人信息异常,请联系管理员");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置密码
|
||||||
|
*/
|
||||||
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/updatePwd")
|
||||||
|
public AjaxResult updatePwd(@RequestBody Map<String, String> params)
|
||||||
|
{
|
||||||
|
String oldPassword = params.get("oldPassword");
|
||||||
|
String newPassword = params.get("newPassword");
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
String userName = loginUser.getUsername();
|
||||||
|
String password = loginUser.getPassword();
|
||||||
|
if (!SecurityUtils.matchesPassword(oldPassword, password))
|
||||||
|
{
|
||||||
|
return error("修改密码失败,旧密码错误");
|
||||||
|
}
|
||||||
|
if (SecurityUtils.matchesPassword(newPassword, password))
|
||||||
|
{
|
||||||
|
return error("新密码不能与旧密码相同");
|
||||||
|
}
|
||||||
|
newPassword = SecurityUtils.encryptPassword(newPassword);
|
||||||
|
if (userService.resetUserPwd(userName, newPassword) > 0)
|
||||||
|
{
|
||||||
|
// 更新缓存用户密码
|
||||||
|
loginUser.getUser().setPassword(newPassword);
|
||||||
|
tokenService.setLoginUser(loginUser);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
return error("修改密码异常,请联系管理员");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像上传
|
||||||
|
*/
|
||||||
|
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/avatar")
|
||||||
|
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
||||||
|
{
|
||||||
|
if (!file.isEmpty())
|
||||||
|
{
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
String avatar = FileUploadUtils.upload(CmvrIotConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||||
|
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("imgUrl", avatar);
|
||||||
|
// 更新缓存用户头像
|
||||||
|
loginUser.getUser().setAvatar(avatar);
|
||||||
|
tokenService.setLoginUser(loginUser);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return error("上传图片异常,请联系管理员");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.model.RegisterBody;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.framework.web.service.SysRegisterService;
|
||||||
|
import com.cmvr.system.service.ISysConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册验证
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
public class SysRegisterController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SysRegisterService registerService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysConfigService configService;
|
||||||
|
|
||||||
|
@PostMapping("/register")
|
||||||
|
public AjaxResult register(@RequestBody RegisterBody user)
|
||||||
|
{
|
||||||
|
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
|
||||||
|
{
|
||||||
|
return error("当前系统没有开启注册功能!");
|
||||||
|
}
|
||||||
|
String msg = registerService.register(user);
|
||||||
|
return StringUtils.isEmpty(msg) ? success() : error(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,262 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysDept;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysRole;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysUser;
|
||||||
|
import com.cmvr.common.core.domain.model.LoginUser;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.framework.web.service.SysPermissionService;
|
||||||
|
import com.cmvr.framework.web.service.TokenService;
|
||||||
|
import com.cmvr.system.domain.SysUserRole;
|
||||||
|
import com.cmvr.system.service.ISysDeptService;
|
||||||
|
import com.cmvr.system.service.ISysRoleService;
|
||||||
|
import com.cmvr.system.service.ISysUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色信息
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/role")
|
||||||
|
public class SysRoleController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysPermissionService permissionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysRole role)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysRole> list = roleService.selectRoleList(role);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:export')")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysRole role)
|
||||||
|
{
|
||||||
|
List<SysRole> list = roleService.selectRoleList(role);
|
||||||
|
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
||||||
|
util.exportExcel(response, list, "角色数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色编号获取详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||||
|
@GetMapping(value = "/{roleId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long roleId)
|
||||||
|
{
|
||||||
|
roleService.checkRoleDataScope(roleId);
|
||||||
|
return success(roleService.selectRoleById(roleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增角色
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:add')")
|
||||||
|
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysRole role)
|
||||||
|
{
|
||||||
|
if (!roleService.checkRoleNameUnique(role))
|
||||||
|
{
|
||||||
|
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
|
}
|
||||||
|
else if (!roleService.checkRoleKeyUnique(role))
|
||||||
|
{
|
||||||
|
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||||
|
}
|
||||||
|
role.setCreateBy(getUsername());
|
||||||
|
return toAjax(roleService.insertRole(role));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存角色
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysRole role)
|
||||||
|
{
|
||||||
|
roleService.checkRoleAllowed(role);
|
||||||
|
roleService.checkRoleDataScope(role.getRoleId());
|
||||||
|
if (!roleService.checkRoleNameUnique(role))
|
||||||
|
{
|
||||||
|
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
|
}
|
||||||
|
else if (!roleService.checkRoleKeyUnique(role))
|
||||||
|
{
|
||||||
|
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||||
|
}
|
||||||
|
role.setUpdateBy(getUsername());
|
||||||
|
|
||||||
|
if (roleService.updateRole(role) > 0)
|
||||||
|
{
|
||||||
|
// 更新缓存用户权限
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
||||||
|
{
|
||||||
|
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
||||||
|
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
||||||
|
tokenService.setLoginUser(loginUser);
|
||||||
|
}
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存数据权限
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/dataScope")
|
||||||
|
public AjaxResult dataScope(@RequestBody SysRole role)
|
||||||
|
{
|
||||||
|
roleService.checkRoleAllowed(role);
|
||||||
|
roleService.checkRoleDataScope(role.getRoleId());
|
||||||
|
return toAjax(roleService.authDataScope(role));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态修改
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/changeStatus")
|
||||||
|
public AjaxResult changeStatus(@RequestBody SysRole role)
|
||||||
|
{
|
||||||
|
roleService.checkRoleAllowed(role);
|
||||||
|
roleService.checkRoleDataScope(role.getRoleId());
|
||||||
|
role.setUpdateBy(getUsername());
|
||||||
|
return toAjax(roleService.updateRoleStatus(role));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除角色
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:remove')")
|
||||||
|
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{roleIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] roleIds)
|
||||||
|
{
|
||||||
|
return toAjax(roleService.deleteRoleByIds(roleIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取角色选择框列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||||
|
@GetMapping("/optionselect")
|
||||||
|
public AjaxResult optionselect()
|
||||||
|
{
|
||||||
|
return success(roleService.selectRoleAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已分配用户角色列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||||
|
@GetMapping("/authUser/allocatedList")
|
||||||
|
public TableDataInfo allocatedList(SysUser user)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysUser> list = userService.selectAllocatedList(user);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询未分配用户角色列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||||
|
@GetMapping("/authUser/unallocatedList")
|
||||||
|
public TableDataInfo unallocatedList(SysUser user)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysUser> list = userService.selectUnallocatedList(user);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消授权用户
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
|
@PutMapping("/authUser/cancel")
|
||||||
|
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
|
||||||
|
{
|
||||||
|
return toAjax(roleService.deleteAuthUser(userRole));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量取消授权用户
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
|
@PutMapping("/authUser/cancelAll")
|
||||||
|
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
|
||||||
|
{
|
||||||
|
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量选择用户授权
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
|
@PutMapping("/authUser/selectAll")
|
||||||
|
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
|
||||||
|
{
|
||||||
|
roleService.checkRoleDataScope(roleId);
|
||||||
|
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取对应角色部门树列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||||
|
@GetMapping(value = "/deptTree/{roleId}")
|
||||||
|
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||||
|
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,256 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysDept;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysRole;
|
||||||
|
import com.cmvr.common.core.domain.entity.SysUser;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.SecurityUtils;
|
||||||
|
import com.cmvr.common.utils.StringUtils;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.system.service.ISysDeptService;
|
||||||
|
import com.cmvr.system.service.ISysPostService;
|
||||||
|
import com.cmvr.system.service.ISysRoleService;
|
||||||
|
import com.cmvr.system.service.ISysUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/user")
|
||||||
|
public class SysUserController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysPostService postService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysUser user)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysUser> list = userService.selectUserList(user);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SysUser user)
|
||||||
|
{
|
||||||
|
List<SysUser> list = userService.selectUserList(user);
|
||||||
|
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||||
|
util.exportExcel(response, list, "用户数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||||
|
@PostMapping("/importData")
|
||||||
|
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||||
|
{
|
||||||
|
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||||
|
List<SysUser> userList = util.importExcel(file.getInputStream());
|
||||||
|
String operName = getUsername();
|
||||||
|
String message = userService.importUser(userList, updateSupport, operName);
|
||||||
|
return success(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/importTemplate")
|
||||||
|
public void importTemplate(HttpServletResponse response)
|
||||||
|
{
|
||||||
|
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||||
|
util.importTemplateExcel(response, "用户数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户编号获取详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||||
|
@GetMapping(value = { "/", "/{userId}" })
|
||||||
|
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
if (StringUtils.isNotNull(userId))
|
||||||
|
{
|
||||||
|
userService.checkUserDataScope(userId);
|
||||||
|
SysUser sysUser = userService.selectUserById(userId);
|
||||||
|
ajax.put(AjaxResult.DATA_TAG, sysUser);
|
||||||
|
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
||||||
|
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
List<SysRole> roles = roleService.selectRoleAll();
|
||||||
|
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
|
ajax.put("posts", postService.selectPostAll());
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysUser user)
|
||||||
|
{
|
||||||
|
deptService.checkDeptDataScope(user.getDeptId());
|
||||||
|
roleService.checkRoleDataScope(user.getRoleIds());
|
||||||
|
if (!userService.checkUserNameUnique(user))
|
||||||
|
{
|
||||||
|
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||||
|
}
|
||||||
|
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||||
|
{
|
||||||
|
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||||
|
}
|
||||||
|
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||||
|
{
|
||||||
|
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||||
|
}
|
||||||
|
user.setCreateBy(getUsername());
|
||||||
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
|
return toAjax(userService.insertUser(user));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
||||||
|
{
|
||||||
|
userService.checkUserAllowed(user);
|
||||||
|
userService.checkUserDataScope(user.getUserId());
|
||||||
|
deptService.checkDeptDataScope(user.getDeptId());
|
||||||
|
roleService.checkRoleDataScope(user.getRoleIds());
|
||||||
|
if (!userService.checkUserNameUnique(user))
|
||||||
|
{
|
||||||
|
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||||
|
}
|
||||||
|
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||||
|
{
|
||||||
|
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||||
|
}
|
||||||
|
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||||
|
{
|
||||||
|
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||||
|
}
|
||||||
|
user.setUpdateBy(getUsername());
|
||||||
|
return toAjax(userService.updateUser(user));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{userIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] userIds)
|
||||||
|
{
|
||||||
|
if (ArrayUtils.contains(userIds, getUserId()))
|
||||||
|
{
|
||||||
|
return error("当前用户不能删除");
|
||||||
|
}
|
||||||
|
return toAjax(userService.deleteUserByIds(userIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置密码
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/resetPwd")
|
||||||
|
public AjaxResult resetPwd(@RequestBody SysUser user)
|
||||||
|
{
|
||||||
|
userService.checkUserAllowed(user);
|
||||||
|
userService.checkUserDataScope(user.getUserId());
|
||||||
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
|
user.setUpdateBy(getUsername());
|
||||||
|
return toAjax(userService.resetPwd(user));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态修改
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/changeStatus")
|
||||||
|
public AjaxResult changeStatus(@RequestBody SysUser user)
|
||||||
|
{
|
||||||
|
userService.checkUserAllowed(user);
|
||||||
|
userService.checkUserDataScope(user.getUserId());
|
||||||
|
user.setUpdateBy(getUsername());
|
||||||
|
return toAjax(userService.updateUserStatus(user));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户编号获取授权角色
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||||
|
@GetMapping("/authRole/{userId}")
|
||||||
|
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
SysUser user = userService.selectUserById(userId);
|
||||||
|
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||||
|
ajax.put("user", user);
|
||||||
|
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户授权角色
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||||
|
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||||
|
@PutMapping("/authRole")
|
||||||
|
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
||||||
|
{
|
||||||
|
userService.checkUserDataScope(userId);
|
||||||
|
roleService.checkRoleDataScope(roleIds);
|
||||||
|
userService.insertUserAuth(userId, roleIds);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门树列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||||
|
@GetMapping("/deptTree")
|
||||||
|
public AjaxResult deptTree(SysDept dept)
|
||||||
|
{
|
||||||
|
return success(deptService.selectDeptTreeList(dept));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
package com.cmvr.web.controller.system;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.system.domain.SysVehOperConfig;
|
||||||
|
import com.cmvr.system.service.ISysVehOperConfigService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车机操作配置
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@Api(tags = "车机操作配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/vehOper")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SysVehOperConfigController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysVehOperConfigService sysVehOperConfigService;
|
||||||
|
|
||||||
|
@ApiOperation("获取车机操作配置列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:vehOper:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SysVehOperConfig config) {
|
||||||
|
startPage();
|
||||||
|
List<SysVehOperConfig> list = sysVehOperConfigService.selectSysVehOperConfigList(config);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据参数编号获取详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:vehOper:query')")
|
||||||
|
@GetMapping(value = "/{configId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long configId) {
|
||||||
|
return success(sysVehOperConfigService.selectSysVehOperConfigById(configId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("新增参数配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:vehOper:add')")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Validated @RequestBody SysVehOperConfig config) {
|
||||||
|
return toAjax(sysVehOperConfigService.insertVehOperConfig(config));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改参数配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:vehOper:edit')")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody SysVehOperConfig config) {
|
||||||
|
return toAjax(sysVehOperConfigService.updateVehOperConfig(config));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除参数配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:vehOper:remove')")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{configIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] configIds) {
|
||||||
|
return success(sysVehOperConfigService.deleteVehOperConfigByIds(configIds));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
package com.cmvr.web.controller.test;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.test.model.domain.TeDetectionItem;
|
||||||
|
import com.cmvr.test.model.vo.TeDetectionItemVO;
|
||||||
|
import com.cmvr.test.service.ITeDetectionItemService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "检测项配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/test/detect")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TeDetectionItemController extends BaseController {
|
||||||
|
private final ITeDetectionItemService teDetectionItemService;
|
||||||
|
|
||||||
|
@ApiOperation("查询检测项配置列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:detect:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TeDetectionItem teDetectionItem) {
|
||||||
|
startPage();
|
||||||
|
List<TeDetectionItemVO> list = teDetectionItemService.selectTeDetectionItemList(teDetectionItem);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出检测项配置列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:detect:export')")
|
||||||
|
@Log(title = "检测项配置", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, TeDetectionItem teDetectionItem) {
|
||||||
|
List<TeDetectionItemVO> list = teDetectionItemService.selectTeDetectionItemList(teDetectionItem);
|
||||||
|
ExcelUtil<TeDetectionItemVO> util = new ExcelUtil<TeDetectionItemVO>(TeDetectionItemVO.class);
|
||||||
|
util.exportExcel(response, list, "检测项配置数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取检测项配置详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:detect:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||||
|
return success(teDetectionItemService.selectTeDetectionItemById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增检测项配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:detect:add')")
|
||||||
|
@Log(title = "检测项配置", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody TeDetectionItem teDetectionItem) {
|
||||||
|
int rows = teDetectionItemService.insertTeDetectionItem(teDetectionItem);
|
||||||
|
return toAjax(rows);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改检测项配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:detect:edit')")
|
||||||
|
@Log(title = "检测项配置", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody TeDetectionItem teDetectionItem) {
|
||||||
|
return toAjax(teDetectionItemService.updateTeDetectionItem(teDetectionItem));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除检测项配置")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:detect:remove')")
|
||||||
|
@Log(title = "检测项配置", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids) {
|
||||||
|
return toAjax(teDetectionItemService.deleteTeDetectionItemByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
package com.cmvr.web.controller.test;
|
||||||
|
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.test.flow.context.TaskContextManager;
|
||||||
|
import com.cmvr.test.flow.control.FlowControlService;
|
||||||
|
import com.cmvr.test.flow.runtime.engine.FlowTaskRuntimeService;
|
||||||
|
import com.cmvr.test.model.domain.TeDetectionItem;
|
||||||
|
import com.cmvr.test.model.vo.TeFlowViewVO;
|
||||||
|
import com.cmvr.test.model.vo.TeTaskExecuteNormalVO;
|
||||||
|
import com.cmvr.test.model.vo.TeTaskExecuteTrailVO;
|
||||||
|
import com.cmvr.test.service.ITeDetectionItemService;
|
||||||
|
import com.cmvr.test.service.ITeNodeInstService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
@Api(tags = "流程相关接口服务")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/flow")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TeFlowController extends BaseController {
|
||||||
|
|
||||||
|
private final ITeDetectionItemService teDetectionItemService;
|
||||||
|
private final ITeNodeInstService nodeInstService;
|
||||||
|
private final FlowTaskRuntimeService flowTaskRuntimeService;
|
||||||
|
private final TaskContextManager taskContextManager;
|
||||||
|
private final FlowControlService flowControlService;
|
||||||
|
|
||||||
|
@ApiOperation("流程发布")
|
||||||
|
@PostMapping("/publish")
|
||||||
|
public AjaxResult publish(@RequestBody TeDetectionItem detectionItem) {
|
||||||
|
return toAjax(teDetectionItemService.publish(detectionItem.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("任务执行入口")
|
||||||
|
@PostMapping("/execute")
|
||||||
|
public AjaxResult execute(@Valid @RequestBody TeTaskExecuteNormalVO taskExecuteNormalVO) {
|
||||||
|
return AjaxResult.success(flowTaskRuntimeService.executeTask(taskExecuteNormalVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("检测项试运行入口")
|
||||||
|
@PostMapping("/executeTrial")
|
||||||
|
public AjaxResult executeTrial(@Valid @RequestBody TeTaskExecuteTrailVO taskExecuteTrailVO) {
|
||||||
|
return AjaxResult.success(flowTaskRuntimeService.executeTrialTask(taskExecuteTrailVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("流程可视化")
|
||||||
|
@PostMapping("/view")
|
||||||
|
public AjaxResult view(@Valid @RequestBody TeFlowViewVO flowViewVO) {
|
||||||
|
return AjaxResult.success(nodeInstService.view(flowViewVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("清理终端")
|
||||||
|
@GetMapping("/clear")
|
||||||
|
public AjaxResult clear() {
|
||||||
|
taskContextManager.clearAll();
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("终止任务")
|
||||||
|
@PostMapping("/stop/{instId}")
|
||||||
|
public AjaxResult stopTask(@PathVariable String instId) {
|
||||||
|
flowControlService.stop(instId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("暂停任务")
|
||||||
|
@PostMapping("/pause/{instId}")
|
||||||
|
public AjaxResult pauseTask(@PathVariable String instId) {
|
||||||
|
flowControlService.pause(instId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("恢复任务")
|
||||||
|
@PostMapping("/resume/{instId}")
|
||||||
|
public AjaxResult resumeTask(@PathVariable String instId) {
|
||||||
|
flowControlService.resume(instId);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
package com.cmvr.web.controller.test;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.test.model.domain.TeTaskConfigInfo;
|
||||||
|
import com.cmvr.test.model.vo.TeTaskConfigInfoVO;
|
||||||
|
import com.cmvr.test.service.ITeTaskConfigInfoService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "任务配置信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/test/config")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TeTaskConfigInfoController extends BaseController {
|
||||||
|
|
||||||
|
private final ITeTaskConfigInfoService teTaskConfigInfoService;
|
||||||
|
|
||||||
|
@ApiOperation("查询任务配置信息列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:config:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TeTaskConfigInfo teTaskConfigInfo) {
|
||||||
|
startPage();
|
||||||
|
List<TeTaskConfigInfoVO> list = teTaskConfigInfoService.selectTeTaskConfigInfoList(teTaskConfigInfo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取任务配置信息详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:config:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||||
|
return success(teTaskConfigInfoService.selectTeTaskConfigInfoById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增任务配置信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:config:add')")
|
||||||
|
@Log(title = "任务配置信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody TeTaskConfigInfo teTaskConfigInfo) {
|
||||||
|
return toAjax(teTaskConfigInfoService.insertTeTaskConfigInfo(teTaskConfigInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改任务配置信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:config:edit')")
|
||||||
|
@Log(title = "任务配置信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody TeTaskConfigInfo teTaskConfigInfo) {
|
||||||
|
return toAjax(teTaskConfigInfoService.updateTeTaskConfigInfo(teTaskConfigInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除任务配置信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:config:remove')")
|
||||||
|
@Log(title = "任务配置信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids) {
|
||||||
|
return toAjax(teTaskConfigInfoService.deleteTeTaskConfigInfoByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package com.cmvr.web.controller.test;
|
||||||
|
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.test.model.vo.TeQueryTaskInstVO;
|
||||||
|
import com.cmvr.test.model.vo.TeTaskInstVO;
|
||||||
|
import com.cmvr.test.service.ITeTaskInstService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "任务实例")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/test/inst")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TeTaskInstController extends BaseController {
|
||||||
|
|
||||||
|
private final ITeTaskInstService teTaskInstService;
|
||||||
|
|
||||||
|
@ApiOperation("查询任务实例列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:inst:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TeQueryTaskInstVO queryTaskInstVO) {
|
||||||
|
startPage();
|
||||||
|
List<TeTaskInstVO> list = teTaskInstService.selectTeTaskInstList(queryTaskInstVO);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
package com.cmvr.web.controller.test;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.test.model.vo.TeQueryTaskOrchestraItemVO;
|
||||||
|
import com.cmvr.test.model.vo.TeTaskOrchestraVO;
|
||||||
|
import com.cmvr.test.service.ITeTaskOrchestrationService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "任务编排")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/test/orchestration")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
class TeTaskOrchestrationController extends BaseController {
|
||||||
|
|
||||||
|
private final ITeTaskOrchestrationService teTaskOrchestrationService;
|
||||||
|
|
||||||
|
@ApiOperation("根据任务ID查询检查项编排")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:orchestration:query')")
|
||||||
|
@GetMapping
|
||||||
|
public TableDataInfo query(
|
||||||
|
@NotEmpty(message = "任务ID不能为空")
|
||||||
|
@RequestParam("taskId") String taskId
|
||||||
|
) {
|
||||||
|
startPage();
|
||||||
|
List<TeQueryTaskOrchestraItemVO> list = teTaskOrchestrationService.queryByTaskId(taskId);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增任务编排")
|
||||||
|
@PreAuthorize("@ss.hasPermi('test:orchestration:add')")
|
||||||
|
@Log(title = "任务编排", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@Valid @RequestBody TeTaskOrchestraVO taskOrchestraVO) {
|
||||||
|
return toAjax(teTaskOrchestrationService.insertTeTaskOrchestration(taskOrchestraVO));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package com.cmvr.web.controller.test;
|
||||||
|
|
||||||
|
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.llm.model.CarIcon;
|
||||||
|
import com.cmvr.llm.service.CarPathFinderService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Api(tags = "测试接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/test/test")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TeTestController extends BaseController {
|
||||||
|
|
||||||
|
private final CarPathFinderService carPathFinderService;
|
||||||
|
|
||||||
|
@ApiOperation("查找操作路径")
|
||||||
|
@GetMapping("/path")
|
||||||
|
public AjaxResult path(
|
||||||
|
@RequestParam("manufacturer") String manufacturer,
|
||||||
|
@RequestParam("vehType") String vehType,
|
||||||
|
@RequestParam("startUi") String startUi,
|
||||||
|
@RequestParam("targetFeature") String targetFeature
|
||||||
|
) {
|
||||||
|
List<CarIcon> path = carPathFinderService.findPath(manufacturer, vehType, startUi, targetFeature);
|
||||||
|
return success(path.stream().map(CarIcon::getIconName).collect(Collectors.joining(" -> ")));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,125 @@
|
|||||||
|
package com.cmvr.web.core.config;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import com.cmvr.common.config.CmvrIotConfig;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
|
import springfox.documentation.builders.PathSelectors;
|
||||||
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||||
|
import springfox.documentation.service.ApiInfo;
|
||||||
|
import springfox.documentation.service.ApiKey;
|
||||||
|
import springfox.documentation.service.AuthorizationScope;
|
||||||
|
import springfox.documentation.service.Contact;
|
||||||
|
import springfox.documentation.service.SecurityReference;
|
||||||
|
import springfox.documentation.service.SecurityScheme;
|
||||||
|
import springfox.documentation.spi.DocumentationType;
|
||||||
|
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Swagger2的接口配置
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class SwaggerConfig
|
||||||
|
{
|
||||||
|
/** 系统基础配置 */
|
||||||
|
@Autowired
|
||||||
|
private CmvrIotConfig cmvrIotConfig;
|
||||||
|
|
||||||
|
/** 是否开启swagger */
|
||||||
|
@Value("${swagger.enabled}")
|
||||||
|
private boolean enabled;
|
||||||
|
|
||||||
|
/** 设置请求的统一前缀 */
|
||||||
|
@Value("${swagger.pathMapping}")
|
||||||
|
private String pathMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建API
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Docket createRestApi()
|
||||||
|
{
|
||||||
|
return new Docket(DocumentationType.OAS_30)
|
||||||
|
// 是否启用Swagger
|
||||||
|
.enable(enabled)
|
||||||
|
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||||
|
.apiInfo(apiInfo())
|
||||||
|
// 设置哪些接口暴露给Swagger展示
|
||||||
|
.select()
|
||||||
|
// 扫描所有有注解的api,用这种方式更灵活
|
||||||
|
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||||
|
// 扫描指定包中的swagger注解
|
||||||
|
// .apis(RequestHandlerSelectors.basePackage("com.cmvr.project.tool.swagger"))
|
||||||
|
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
.build()
|
||||||
|
/* 设置安全模式,swagger可以设置访问token */
|
||||||
|
.securitySchemes(securitySchemes())
|
||||||
|
.securityContexts(securityContexts())
|
||||||
|
.pathMapping(pathMapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全模式,这里指定token通过Authorization头请求头传递
|
||||||
|
*/
|
||||||
|
private List<SecurityScheme> securitySchemes()
|
||||||
|
{
|
||||||
|
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
|
||||||
|
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
|
||||||
|
return apiKeyList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全上下文
|
||||||
|
*/
|
||||||
|
private List<SecurityContext> securityContexts()
|
||||||
|
{
|
||||||
|
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||||
|
securityContexts.add(
|
||||||
|
SecurityContext.builder()
|
||||||
|
.securityReferences(defaultAuth())
|
||||||
|
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
|
||||||
|
.build());
|
||||||
|
return securityContexts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认的安全上引用
|
||||||
|
*/
|
||||||
|
private List<SecurityReference> defaultAuth()
|
||||||
|
{
|
||||||
|
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||||
|
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||||
|
authorizationScopes[0] = authorizationScope;
|
||||||
|
List<SecurityReference> securityReferences = new ArrayList<>();
|
||||||
|
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
|
||||||
|
return securityReferences;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加摘要信息
|
||||||
|
*/
|
||||||
|
private ApiInfo apiInfo()
|
||||||
|
{
|
||||||
|
// 用ApiInfoBuilder进行定制
|
||||||
|
return new ApiInfoBuilder()
|
||||||
|
// 设置标题
|
||||||
|
.title("标题:招商车研物联网平台管理系统_接口文档")
|
||||||
|
// 描述
|
||||||
|
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||||
|
// 作者信息
|
||||||
|
.contact(new Contact(cmvrIotConfig.getName(), null, null))
|
||||||
|
// 版本
|
||||||
|
.version("版本号:" + cmvrIotConfig.getVersion())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
restart.include.json=/com.alibaba.fastjson2.*.jar
|
||||||
108
cmvr-iot-admin/src/main/resources/application-dev.yml
Normal file
108
cmvr-iot-admin/src/main/resources/application-dev.yml
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
server:
|
||||||
|
# 服务器的HTTP端口,默认为8080
|
||||||
|
port: 13080
|
||||||
|
# 数据源配置
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
druid:
|
||||||
|
# 主库数据源
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://192.168.1.100:3306/cmvr-iot-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
username: cmvr-iot
|
||||||
|
password: cmvr-iot123456
|
||||||
|
# 从库数据源
|
||||||
|
slave:
|
||||||
|
# 从数据源开关/默认关闭
|
||||||
|
enabled: false
|
||||||
|
url:
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
# 初始连接数
|
||||||
|
initialSize: 5
|
||||||
|
# 最小连接池数量
|
||||||
|
minIdle: 10
|
||||||
|
# 最大连接池数量
|
||||||
|
maxActive: 20
|
||||||
|
# 配置获取连接等待超时的时间
|
||||||
|
maxWait: 60000
|
||||||
|
# 配置连接超时时间
|
||||||
|
connectTimeout: 30000
|
||||||
|
# 配置网络超时时间
|
||||||
|
socketTimeout: 60000
|
||||||
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
|
minEvictableIdleTimeMillis: 300000
|
||||||
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||||
|
maxEvictableIdleTimeMillis: 900000
|
||||||
|
# 配置检测连接是否有效
|
||||||
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
|
testWhileIdle: true
|
||||||
|
testOnBorrow: false
|
||||||
|
testOnReturn: false
|
||||||
|
webStatFilter:
|
||||||
|
enabled: true
|
||||||
|
statViewServlet:
|
||||||
|
enabled: true
|
||||||
|
# 设置白名单,不填则允许所有访问
|
||||||
|
allow:
|
||||||
|
url-pattern: /druid/*
|
||||||
|
# 控制台管理用户名和密码
|
||||||
|
login-username: cmvr-iot
|
||||||
|
login-password: 123456
|
||||||
|
filter:
|
||||||
|
stat:
|
||||||
|
enabled: true
|
||||||
|
# 慢SQL记录
|
||||||
|
log-slow-sql: true
|
||||||
|
slow-sql-millis: 1000
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
# 服务模块
|
||||||
|
devtools:
|
||||||
|
restart:
|
||||||
|
# 热部署开关
|
||||||
|
enabled: true
|
||||||
|
# redis 配置
|
||||||
|
redis:
|
||||||
|
# 地址
|
||||||
|
host: 192.168.1.100
|
||||||
|
# 端口,默认为6379
|
||||||
|
port: 6379
|
||||||
|
# 数据库索引
|
||||||
|
database: 0
|
||||||
|
# 密码
|
||||||
|
password: cmvr2468
|
||||||
|
# 连接超时时间
|
||||||
|
timeout: 10s
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
# 连接池中的最小空闲连接
|
||||||
|
min-idle: 0
|
||||||
|
# 连接池中的最大空闲连接
|
||||||
|
max-idle: 8
|
||||||
|
# 连接池的最大数据库连接数
|
||||||
|
max-active: 8
|
||||||
|
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
|
max-wait: -1ms
|
||||||
|
|
||||||
|
# Minio配置
|
||||||
|
minio:
|
||||||
|
url: http://192.168.1.100:9000
|
||||||
|
accessKey: AKICMVR
|
||||||
|
secretKey: wJalrXUtnFEMI
|
||||||
|
bucketName: cmvr-iot
|
||||||
|
|
||||||
|
# gRPC 客户端设置
|
||||||
|
grpc:
|
||||||
|
client:
|
||||||
|
grpc-server: # 自定义服务名
|
||||||
|
address: 'static://10.148.108.100:50051' # 调用 gRPC 的地址
|
||||||
|
# address: 'static://10.148.108.100:50051' # 调用 gRPC 的地址
|
||||||
|
enableKeepAlive: true
|
||||||
|
keepAliveWithoutCalls: true
|
||||||
|
negotiationType: plaintext # 明文传输
|
||||||
71
cmvr-iot-admin/src/main/resources/application-prod.yml
Normal file
71
cmvr-iot-admin/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
server:
|
||||||
|
# 服务器的HTTP端口,默认为8080
|
||||||
|
port: 13082
|
||||||
|
# 数据源配置
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
druid:
|
||||||
|
# 主库数据源
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://10.148.20.35:3306/cmvr-iot-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
username: cmvr-iot
|
||||||
|
password: cmvr-iot123456
|
||||||
|
# 从库数据源
|
||||||
|
slave:
|
||||||
|
# 从数据源开关/默认关闭
|
||||||
|
enabled: false
|
||||||
|
url:
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
# 初始连接数
|
||||||
|
initialSize: 5
|
||||||
|
# 最小连接池数量
|
||||||
|
minIdle: 10
|
||||||
|
# 最大连接池数量
|
||||||
|
maxActive: 20
|
||||||
|
# 配置获取连接等待超时的时间
|
||||||
|
maxWait: 60000
|
||||||
|
# 配置连接超时时间
|
||||||
|
connectTimeout: 30000
|
||||||
|
# 配置网络超时时间
|
||||||
|
socketTimeout: 60000
|
||||||
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
|
minEvictableIdleTimeMillis: 300000
|
||||||
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||||
|
maxEvictableIdleTimeMillis: 900000
|
||||||
|
# 配置检测连接是否有效
|
||||||
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
|
testWhileIdle: true
|
||||||
|
testOnBorrow: false
|
||||||
|
testOnReturn: false
|
||||||
|
webStatFilter:
|
||||||
|
enabled: true
|
||||||
|
statViewServlet:
|
||||||
|
enabled: true
|
||||||
|
# 设置白名单,不填则允许所有访问
|
||||||
|
allow:
|
||||||
|
url-pattern: /druid/*
|
||||||
|
# 控制台管理用户名和密码
|
||||||
|
login-username: cmvr-iot
|
||||||
|
login-password: 123456
|
||||||
|
filter:
|
||||||
|
stat:
|
||||||
|
enabled: true
|
||||||
|
# 慢SQL记录
|
||||||
|
log-slow-sql: true
|
||||||
|
slow-sql-millis: 1000
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
|
||||||
|
# Minio配置
|
||||||
|
minio:
|
||||||
|
url: http://localhost:9000
|
||||||
|
accessKey: minioadmin
|
||||||
|
secretKey: minioadmin
|
||||||
|
bucketName: ruoyi
|
||||||
81
cmvr-iot-admin/src/main/resources/application-test.yml
Normal file
81
cmvr-iot-admin/src/main/resources/application-test.yml
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
server:
|
||||||
|
# 服务器的HTTP端口,默认为8080
|
||||||
|
port: 13080
|
||||||
|
# 数据源配置
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
druid:
|
||||||
|
# 主库数据源
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://10.148.20.35:3306/cmvr-iot-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
username: cmvr-iot
|
||||||
|
password: cmvr-iot123456
|
||||||
|
# 从库数据源
|
||||||
|
slave:
|
||||||
|
# 从数据源开关/默认关闭
|
||||||
|
enabled: false
|
||||||
|
url:
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
# 初始连接数
|
||||||
|
initialSize: 5
|
||||||
|
# 最小连接池数量
|
||||||
|
minIdle: 10
|
||||||
|
# 最大连接池数量
|
||||||
|
maxActive: 20
|
||||||
|
# 配置获取连接等待超时的时间
|
||||||
|
maxWait: 60000
|
||||||
|
# 配置连接超时时间
|
||||||
|
connectTimeout: 30000
|
||||||
|
# 配置网络超时时间
|
||||||
|
socketTimeout: 60000
|
||||||
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
|
minEvictableIdleTimeMillis: 300000
|
||||||
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||||
|
maxEvictableIdleTimeMillis: 900000
|
||||||
|
# 配置检测连接是否有效
|
||||||
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
|
testWhileIdle: true
|
||||||
|
testOnBorrow: false
|
||||||
|
testOnReturn: false
|
||||||
|
webStatFilter:
|
||||||
|
enabled: true
|
||||||
|
statViewServlet:
|
||||||
|
enabled: true
|
||||||
|
# 设置白名单,不填则允许所有访问
|
||||||
|
allow:
|
||||||
|
url-pattern: /druid/*
|
||||||
|
# 控制台管理用户名和密码
|
||||||
|
login-username: cmvr-iot
|
||||||
|
login-password: 123456
|
||||||
|
filter:
|
||||||
|
stat:
|
||||||
|
enabled: true
|
||||||
|
# 慢SQL记录
|
||||||
|
log-slow-sql: true
|
||||||
|
slow-sql-millis: 1000
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
|
||||||
|
# Minio配置
|
||||||
|
minio:
|
||||||
|
url: http://10.148.20.35:9000
|
||||||
|
accessKey: AKIBSP
|
||||||
|
secretKey: wJalrXUtnFEMI
|
||||||
|
bucketName: cmvr-iot
|
||||||
|
|
||||||
|
# gRPC 客户端设置
|
||||||
|
grpc:
|
||||||
|
client:
|
||||||
|
grpc-server: # 自定义服务名
|
||||||
|
address: 'static://10.148.108.100:50051' # 调用 gRPC 的地址
|
||||||
|
# address: 'static://10.148.108.100:50051' # 调用 gRPC 的地址
|
||||||
|
enableKeepAlive: true
|
||||||
|
keepAliveWithoutCalls: true
|
||||||
|
negotiationType: plaintext # 明文传输
|
||||||
121
cmvr-iot-admin/src/main/resources/application.yml
Normal file
121
cmvr-iot-admin/src/main/resources/application.yml
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
# 项目相关配置
|
||||||
|
cmvr-iot:
|
||||||
|
# 名称
|
||||||
|
name: cmvr-iot
|
||||||
|
# 版本
|
||||||
|
version: 1.0.0
|
||||||
|
# 版权年份
|
||||||
|
copyrightYear: 2025
|
||||||
|
# 文件路径 示例( Windows配置D:/cmvr-iot/uploadPath,Linux配置 /home/cmvr-iot/uploadPath)
|
||||||
|
profile: D:/cmvr-iot/uploadPath
|
||||||
|
# 获取ip地址开关
|
||||||
|
addressEnabled: false
|
||||||
|
# 验证码类型 math 数字计算 char 字符验证
|
||||||
|
captchaType: math
|
||||||
|
|
||||||
|
# 开发环境配置
|
||||||
|
server:
|
||||||
|
servlet:
|
||||||
|
# 应用的访问路径
|
||||||
|
context-path: /
|
||||||
|
tomcat:
|
||||||
|
# tomcat的URI编码
|
||||||
|
uri-encoding: UTF-8
|
||||||
|
# 连接数满后的排队数,默认为100
|
||||||
|
accept-count: 1000
|
||||||
|
threads:
|
||||||
|
# tomcat最大线程数,默认为200
|
||||||
|
max: 800
|
||||||
|
# Tomcat启动初始化的线程数,默认值10
|
||||||
|
min-spare: 100
|
||||||
|
|
||||||
|
# 日志配置
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.cmv: debug
|
||||||
|
org.springframework: warn
|
||||||
|
|
||||||
|
# 用户配置
|
||||||
|
user:
|
||||||
|
password:
|
||||||
|
# 密码最大错误次数
|
||||||
|
maxRetryCount: 5
|
||||||
|
# 密码锁定时间(默认10分钟)
|
||||||
|
lockTime: 10
|
||||||
|
|
||||||
|
# Spring配置
|
||||||
|
spring:
|
||||||
|
# 资源信息
|
||||||
|
messages:
|
||||||
|
# 国际化资源文件路径
|
||||||
|
basename: i18n/messages
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
# 文件上传
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
# 单个文件大小
|
||||||
|
max-file-size: 10MB
|
||||||
|
# 设置总上传的文件大小
|
||||||
|
max-request-size: 20MB
|
||||||
|
|
||||||
|
# token配置
|
||||||
|
token:
|
||||||
|
# 令牌自定义标识
|
||||||
|
header: Authorization
|
||||||
|
# 令牌密钥
|
||||||
|
secret: abcdefghijklmnopqrstuvwxyz
|
||||||
|
# 令牌有效期(默认30分钟)
|
||||||
|
expireTime: 2147483647
|
||||||
|
|
||||||
|
# Mybatis-plus的配置
|
||||||
|
mybatis-plus:
|
||||||
|
# 对应的 XML 文件位置
|
||||||
|
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||||
|
# 实体扫描,多个package用逗号或者分号分隔
|
||||||
|
typeAliasesPackage: com.cmvr.**.domain
|
||||||
|
configuration:
|
||||||
|
# 驼峰命名
|
||||||
|
mapUnderscoreToCamelCase: true
|
||||||
|
# 是否开启缓存
|
||||||
|
cacheEnabled: true
|
||||||
|
# 日志输出
|
||||||
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
|
||||||
|
|
||||||
|
# PageHelper分页插件
|
||||||
|
pagehelper:
|
||||||
|
helperDialect: mysql
|
||||||
|
supportMethodsArguments: true
|
||||||
|
params: count=countSql
|
||||||
|
|
||||||
|
# Swagger配置
|
||||||
|
swagger:
|
||||||
|
# 是否开启swagger
|
||||||
|
enabled: true
|
||||||
|
# 请求前缀
|
||||||
|
pathMapping: /
|
||||||
|
knife4j:
|
||||||
|
# 开启屏蔽文档资源
|
||||||
|
production: false
|
||||||
|
# 是否开启Knife4j(swagger 增强版)
|
||||||
|
enable: true
|
||||||
|
setting:
|
||||||
|
language: zh-CN
|
||||||
|
enableRequestCache: true
|
||||||
|
|
||||||
|
# 防止XSS攻击
|
||||||
|
xss:
|
||||||
|
# 过滤开关
|
||||||
|
enabled: true
|
||||||
|
# 排除链接(多个用逗号分隔)
|
||||||
|
excludes: /system/notice
|
||||||
|
# 匹配链接
|
||||||
|
urlPatterns: /system/*,/monitor/*,/tool/*,/device/*,/test/*,/api/*
|
||||||
|
|
||||||
|
api:
|
||||||
|
app-id: d0epfibvo3em6c4iul40
|
||||||
|
app-key: d0eqt1kqek3vg7g4ofi0
|
||||||
|
speech-to-text-url: https://aiagentplatform.cmft.com/api/proxy/api/v1/run_app_workflow
|
||||||
|
query-result-url: https://aiagentplatform.cmft.com/api/proxy/api/v1/query_run_app_process
|
||||||
|
bge-vl: http://192.168.1.8:5000/search_similar
|
||||||
3
cmvr-iot-admin/src/main/resources/banner.txt
Normal file
3
cmvr-iot-admin/src/main/resources/banner.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Application Version: ${cmvr-iot.version}
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
|
||||||
38
cmvr-iot-admin/src/main/resources/i18n/messages.properties
Normal file
38
cmvr-iot-admin/src/main/resources/i18n/messages.properties
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#错误消息
|
||||||
|
not.null=* 必须填写
|
||||||
|
user.jcaptcha.error=验证码错误
|
||||||
|
user.jcaptcha.expire=验证码已失效
|
||||||
|
user.not.exists=用户不存在/密码错误
|
||||||
|
user.password.not.match=用户不存在/密码错误
|
||||||
|
user.password.retry.limit.count=密码输入错误{0}次
|
||||||
|
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
|
||||||
|
user.password.delete=对不起,您的账号已被删除
|
||||||
|
user.blocked=用户已封禁,请联系管理员
|
||||||
|
role.blocked=角色已封禁,请联系管理员
|
||||||
|
login.blocked=很遗憾,访问IP已被列入系统黑名单
|
||||||
|
user.logout.success=退出成功
|
||||||
|
|
||||||
|
length.not.valid=长度必须在{min}到{max}个字符之间
|
||||||
|
|
||||||
|
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
|
||||||
|
user.password.not.valid=* 5-50个字符
|
||||||
|
|
||||||
|
user.email.not.valid=邮箱格式错误
|
||||||
|
user.mobile.phone.number.not.valid=手机号格式错误
|
||||||
|
user.login.success=登录成功
|
||||||
|
user.register.success=注册成功
|
||||||
|
user.notfound=请重新登录
|
||||||
|
user.forcelogout=管理员强制退出,请重新登录
|
||||||
|
user.unknown.error=未知错误,请重新登录
|
||||||
|
|
||||||
|
##文件上传消息
|
||||||
|
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
|
||||||
|
upload.filename.exceed.length=上传的文件名最长{0}个字符
|
||||||
|
|
||||||
|
##权限
|
||||||
|
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
|
||||||
|
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
|
||||||
|
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
|
||||||
|
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
|
||||||
|
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
|
||||||
|
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
|
||||||
93
cmvr-iot-admin/src/main/resources/logback.xml
Normal file
93
cmvr-iot-admin/src/main/resources/logback.xml
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="/home/cmvr-iot/logs" />
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/sys-info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/sys-error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 用户访问日志输出 -->
|
||||||
|
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/sys-user.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 按天回滚 daily -->
|
||||||
|
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.cmvr" level="info" />
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn" />
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info" />
|
||||||
|
<appender-ref ref="file_error" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统用户操作日志-->
|
||||||
|
<logger name="sys-user" level="info">
|
||||||
|
<appender-ref ref="sys-user"/>
|
||||||
|
</logger>
|
||||||
|
</configuration>
|
||||||
20
cmvr-iot-admin/src/main/resources/mybatis/mybatis-config.xml
Normal file
20
cmvr-iot-admin/src/main/resources/mybatis/mybatis-config.xml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE configuration
|
||||||
|
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||||
|
<configuration>
|
||||||
|
<!-- 全局参数 -->
|
||||||
|
<settings>
|
||||||
|
<!-- 使全局的映射器启用或禁用缓存 -->
|
||||||
|
<setting name="cacheEnabled" value="true" />
|
||||||
|
<!-- 允许JDBC 支持自动生成主键 -->
|
||||||
|
<setting name="useGeneratedKeys" value="true" />
|
||||||
|
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
|
||||||
|
<setting name="defaultExecutorType" value="SIMPLE" />
|
||||||
|
<!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||||
|
<setting name="logImpl" value="SLF4J" />
|
||||||
|
<!-- 使用驼峰命名法转换字段 -->
|
||||||
|
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
|
||||||
|
</settings>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
60
cmvr-iot-api/cmvr-iot-edge/cmvr-iot-grpc-client/pom.xml
Normal file
60
cmvr-iot-api/cmvr-iot-edge/cmvr-iot-grpc-client/pom.xml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-edge</artifactId>
|
||||||
|
<version>3.8.9</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cmvr-iot-grpc-client</artifactId>
|
||||||
|
<description>cmvr-iot gRPC客户端</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-grpc-lib</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.devh</groupId>
|
||||||
|
<artifactId>grpc-client-spring-boot-starter</artifactId>
|
||||||
|
<version>${grpc-client.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.protobuf</groupId>
|
||||||
|
<artifactId>protobuf-java</artifactId>
|
||||||
|
<version>3.25.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-system</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-device</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-framework</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- JavaCV核心依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bytedeco</groupId>
|
||||||
|
<artifactId>javacv-platform</artifactId>
|
||||||
|
<version>1.5.9</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
package com.cmvr.edge.client.file;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
public class ByteArrayMultipartFile implements MultipartFile {
|
||||||
|
private final String name;
|
||||||
|
private final String originalFilename;
|
||||||
|
private final String contentType;
|
||||||
|
private final byte[] content;
|
||||||
|
|
||||||
|
public ByteArrayMultipartFile(String name, String originalFilename, String contentType, byte[] content) {
|
||||||
|
this.name = name;
|
||||||
|
this.originalFilename = originalFilename;
|
||||||
|
this.contentType = contentType;
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOriginalFilename() {
|
||||||
|
return originalFilename;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getContentType() {
|
||||||
|
return contentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return content == null || content.length == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getSize() {
|
||||||
|
return content.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public byte[] getBytes() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public InputStream getInputStream() {
|
||||||
|
return new ByteArrayInputStream(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void transferTo(@NotNull java.io.File dest) throws IOException, IllegalStateException {
|
||||||
|
try (java.io.FileOutputStream fos = new java.io.FileOutputStream(dest)) {
|
||||||
|
fos.write(content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
package com.cmvr.edge.client.manage;
|
||||||
|
|
||||||
|
import io.grpc.ManagedChannel;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gRPC 通道缓存
|
||||||
|
*/
|
||||||
|
public class GrpcChannelCache {
|
||||||
|
|
||||||
|
private final long ttlSeconds; // 通道存活时间(秒)
|
||||||
|
private final Map<String, ChannelWrapper> channelMap = new ConcurrentHashMap<>(); // 设备 ID -> 通道包装器
|
||||||
|
|
||||||
|
public GrpcChannelCache(long ttlSeconds) {
|
||||||
|
this.ttlSeconds = ttlSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取通道:存在则刷新时间,过期则重建,不存在则创建
|
||||||
|
*/
|
||||||
|
public ManagedChannel get(String terminalId, Function<String, ManagedChannel> supplier) {
|
||||||
|
return channelMap.compute(terminalId, (k, v) -> {
|
||||||
|
if (v == null || v.isExpired(ttlSeconds)) { // 为空或过期时重建
|
||||||
|
if (v != null) v.close(); // 关闭旧通道
|
||||||
|
return new ChannelWrapper(supplier.apply(terminalId)); // 创建新通道包装器
|
||||||
|
} else {
|
||||||
|
v.refresh(); // 更新最后访问时间
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}).getChannel();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理所有过期通道
|
||||||
|
*/
|
||||||
|
public void cleanExpiredChannels() {
|
||||||
|
channelMap.entrySet().removeIf(entry -> {
|
||||||
|
ChannelWrapper wrapper = entry.getValue();
|
||||||
|
if (wrapper.isExpired(ttlSeconds)) { // 检查过期
|
||||||
|
wrapper.close(); // 关闭通道
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通道包装器(管理通道生命周期和访问时间)
|
||||||
|
*/
|
||||||
|
private static class ChannelWrapper {
|
||||||
|
@Getter private final ManagedChannel channel; // gRPC 通道
|
||||||
|
private volatile Instant lastAccess; // 最后访问时间
|
||||||
|
|
||||||
|
public ChannelWrapper(ManagedChannel channel) {
|
||||||
|
this.channel = channel;
|
||||||
|
this.lastAccess = Instant.now(); // 初始化访问时间
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refresh() {
|
||||||
|
this.lastAccess = Instant.now(); // 更新访问时间
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isExpired(long ttlSeconds) {
|
||||||
|
// 当前时间 - TTL 秒 > 最后访问时间则过期
|
||||||
|
return Instant.now().minusSeconds(ttlSeconds).isAfter(lastAccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
try {
|
||||||
|
channel.shutdownNow(); // 立即关闭通道
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,118 @@
|
|||||||
|
package com.cmvr.edge.client.manage;
|
||||||
|
|
||||||
|
import cmvr.api.*;
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.cmvr.device.domain.DeDeviceTerminalConfig;
|
||||||
|
import com.cmvr.device.service.IDeDeviceTerminalConfigService;
|
||||||
|
import io.grpc.ManagedChannel;
|
||||||
|
import io.grpc.ManagedChannelBuilder;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gRPC链接管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class GrpcServiceManager {
|
||||||
|
|
||||||
|
private final IDeDeviceTerminalConfigService deviceTerminalConfigService;
|
||||||
|
|
||||||
|
@Value("${grpc.client.grpc-server.address}")
|
||||||
|
private String DEFAULT_GRPC_ADDRESS;
|
||||||
|
|
||||||
|
// 存储不同 Stub 的工厂
|
||||||
|
private final Map<Class<?>, GrpcClientFactory<?>> clientFactories = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
// 带 TTL 的通道缓存
|
||||||
|
private final GrpcChannelCache grpcChannelCache = new GrpcChannelCache(3 * 60); // 3分钟过期时间
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化注册支持的 gRPC Stub
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
// 注册摄像头服务的 Stub
|
||||||
|
clientFactories.put(CameraServiceGrpc.CameraServiceBlockingStub.class, new GrpcClientFactory<>(CameraServiceGrpc::newBlockingStub));
|
||||||
|
clientFactories.put(CameraServiceGrpc.CameraServiceStub.class, new GrpcClientFactory<>(CameraServiceGrpc::newStub));
|
||||||
|
// 注册系统服务的 Stub
|
||||||
|
clientFactories.put(SystemServiceGrpc.SystemServiceBlockingStub.class, new GrpcClientFactory<>(SystemServiceGrpc::newBlockingStub));
|
||||||
|
// 注册扬声器服务的 Stub
|
||||||
|
clientFactories.put(SpeakerServiceGrpc.SpeakerServiceBlockingStub.class, new GrpcClientFactory<>(SpeakerServiceGrpc::newBlockingStub));
|
||||||
|
// 注册麦克风服务的 Stub
|
||||||
|
clientFactories.put(MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class, new GrpcClientFactory<>(MicPhoneServiceGrpc::newBlockingStub));
|
||||||
|
// 注册机器人头部服务的 Stub
|
||||||
|
clientFactories.put(BioHeadServiceGrpc.BioHeadServiceBlockingStub.class, new GrpcClientFactory<>(BioHeadServiceGrpc::newBlockingStub));
|
||||||
|
// 注册机器人灵巧手服务的 Stub
|
||||||
|
clientFactories.put(DexHandServiceGrpc.DexHandServiceBlockingStub.class, new GrpcClientFactory<>(DexHandServiceGrpc::newBlockingStub));
|
||||||
|
clientFactories.put(DexHandServiceGrpc.DexHandServiceStub.class, new GrpcClientFactory<>(DexHandServiceGrpc::newStub));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 gRPC 客户端 Stub
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public <T> T getGrpcClient(String terminalId, Class<T> serviceClass) {
|
||||||
|
ManagedChannel channel = grpcChannelCache.get(terminalId, this::createChannel);
|
||||||
|
GrpcClientFactory<T> factory = (GrpcClientFactory<T>) clientFactories.get(serviceClass);
|
||||||
|
|
||||||
|
if (factory == null) {
|
||||||
|
throw new IllegalArgumentException("未知的 gRPC 服务类型: " + serviceClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
return factory.createClient(channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建gRPC通道
|
||||||
|
*/
|
||||||
|
private ManagedChannel createChannel(String terminalId) {
|
||||||
|
String grpcAddress = getGrpcServiceAddress(terminalId);
|
||||||
|
return ManagedChannelBuilder.forTarget(grpcAddress)
|
||||||
|
.usePlaintext()
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取终端地址
|
||||||
|
*/
|
||||||
|
private String getGrpcServiceAddress(String terminalId) {
|
||||||
|
DeDeviceTerminalConfig terminal = deviceTerminalConfigService.selectDeDeviceTerminalConfigById(terminalId);
|
||||||
|
if (ObjUtil.isEmpty(terminal)) {
|
||||||
|
return DEFAULT_GRPC_ADDRESS;
|
||||||
|
}
|
||||||
|
return StrUtil.format("static://{}:{}", terminal.getHost(), terminal.getPort());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定期清理过期的通道
|
||||||
|
*/
|
||||||
|
@Scheduled(fixedRate = 2 * 60 * 1000)
|
||||||
|
public void cleanExpiredChannels() {
|
||||||
|
grpcChannelCache.cleanExpiredChannels();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gRPC客户端工厂类
|
||||||
|
*/
|
||||||
|
private static class GrpcClientFactory<T> {
|
||||||
|
private final Function<ManagedChannel, T> factory;
|
||||||
|
|
||||||
|
public GrpcClientFactory(Function<ManagedChannel, T> factory) {
|
||||||
|
this.factory = factory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T createClient(ManagedChannel channel) {
|
||||||
|
return factory.apply(channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.cmvr.edge.client.manage;
|
||||||
|
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GRPC流管理器,用于管理GRPC双向流
|
||||||
|
* 提供添加、获取和移除流的方法,保证在多线程环境下的安全性
|
||||||
|
*/
|
||||||
|
public class GrpcStreamManager {
|
||||||
|
// 存储流观察者的并发哈希映射,确保线程安全
|
||||||
|
private static final ConcurrentHashMap<String, StreamObserver<?>> observers = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加或更新指定键的流观察者
|
||||||
|
* 如果该键已经存在,则不进行替换
|
||||||
|
*
|
||||||
|
* @param key 流的唯一键
|
||||||
|
* @param responseObserver 流的观察者
|
||||||
|
*/
|
||||||
|
public static void addStream(String key, StreamObserver<?> responseObserver) {
|
||||||
|
observers.putIfAbsent(key, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定键的流观察者
|
||||||
|
*
|
||||||
|
* @param key 流的唯一键
|
||||||
|
* @return 对应键的流观察者,如果不存在则返回null
|
||||||
|
*/
|
||||||
|
public static StreamObserver<?> getStream(String key) {
|
||||||
|
return observers.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除指定键的流观察者
|
||||||
|
*
|
||||||
|
* @param key 流的唯一键
|
||||||
|
* @return 被移除的流观察者,如果不存在则返回null
|
||||||
|
*/
|
||||||
|
public static StreamObserver<?> removeStream(String key) {
|
||||||
|
return observers.remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查是否包含指定的键
|
||||||
|
*
|
||||||
|
* @param key 要检查的键
|
||||||
|
* @return 如果包含返回true,否则返回false
|
||||||
|
*/
|
||||||
|
public static boolean containsKey(String key) {
|
||||||
|
return observers.containsKey(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.cmvr.edge.client.model.biohead;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EdgeCommonVO {
|
||||||
|
/**
|
||||||
|
* 终端ID
|
||||||
|
*/
|
||||||
|
private String terminalId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备ID
|
||||||
|
*/
|
||||||
|
private String deviceId;
|
||||||
|
}
|
||||||
@ -0,0 +1,195 @@
|
|||||||
|
package com.cmvr.edge.client.model.biohead;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面部表情控制参数定义
|
||||||
|
* 包含生物头部机器人面部各部位的运动参数,用于精确控制面部表情
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EdgeFacialExpressionVO extends EdgeCommonVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 眉毛参数封装
|
||||||
|
*/
|
||||||
|
private Eyebrow eyebrow;
|
||||||
|
/**
|
||||||
|
* 眼睑参数封装
|
||||||
|
*/
|
||||||
|
private Eyelid eyelid;
|
||||||
|
/**
|
||||||
|
* 眼球参数封装
|
||||||
|
*/
|
||||||
|
private Eyeball eyeball;
|
||||||
|
/**
|
||||||
|
* 嘴巴参数封装
|
||||||
|
*/
|
||||||
|
private Mouth mouth;
|
||||||
|
/**
|
||||||
|
* 鼻子参数封装
|
||||||
|
*/
|
||||||
|
private Nose nose;
|
||||||
|
/**
|
||||||
|
* 左唇角控制参数
|
||||||
|
*/
|
||||||
|
private LeftLip leftLip;
|
||||||
|
/**
|
||||||
|
* 右唇角控制参数
|
||||||
|
*/
|
||||||
|
private RightLip rightLip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下巴参数封装
|
||||||
|
*/
|
||||||
|
private Jaw jaw;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 眉毛控制参数
|
||||||
|
* 左右眉毛的内外侧垂直位置(0.0-1.0标准化值)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Eyebrow {
|
||||||
|
/**
|
||||||
|
* 左眉外侧垂直位置
|
||||||
|
*/
|
||||||
|
private float leftOutsideY;
|
||||||
|
/**
|
||||||
|
* 左眉内侧垂直位置
|
||||||
|
*/
|
||||||
|
private float leftInsideY;
|
||||||
|
/**
|
||||||
|
* 右眉外侧垂直位置
|
||||||
|
*/
|
||||||
|
private float rightOutsideY;
|
||||||
|
/**
|
||||||
|
* 右眉内侧垂直位置
|
||||||
|
*/
|
||||||
|
private float rightInsideY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 眼睑控制参数
|
||||||
|
* 左右眼睑的上下位置(0.0-1.0标准化值)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Eyelid {
|
||||||
|
/**
|
||||||
|
* 左上眼睑垂直位置
|
||||||
|
*/
|
||||||
|
private float leftUpperY;
|
||||||
|
/**
|
||||||
|
* 左下眼睑垂直位置
|
||||||
|
*/
|
||||||
|
private float leftLowerY;
|
||||||
|
/**
|
||||||
|
* 右上眼睑垂直位置
|
||||||
|
*/
|
||||||
|
private float rightUpperY;
|
||||||
|
/**
|
||||||
|
* 右下眼睑垂直位置
|
||||||
|
*/
|
||||||
|
private float rightLowerY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 眼球控制参数
|
||||||
|
* 左右眼球的二维坐标(-1.0到1.0标准化值,中心为0)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Eyeball {
|
||||||
|
/**
|
||||||
|
* 左眼球水平位置
|
||||||
|
*/
|
||||||
|
private float leftX;
|
||||||
|
/**
|
||||||
|
* 左眼球垂直位置
|
||||||
|
*/
|
||||||
|
private float leftY;
|
||||||
|
/**
|
||||||
|
* 右眼球水平位置
|
||||||
|
*/
|
||||||
|
private float rightX;
|
||||||
|
/**
|
||||||
|
* 右眼球垂直位置
|
||||||
|
*/
|
||||||
|
private float rightY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 嘴巴控制参数
|
||||||
|
* 包含嘴唇整体位置(仅含上唇/下唇 y 坐标)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Mouth {
|
||||||
|
/**
|
||||||
|
* 上唇垂直位置
|
||||||
|
*/
|
||||||
|
private float upperLipY;
|
||||||
|
/**
|
||||||
|
* 下唇垂直位置
|
||||||
|
*/
|
||||||
|
private float lowerLipY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 鼻子控制参数
|
||||||
|
* 鼻子左右侧的垂直位置(0.0-1.0标准化值)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Nose {
|
||||||
|
/**
|
||||||
|
* 鼻子左侧垂直位置
|
||||||
|
*/
|
||||||
|
private float leftY;
|
||||||
|
/**
|
||||||
|
* 鼻子右侧垂直位置
|
||||||
|
*/
|
||||||
|
private float rightY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 左唇角控制参数
|
||||||
|
* 包含上唇、唇角、下唇的坐标点
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class LeftLip {
|
||||||
|
private float upperX;
|
||||||
|
private float upperY;
|
||||||
|
private float cornerX;
|
||||||
|
private float cornerY;
|
||||||
|
private float lowerX;
|
||||||
|
private float lowerY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 右唇角控制参数
|
||||||
|
* 结构与左唇角对称
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class RightLip {
|
||||||
|
private float upperX;
|
||||||
|
private float upperY;
|
||||||
|
private float cornerX;
|
||||||
|
private float cornerY;
|
||||||
|
private float lowerX;
|
||||||
|
private float lowerY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下巴控制参数
|
||||||
|
* 下巴的二维移动坐标(X/Y轴)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Jaw {
|
||||||
|
/**
|
||||||
|
* 下巴水平位置
|
||||||
|
*/
|
||||||
|
private float x;
|
||||||
|
/**
|
||||||
|
* 下巴垂直位置
|
||||||
|
*/
|
||||||
|
private float y;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
package com.cmvr.edge.client.service;public interface DeviceListService {
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
|
import com.cmvr.edge.client.model.biohead.EdgeCommonVO;
|
||||||
|
import com.cmvr.edge.client.model.biohead.EdgeFacialExpressionVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘系统 生物头部机器人服务
|
||||||
|
*/
|
||||||
|
public interface EdgeBioHeadService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置面部表情
|
||||||
|
*/
|
||||||
|
public String setExpression(EdgeFacialExpressionVO facialExpressionVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取状态
|
||||||
|
*/
|
||||||
|
public String getSystemStatus(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急停止
|
||||||
|
*/
|
||||||
|
public String emergencyStop(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
|
import cmvr.api.CameraCommand;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘系统摄像头服务
|
||||||
|
*/
|
||||||
|
public interface EdgeCameraService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取相机状态
|
||||||
|
*/
|
||||||
|
public CameraCommand.CameraState status(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验相机状态
|
||||||
|
*/
|
||||||
|
public boolean checkStatus(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始相机服务
|
||||||
|
*/
|
||||||
|
public String start(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束相机服务
|
||||||
|
*/
|
||||||
|
public String stop(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取相机图片
|
||||||
|
*/
|
||||||
|
public String getRGBImage(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始录制视频
|
||||||
|
*/
|
||||||
|
public String startRecording(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止录制视频
|
||||||
|
*/
|
||||||
|
public String stopRecording(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取相机图片组
|
||||||
|
*/
|
||||||
|
public String getRGBDImages(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
void getDepthImageStream(String terminalId, String deviceId);
|
||||||
|
void getRGBDImagesStream(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
|
import cmvr.api.DexhandCommand;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 边缘设备 DexHandService 接口
|
||||||
|
*/
|
||||||
|
public interface EdgeDexHandService {
|
||||||
|
// 基本控制
|
||||||
|
DexhandCommand.DexHandState getStatus(String terminalId, String deviceId);
|
||||||
|
void setDexHandPos(String terminalId, String deviceId);
|
||||||
|
void setDexHandAngle(String terminalId, String deviceId, int id, float value) ;
|
||||||
|
void setDexHandForce(String terminalId, String deviceId) ;
|
||||||
|
void setDexHandSpeed(String terminalId, String deviceId) ;
|
||||||
|
void setDexHandPresetAct(String terminalId, String deviceId);
|
||||||
|
String getSensorData(String terminalId, String deviceId) ;
|
||||||
|
StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Request> getSensorDataStream(String terminalId, String deviceId) ;
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
|
import cmvr.api.MicrophoneCommand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘麦克风服务接口
|
||||||
|
* 定义了与边缘麦克风进行交互的所有方法
|
||||||
|
* 包括获取状态、录音控制、音量控制等功能
|
||||||
|
*/
|
||||||
|
public interface EdgeMicrophoneService {
|
||||||
|
/**
|
||||||
|
* 获取麦克风当前状态
|
||||||
|
* 通过gRPC调用获取麦克风的运行状态,包括是否正在录音、音量等信息
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @return MicState 返回麦克风的当前状态
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
MicrophoneCommand.GetMicStateCommand.Feedback getStatus(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始录音
|
||||||
|
* 通过gRPC调用开始录音,将录音保存到指定路径
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @param filePath 录音文件的保存路径
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void startRecord(String terminalId, String deviceId, String filePath);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止录音
|
||||||
|
* 通过gRPC调用停止麦克风的当前录音
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void stopRecord(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停录音
|
||||||
|
* 通过gRPC调用暂停麦克风的当前录音
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void pauseRecord(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复录音
|
||||||
|
* 通过gRPC调用恢复麦克风之前暂停的录音
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void resumeRecord(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置麦克风音量
|
||||||
|
* 通过gRPC调用设置麦克风的音量大小
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @param volume 音量大小(0-100)
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void setVolume(String terminalId, String deviceId, int volume);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前音量
|
||||||
|
* 通过gRPC调用获取麦克风的当前音量大小
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @return int 返回当前音量大小(0-100)
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
int getVolume(String terminalId, String deviceId);
|
||||||
|
}
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
|
import cmvr.api.SpeakerCommand;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘扬声器服务接口
|
||||||
|
* 定义了与边缘扬声器进行交互的所有方法
|
||||||
|
* 包括获取状态、播放控制、音量控制等功能
|
||||||
|
*/
|
||||||
|
public interface EdgeSpeakerService {
|
||||||
|
/**
|
||||||
|
* 获取扬声器当前状态
|
||||||
|
* 通过gRPC调用获取扬声器的运行状态,包括是否正在播放、音量等信息
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @return SpeakerState 返回扬声器的当前状态
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
SpeakerCommand.GetSpeakerStateCommand.Feedback getStatus(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 播放音频文件
|
||||||
|
* 通过gRPC调用播放指定路径的音频文件
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @param audioPath 音频文件的路径
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void playAudio(String terminalId, String deviceId, String audioPath);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止当前播放
|
||||||
|
* 通过gRPC调用停止扬声器的当前播放
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void stopPlayback(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停当前播放
|
||||||
|
* 通过gRPC调用暂停扬声器的当前播放
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void pausePlayback(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复暂停的播放
|
||||||
|
* 通过gRPC调用恢复扬声器之前暂停的播放
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void resumePlayback(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置扬声器音量
|
||||||
|
* 通过gRPC调用设置扬声器的音量大小
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @param volume 音量大小(0-100)
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
void setVolume(String terminalId, String deviceId, int volume);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前音量
|
||||||
|
* 通过gRPC调用获取扬声器的当前音量大小
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @return int 返回当前音量大小(0-100)
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
int getVolume(String terminalId, String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有音频文件
|
||||||
|
* 通过http获取所有音频文件列表
|
||||||
|
*
|
||||||
|
* @return String[] 返回音频文件列表
|
||||||
|
*/
|
||||||
|
List<String> getAll();
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
package com.cmvr.edge.client.service;
|
||||||
|
// 标记接口,无需定义具体方法
|
||||||
|
public interface EdgeStreamService { }
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
|
import cmvr.api.SystemCommand;
|
||||||
|
import com.cmvr.device.domain.DeDeviceRegistration;
|
||||||
|
import com.cmvr.device.domain.vo.Device;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘系统服务接口
|
||||||
|
*/
|
||||||
|
public interface EdgeSystemService {
|
||||||
|
/**
|
||||||
|
* 获取系统状态
|
||||||
|
* @return 系统状态信息,包含CPU使用率、内存使用情况、磁盘使用情况和设备列表
|
||||||
|
*/
|
||||||
|
SystemCommand.GetSystemStatusCommand.Feedback getSystemStatus(String terminalId);
|
||||||
|
|
||||||
|
|
||||||
|
public List<DeDeviceRegistration> deviceList(String terminalId);
|
||||||
|
}
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import cmvr.api.BioHeadServiceGrpc;
|
||||||
|
import cmvr.api.BioheadCommand;
|
||||||
|
import cmvr.api.Common;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.model.biohead.EdgeCommonVO;
|
||||||
|
import com.cmvr.edge.client.model.biohead.EdgeFacialExpressionVO;
|
||||||
|
import com.cmvr.edge.client.service.EdgeBioHeadService;
|
||||||
|
import com.cmvr.edge.client.utils.EdgeCommonUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeBioHeadServiceImpl implements EdgeBioHeadService {
|
||||||
|
|
||||||
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String setExpression(EdgeFacialExpressionVO facialExpressionVo) {
|
||||||
|
String terminalId = facialExpressionVo.getTerminalId();
|
||||||
|
String deviceId = facialExpressionVo.getDeviceId();
|
||||||
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 请求头
|
||||||
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
|
|
||||||
|
// 映射面部表情参数
|
||||||
|
BioheadCommand.FacialExpression.Builder expressionBuilder = BioheadCommand.FacialExpression.newBuilder();
|
||||||
|
|
||||||
|
// 映射 Eyebrow
|
||||||
|
EdgeFacialExpressionVO.Eyebrow eyebrow = facialExpressionVo.getEyebrow();
|
||||||
|
if (eyebrow != null) {
|
||||||
|
expressionBuilder.setEyebrow(
|
||||||
|
BioheadCommand.FacialExpression.Eyebrow.newBuilder()
|
||||||
|
.setLeftOutsideY(eyebrow.getLeftOutsideY())
|
||||||
|
.setLeftInsideY(eyebrow.getLeftInsideY())
|
||||||
|
.setRightOutsideY(eyebrow.getRightOutsideY())
|
||||||
|
.setRightInsideY(eyebrow.getRightInsideY())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 映射 Eyelid
|
||||||
|
EdgeFacialExpressionVO.Eyelid eyelid = facialExpressionVo.getEyelid();
|
||||||
|
if (eyelid != null) {
|
||||||
|
expressionBuilder.setEyelid(BioheadCommand.FacialExpression.Eyelid.newBuilder()
|
||||||
|
.setLeftUpperY(eyelid.getLeftUpperY())
|
||||||
|
.setLeftLowerY(eyelid.getLeftLowerY())
|
||||||
|
.setRightUpperY(eyelid.getRightUpperY())
|
||||||
|
.setRightLowerY(eyelid.getRightLowerY())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 映射 Eyeball
|
||||||
|
EdgeFacialExpressionVO.Eyeball eyeball = facialExpressionVo.getEyeball();
|
||||||
|
if (eyeball != null) {
|
||||||
|
expressionBuilder.setEyeball(BioheadCommand.FacialExpression.Eyeball.newBuilder()
|
||||||
|
.setLeftX(eyeball.getLeftX())
|
||||||
|
.setLeftY(eyeball.getLeftY())
|
||||||
|
.setRightX(eyeball.getRightX())
|
||||||
|
.setRightY(eyeball.getRightY()).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 映射 Mouth
|
||||||
|
EdgeFacialExpressionVO.Mouth mouth = facialExpressionVo.getMouth();
|
||||||
|
if (mouth != null) {
|
||||||
|
expressionBuilder.setMouth(BioheadCommand.FacialExpression.Mouth.newBuilder()
|
||||||
|
.setUpperLipY(mouth.getUpperLipY())
|
||||||
|
.setLowerLipY(mouth.getLowerLipY())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 映射 Nose
|
||||||
|
EdgeFacialExpressionVO.Nose nose = facialExpressionVo.getNose();
|
||||||
|
if (nose != null) {
|
||||||
|
expressionBuilder.setNose(BioheadCommand.FacialExpression.Nose.newBuilder()
|
||||||
|
.setLeftY(nose.getLeftY())
|
||||||
|
.setRightY(nose.getRightY())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 映射 Jaw
|
||||||
|
EdgeFacialExpressionVO.Jaw jaw = facialExpressionVo.getJaw();
|
||||||
|
if (jaw != null) {
|
||||||
|
expressionBuilder.setJaw(BioheadCommand.FacialExpression.Jaw.newBuilder()
|
||||||
|
.setX(jaw.getX())
|
||||||
|
.setY(jaw.getY())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构造完整请求
|
||||||
|
BioheadCommand.SetFacialExpression.Request request = BioheadCommand.SetFacialExpression.Request.newBuilder()
|
||||||
|
.setHeader(header)
|
||||||
|
.setExpression(expressionBuilder.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
BioheadCommand.SetFacialExpression.Feedback feedback = stub.setExpression(request);
|
||||||
|
return JSON.toJSONString(feedback.getHeader());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSystemStatus(EdgeCommonVO edgeCommonVO) {
|
||||||
|
String terminalId = edgeCommonVO.getTerminalId();
|
||||||
|
String deviceId = edgeCommonVO.getDeviceId();
|
||||||
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 请求头
|
||||||
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
|
|
||||||
|
BioheadCommand.GetStatus.Request request = BioheadCommand.GetStatus.Request.newBuilder()
|
||||||
|
.setHeader(header)
|
||||||
|
.build();
|
||||||
|
BioheadCommand.GetStatus.Feedback feedback = stub.getSystemStatus(request);
|
||||||
|
return JSON.toJSONString(feedback.getHeader());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String emergencyStop(EdgeCommonVO edgeCommonVO) {
|
||||||
|
String terminalId = edgeCommonVO.getTerminalId();
|
||||||
|
String deviceId = edgeCommonVO.getDeviceId();
|
||||||
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 请求头
|
||||||
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
|
|
||||||
|
BioheadCommand.EmergencyStop.Request request = BioheadCommand.EmergencyStop.Request.newBuilder()
|
||||||
|
.setHeader(header)
|
||||||
|
.build();
|
||||||
|
BioheadCommand.EmergencyStop.Feedback feedback = stub.emergencyStop(request);
|
||||||
|
return JSON.toJSONString(feedback.getHeader());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,378 @@
|
|||||||
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import cmvr.api.CameraCommand;
|
||||||
|
import cmvr.api.CameraServiceGrpc;
|
||||||
|
import cmvr.api.Common;
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.cmvr.common.enums.FileType;
|
||||||
|
import com.cmvr.common.exception.GlobalException;
|
||||||
|
import com.cmvr.edge.client.file.ByteArrayMultipartFile;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.service.EdgeCameraService;
|
||||||
|
import com.cmvr.edge.client.service.EdgeStreamService;
|
||||||
|
import com.cmvr.edge.client.utils.H265DecoderUtil;
|
||||||
|
import com.cmvr.framework.websocket.service.MessagePushService;
|
||||||
|
import com.cmvr.system.service.ISysFileService;
|
||||||
|
import com.google.protobuf.ByteString;
|
||||||
|
import com.google.protobuf.Timestamp;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.color.ColorSpace;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.awt.image.ColorModel;
|
||||||
|
import java.awt.image.ComponentColorModel;
|
||||||
|
import java.awt.image.DataBuffer;
|
||||||
|
import java.awt.image.DataBufferByte;
|
||||||
|
import java.awt.image.Raster;
|
||||||
|
import java.awt.image.WritableRaster;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamService {
|
||||||
|
|
||||||
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
private final ISysFileService sysFileService;
|
||||||
|
|
||||||
|
private final MessagePushService messagePushService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CameraCommand.CameraState status(String terminalId, String deviceId) {
|
||||||
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
|
CameraCommand.GetCameraStateCommand.Request request = CameraCommand.GetCameraStateCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
return executeGrpcCall(() -> stub.getStatus(request)).getState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkStatus(String terminalId, String deviceId) {
|
||||||
|
CameraCommand.CameraState state = status(terminalId, deviceId);
|
||||||
|
if (state.getIsError()) {
|
||||||
|
throw new GlobalException("Camera is in error state");
|
||||||
|
}
|
||||||
|
return state.getIsOpened() && state.getIsStreaming();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String start(String terminalId, String deviceId) {
|
||||||
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
|
CameraCommand.StartCameraCommand.Request request = CameraCommand.StartCameraCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
Common.CommandHeader.Feedback header = executeGrpcCall(() -> stub.startCamera(request)).getHeader();
|
||||||
|
return JSON.toJSONString(header);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String stop(String terminalId, String deviceId) {
|
||||||
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
|
CameraCommand.StopCameraCommand.Request request = CameraCommand.StopCameraCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
Common.CommandHeader.Feedback header = executeGrpcCall(() -> stub.stopCamera(request)).getHeader();
|
||||||
|
return JSON.toJSONString(header);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRGBImage(String terminalId, String deviceId) {
|
||||||
|
|
||||||
|
if (!checkStatus(terminalId, deviceId)) {
|
||||||
|
start(terminalId, deviceId);
|
||||||
|
}
|
||||||
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
|
CameraCommand.GetRGBImageCommand.Request request = CameraCommand.GetRGBImageCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
CameraCommand.GetRGBImageCommand.Feedback feedback = executeGrpcCall(() -> stub.getRGBImage(request));
|
||||||
|
CameraCommand.FrameData frame = feedback.getColorFrame();
|
||||||
|
if (!feedback.hasColorFrame() || frame.getWidth() <= 0 || frame.getHeight() <= 0) {
|
||||||
|
throw new GlobalException("响应图片数据无效");
|
||||||
|
}
|
||||||
|
String filePath = saveImage(frame.getData(), frame.getWidth(), frame.getHeight());
|
||||||
|
try {
|
||||||
|
MultipartFile file = convertFileToMultipartFile(filePath);
|
||||||
|
return sysFileService.uploadFile(file, FileType.IMAGE.code());
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new GlobalException("图片上传失败: " + e.getMessage());
|
||||||
|
} finally {
|
||||||
|
deleteTempFile(filePath);
|
||||||
|
// todo 暂时不关闭摄像头
|
||||||
|
// stop(terminalId, deviceId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String startRecording(String terminalId, String deviceId) {
|
||||||
|
if (!checkStatus(terminalId, deviceId)) {
|
||||||
|
start(terminalId, deviceId);
|
||||||
|
}
|
||||||
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
|
String videoPath = StrUtil.format("{}/{}_{}.mp4", "/home/share/assets/video", deviceId, System.currentTimeMillis());
|
||||||
|
|
||||||
|
CameraCommand.StartCameraRecordingCommand.Request request = CameraCommand.StartCameraRecordingCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.setVideoPath(videoPath)
|
||||||
|
.build();
|
||||||
|
executeGrpcCall(() -> stub.startRecording(request));
|
||||||
|
return videoPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String stopRecording(String terminalId, String deviceId) {
|
||||||
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
|
CameraCommand.StopCameraRecordingCommand.Request request = CameraCommand.StopCameraRecordingCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
Common.CommandHeader.Feedback header = executeGrpcCall(() -> stub.stopRecording(request)).getHeader();
|
||||||
|
return JSON.toJSONString(header);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRGBDImages(String terminalId, String deviceId) {
|
||||||
|
if (!checkStatus(terminalId, deviceId)) {
|
||||||
|
start(terminalId, deviceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
|
CameraCommand.GetRGBDImagesCommand.Request request = CameraCommand.GetRGBDImagesCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
CameraCommand.GetRGBDImagesCommand.Feedback feedback = executeGrpcCall(() -> stub.getRGBDImages(request));
|
||||||
|
|
||||||
|
return JSON.toJSONString(feedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 缓冲区和收集状态
|
||||||
|
private final List<byte[]> framesBuffer = new ArrayList<>();
|
||||||
|
private boolean isCollectingFrames = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(String terminalId, String deviceId) {
|
||||||
|
if (!checkStatus(terminalId, deviceId)) {
|
||||||
|
start(terminalId, deviceId);
|
||||||
|
}
|
||||||
|
CameraServiceGrpc.CameraServiceStub stub = grpcServiceManager.getGrpcClient(terminalId, CameraServiceGrpc.CameraServiceStub.class);
|
||||||
|
// 创建StreamObserver来处理响应
|
||||||
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Feedback> responseObserver = new StreamObserver<CameraCommand.GetRGBImageStreamCommand.Feedback>() {
|
||||||
|
@Override
|
||||||
|
public void onNext(CameraCommand.GetRGBImageStreamCommand.Feedback value) {
|
||||||
|
CameraCommand.FrameData frame = value.getColorFrame();
|
||||||
|
byte[] frameData = frame.getData().toByteArray();
|
||||||
|
|
||||||
|
if (frame.getIsKeyFrame()) { // I帧
|
||||||
|
if (isCollectingFrames) {
|
||||||
|
// 处理之前的缓冲区数据
|
||||||
|
String videoBase64 = H265DecoderUtil.convertH265FramesToVideo(framesBuffer);
|
||||||
|
if (videoBase64 != null) {
|
||||||
|
messagePushService.pushToChannel(
|
||||||
|
"edgeCameraServiceImpl/getRGBImageStream/" + terminalId + "/" + deviceId,
|
||||||
|
videoBase64
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// 重置缓冲区
|
||||||
|
framesBuffer.clear();
|
||||||
|
}
|
||||||
|
// 开始新收集段
|
||||||
|
framesBuffer.add(frameData);
|
||||||
|
isCollectingFrames = true;
|
||||||
|
} else {
|
||||||
|
// 非I帧且正在收集时加入缓冲区
|
||||||
|
if (isCollectingFrames) {
|
||||||
|
framesBuffer.add(frameData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable t) {
|
||||||
|
// 记录详细的错误信息
|
||||||
|
log.error("Error occurred in getRGBImageStream for terminalId: {}, deviceId: {}. Error: {}", terminalId, deviceId, t.getMessage(), t);
|
||||||
|
// 推送错误信息
|
||||||
|
messagePushService.pushToChannel("edgeCameraServiceImpl/getRGBImageStream/" + terminalId + "/" + deviceId, "500");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCompleted() {
|
||||||
|
// 流结束
|
||||||
|
System.out.println("Stream completed.");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 创建StreamObserver来发送请求
|
||||||
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> requestObserver = stub.getRGBImageStream(responseObserver);
|
||||||
|
|
||||||
|
// 构建请求并发送
|
||||||
|
CameraCommand.GetRGBImageStreamCommand.Request request = CameraCommand.GetRGBImageStreamCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.setEof(false)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
requestObserver.onNext(request);
|
||||||
|
return requestObserver;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getDepthImageStream(String terminalId, String deviceId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getRGBDImagesStream(String terminalId, String deviceId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Common.CommandHeader.Request buildRequest(String deviceId) {
|
||||||
|
return Common.CommandHeader.Request.newBuilder()
|
||||||
|
.setDeviceId(deviceId)
|
||||||
|
.setTimestamp(
|
||||||
|
Timestamp.newBuilder()
|
||||||
|
.setSeconds(System.currentTimeMillis() / 1000)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@FunctionalInterface
|
||||||
|
private interface GrpcCall<T> {
|
||||||
|
T call() throws Exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> T executeGrpcCall(GrpcCall<T> call) {
|
||||||
|
try {
|
||||||
|
return call.call();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new GlobalException("gRPC 调用失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String rgbToBase64Bmp(byte[] rgbData, int width, int height) throws IOException {
|
||||||
|
int rowSize = (width * 3 + 3) & ~3; // BMP 行对齐
|
||||||
|
int imageSize = rowSize * height;
|
||||||
|
int fileSize = 54 + imageSize;
|
||||||
|
|
||||||
|
ByteArrayOutputStream baos = new ByteArrayOutputStream(fileSize);
|
||||||
|
DataOutputStream dos = new DataOutputStream(baos);
|
||||||
|
|
||||||
|
// BMP Header
|
||||||
|
dos.writeBytes("BM");
|
||||||
|
dos.writeInt(Integer.reverseBytes(fileSize));
|
||||||
|
dos.writeInt(0);
|
||||||
|
dos.writeInt(Integer.reverseBytes(54));
|
||||||
|
|
||||||
|
// DIB Header
|
||||||
|
dos.writeInt(Integer.reverseBytes(40));
|
||||||
|
dos.writeInt(Integer.reverseBytes(width));
|
||||||
|
dos.writeInt(Integer.reverseBytes(height));
|
||||||
|
dos.writeShort(Short.reverseBytes((short) 1));
|
||||||
|
dos.writeShort(Short.reverseBytes((short) 24));
|
||||||
|
dos.writeInt(0);
|
||||||
|
dos.writeInt(Integer.reverseBytes(imageSize));
|
||||||
|
dos.writeInt(0);
|
||||||
|
dos.writeInt(0);
|
||||||
|
dos.writeInt(0);
|
||||||
|
dos.writeInt(0);
|
||||||
|
|
||||||
|
// Pixel Data (BMP 是 BGR 顺序,从下往上存储)
|
||||||
|
for (int y = height - 1; y >= 0; y--) {
|
||||||
|
int rowStart = y * width * 3;
|
||||||
|
for (int x = 0; x < width; x++) {
|
||||||
|
int pixelStart = rowStart + x * 3;
|
||||||
|
dos.write(rgbData[pixelStart + 0]); // B
|
||||||
|
dos.write(rgbData[pixelStart + 1]); // G
|
||||||
|
dos.write(rgbData[pixelStart + 2]); // R
|
||||||
|
}
|
||||||
|
// 行填充
|
||||||
|
for (int i = width * 3; i < rowSize; i++) {
|
||||||
|
dos.write(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] bmpBytes = baos.toByteArray();
|
||||||
|
return Base64.getEncoder().encodeToString(bmpBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 临时保存图片
|
||||||
|
*/
|
||||||
|
private String saveImage(ByteString pixelData, int width, int height) {
|
||||||
|
File tempDir = new File(System.getProperty("java.io.tmpdir"));
|
||||||
|
FileUtil.mkdir(tempDir);
|
||||||
|
|
||||||
|
// 生成唯一文件名(时间戳)
|
||||||
|
String fileName = System.currentTimeMillis() + ".jpg";
|
||||||
|
String filePath = Paths.get(tempDir.getAbsolutePath(), fileName).toString();
|
||||||
|
try {
|
||||||
|
byte[] pixels = pixelData.toByteArray();
|
||||||
|
|
||||||
|
// 每个像素 3 字节(R, G, B),按行排列
|
||||||
|
DataBuffer buffer = new DataBufferByte(pixels, pixels.length);
|
||||||
|
|
||||||
|
// 每像素 3 字节,每行 stride 是 3 * width
|
||||||
|
WritableRaster raster = Raster.createInterleavedRaster(
|
||||||
|
buffer, width, height, 3 * width, 3,
|
||||||
|
new int[]{2, 1, 0}, null
|
||||||
|
);
|
||||||
|
|
||||||
|
ColorModel colorModel = new ComponentColorModel(
|
||||||
|
ColorSpace.getInstance(ColorSpace.CS_sRGB),
|
||||||
|
false, false,
|
||||||
|
Transparency.OPAQUE,
|
||||||
|
DataBuffer.TYPE_BYTE
|
||||||
|
);
|
||||||
|
|
||||||
|
BufferedImage image = new BufferedImage(colorModel, raster, false, null);
|
||||||
|
File output = new File(filePath);
|
||||||
|
ImageIO.write(image, "jpg", output);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new GlobalException(e.getMessage());
|
||||||
|
}
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将本地文件转换为 MultipartFile
|
||||||
|
*/
|
||||||
|
private MultipartFile convertFileToMultipartFile(String filePath) throws IOException {
|
||||||
|
File file = new File(filePath);
|
||||||
|
byte[] content = Files.readAllBytes(file.toPath());
|
||||||
|
|
||||||
|
return new ByteArrayMultipartFile(
|
||||||
|
file.getName(),
|
||||||
|
file.getName(),
|
||||||
|
MediaType.IMAGE_JPEG_VALUE,
|
||||||
|
content
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除临时文件
|
||||||
|
*/
|
||||||
|
private void deleteTempFile(String filePath) {
|
||||||
|
if (StrUtil.isNotEmpty(filePath)) {
|
||||||
|
File file = new File(filePath);
|
||||||
|
if (FileUtil.exist(file) && !FileUtil.del(file)) {
|
||||||
|
log.warn("临时文件删除失败, 路径:{}", filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,125 @@
|
|||||||
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import cmvr.api.DexHandServiceGrpc;
|
||||||
|
import cmvr.api.DexhandCommand;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.cmvr.common.exception.GlobalException;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.service.EdgeDexHandService;
|
||||||
|
import com.cmvr.edge.client.service.EdgeStreamService;
|
||||||
|
import com.cmvr.edge.client.utils.EdgeCommonUtil;
|
||||||
|
import com.cmvr.framework.websocket.service.MessagePushService;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeDexHandServiceImpl implements EdgeDexHandService, EdgeStreamService {
|
||||||
|
|
||||||
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
|
||||||
|
private final MessagePushService messagePushService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DexhandCommand.DexHandState getStatus(String terminalId, String deviceId) {
|
||||||
|
DexHandServiceGrpc.DexHandServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, DexHandServiceGrpc.DexHandServiceBlockingStub.class);
|
||||||
|
DexhandCommand.GetDexHandStateCommand.Request request = DexhandCommand.GetDexHandStateCommand.Request.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
return executeGrpcCall(() -> stub.getStatus(request)).getState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDexHandPos(String terminalId, String deviceId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDexHandAngle(String terminalId, String deviceId, int id, float value) {
|
||||||
|
DexHandServiceGrpc.DexHandServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, DexHandServiceGrpc.DexHandServiceBlockingStub.class);
|
||||||
|
DexhandCommand.FreedomValue.Builder builder = DexhandCommand.FreedomValue.newBuilder();
|
||||||
|
builder.setId(id);
|
||||||
|
builder.setValue(value);
|
||||||
|
DexhandCommand.SetDexHandAnglesCommand.Request request = DexhandCommand.SetDexHandAnglesCommand.Request.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
|
.addValues(builder.build())
|
||||||
|
.build();
|
||||||
|
executeGrpcCall(() -> stub.setDexHandAngle(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDexHandForce(String terminalId, String deviceId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDexHandSpeed(String terminalId, String deviceId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDexHandPresetAct(String terminalId, String deviceId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSensorData(String terminalId, String deviceId) {
|
||||||
|
DexHandServiceGrpc.DexHandServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, DexHandServiceGrpc.DexHandServiceBlockingStub.class);
|
||||||
|
DexhandCommand.GetSensorDataCommand.Request request = DexhandCommand.GetSensorDataCommand.Request.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
DexhandCommand.GetSensorDataCommand.Feedback feedback = executeGrpcCall(() -> stub.getSensorData(request));
|
||||||
|
return JSON.toJSONString(feedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Request> getSensorDataStream(String terminalId, String deviceId) {
|
||||||
|
DexHandServiceGrpc.DexHandServiceStub stub = grpcServiceManager.getGrpcClient(terminalId, DexHandServiceGrpc.DexHandServiceStub.class);
|
||||||
|
StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Feedback> responseObserver = new StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Feedback>() {
|
||||||
|
@Override
|
||||||
|
public void onNext(DexhandCommand.GetSensorDataStreamCommand.Feedback value) {
|
||||||
|
// 例如,将传感器数据转换为JSON字符串
|
||||||
|
String playLoad = JSON.toJSONString(value.getSensorList());
|
||||||
|
messagePushService.pushToChannel("edgeDexHandServiceImpl/getSensorDataStream/" + terminalId + "/" + deviceId, playLoad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable t) {
|
||||||
|
// 处理错误
|
||||||
|
System.err.println("Error: " + t.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCompleted() {
|
||||||
|
// 流结束
|
||||||
|
System.out.println("Stream completed.");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 创建StreamObserver来发送请求
|
||||||
|
StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Request> requestObserver = stub.getSensorDataStream(responseObserver);
|
||||||
|
// 构建请求并发送
|
||||||
|
DexhandCommand.GetSensorDataStreamCommand.Request request = DexhandCommand.GetSensorDataStreamCommand.Request.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
requestObserver.onNext(request);
|
||||||
|
return requestObserver;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@FunctionalInterface
|
||||||
|
private interface GrpcCall<T> {
|
||||||
|
T call() throws Exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> T executeGrpcCall(EdgeDexHandServiceImpl.GrpcCall<T> call) {
|
||||||
|
try {
|
||||||
|
return call.call();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new GlobalException("gRPC 调用失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,240 @@
|
|||||||
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import cmvr.api.Common;
|
||||||
|
import cmvr.api.MicrophoneCommand;
|
||||||
|
import cmvr.api.MicPhoneServiceGrpc;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.service.EdgeMicrophoneService;
|
||||||
|
import io.grpc.ManagedChannel;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.google.protobuf.Timestamp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘麦克风服务实现类
|
||||||
|
* 用于与边缘麦克风进行gRPC通信,控制麦克风录音和状态
|
||||||
|
* 实现了EdgeMicrophoneService接口,提供了麦克风控制的所有基本功能
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeMicrophoneServiceImpl implements EdgeMicrophoneService {
|
||||||
|
/**
|
||||||
|
* 日志记录器
|
||||||
|
* 用于记录服务运行过程中的各种状态和错误信息
|
||||||
|
*/
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(EdgeMicrophoneServiceImpl.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gRPC服务管理器
|
||||||
|
* 用于管理和获取gRPC客户端连接
|
||||||
|
*/
|
||||||
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建请求头
|
||||||
|
*/
|
||||||
|
private static Common.CommandHeader.Request buildRequest(String deviceId) {
|
||||||
|
return Common.CommandHeader.Request.newBuilder()
|
||||||
|
.setDeviceId(deviceId)
|
||||||
|
.setTimestamp(
|
||||||
|
Timestamp.newBuilder()
|
||||||
|
.setSeconds(System.currentTimeMillis() / 1000)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取麦克风当前状态
|
||||||
|
* 通过gRPC调用获取麦克风的运行状态,包括是否正在录音、音量等信息
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @return MicState 返回麦克风的当前状态
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public MicrophoneCommand.GetMicStateCommand.Feedback getStatus(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
MicrophoneCommand.GetMicStateCommand.Request request = MicrophoneCommand.GetMicStateCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
// 直接返回完整的 Feedback
|
||||||
|
return stub.getStatus(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("获取麦克风状态失败", e);
|
||||||
|
throw new RuntimeException("获取麦克风状态失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始录音
|
||||||
|
* 通过gRPC调用开始录音,将录音保存到指定路径
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @param filePath 录音文件的保存路径
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void startRecord(String terminalId, String deviceId, String filePath) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
MicrophoneCommand.StartMicRecordingCommand.Request request = MicrophoneCommand.StartMicRecordingCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.setFilePath(filePath)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
stub.startRecord(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("开始录音失败", e);
|
||||||
|
throw new RuntimeException("开始录音失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止录音
|
||||||
|
* 通过gRPC调用停止麦克风的当前录音
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void stopRecord(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
MicrophoneCommand.StopMicRecordingCommand.Request request = MicrophoneCommand.StopMicRecordingCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
stub.stopRecord(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("停止录音失败", e);
|
||||||
|
throw new RuntimeException("停止录音失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停录音
|
||||||
|
* 通过gRPC调用暂停麦克风的当前录音
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void pauseRecord(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
MicrophoneCommand.PauseMicRecordingCommand.Request request = MicrophoneCommand.PauseMicRecordingCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
stub.pauseRecord(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("暂停录音失败", e);
|
||||||
|
throw new RuntimeException("暂停录音失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复录音
|
||||||
|
* 通过gRPC调用恢复麦克风之前暂停的录音
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void resumeRecord(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
MicrophoneCommand.ResumeMicRecordingCommand.Request request = MicrophoneCommand.ResumeMicRecordingCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
stub.resumeRecord(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("恢复录音失败", e);
|
||||||
|
throw new RuntimeException("恢复录音失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置麦克风音量
|
||||||
|
* 通过gRPC调用设置麦克风的音量大小
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @param volume 音量大小(0-100)
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setVolume(String terminalId, String deviceId, int volume) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
MicrophoneCommand.SetMicPhoneVolumeCommand.Request request = MicrophoneCommand.SetMicPhoneVolumeCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.setVolume(volume)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
stub.setVolume(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("设置麦克风音量失败", e);
|
||||||
|
throw new RuntimeException("设置麦克风音量失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前音量
|
||||||
|
* 通过gRPC调用获取麦克风的当前音量大小
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @return int 返回当前音量大小(0-100)
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int getVolume(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
MicrophoneCommand.GetMicPhoneVolumeCommand.Request request = MicrophoneCommand.GetMicPhoneVolumeCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求并获取响应
|
||||||
|
MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback response = stub.getVolume(request);
|
||||||
|
return response.getVolume();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("获取麦克风音量失败", e);
|
||||||
|
throw new RuntimeException("获取麦克风音量失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,261 @@
|
|||||||
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import cmvr.api.Common;
|
||||||
|
import cmvr.api.SpeakerCommand;
|
||||||
|
import cmvr.api.SpeakerServiceGrpc;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.service.EdgeSpeakerService;
|
||||||
|
import com.google.protobuf.Timestamp;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘扬声器服务实现类
|
||||||
|
* 用于与边缘扬声器进行gRPC通信,控制扬声器播放和状态
|
||||||
|
* 实现了EdgeSpeakerService接口,提供了扬声器控制的所有基本功能
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeSpeakerServiceImpl implements EdgeSpeakerService {
|
||||||
|
/**
|
||||||
|
* 日志记录器
|
||||||
|
* 用于记录服务运行过程中的各种状态和错误信息
|
||||||
|
*/
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(EdgeSpeakerServiceImpl.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gRPC服务管理器
|
||||||
|
* 用于管理和获取gRPC客户端连接
|
||||||
|
*/
|
||||||
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建请求头
|
||||||
|
*/
|
||||||
|
private static Common.CommandHeader.Request buildRequest(String deviceId) {
|
||||||
|
return Common.CommandHeader.Request.newBuilder()
|
||||||
|
.setDeviceId(deviceId)
|
||||||
|
.setTimestamp(
|
||||||
|
Timestamp.newBuilder()
|
||||||
|
.setSeconds(System.currentTimeMillis() / 1000)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取扬声器当前状态
|
||||||
|
* 通过gRPC调用获取扬声器的运行状态,包括是否正在播放、音量等信息
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @return SpeakerState 返回扬声器的当前状态
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SpeakerCommand.GetSpeakerStateCommand.Feedback getStatus(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
SpeakerCommand.GetSpeakerStateCommand.Request request = SpeakerCommand.GetSpeakerStateCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
// 直接返回完整的 Feedback
|
||||||
|
return stub.getStatus(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("获取扬声器状态失败", e);
|
||||||
|
throw new RuntimeException("获取扬声器状态失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 播放音频文件
|
||||||
|
* 通过gRPC调用播放指定路径的音频文件
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @param audioPath 音频文件的路径
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void playAudio(String terminalId, String deviceId, String audioPath) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
SpeakerCommand.PlayAudioCommand.Request request = SpeakerCommand.PlayAudioCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.setAudioPath(audioPath)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
SpeakerCommand.PlayAudioCommand.Feedback feedback = stub.playAudio(request);
|
||||||
|
if (!feedback.getHeader().getSuccess()) {
|
||||||
|
throw new RuntimeException((feedback.getHeader().getErrorMessage()));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("播放音频失败", e);
|
||||||
|
throw new RuntimeException("播放音频失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止当前播放
|
||||||
|
* 通过gRPC调用停止扬声器的当前播放
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void stopPlayback(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
SpeakerCommand.StopSpeakerCommand.Request request = SpeakerCommand.StopSpeakerCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
stub.stopPlayback(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("停止播放失败", e);
|
||||||
|
throw new RuntimeException("停止播放失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停当前播放
|
||||||
|
* 通过gRPC调用暂停扬声器的当前播放
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void pausePlayback(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
SpeakerCommand.PauseSpeakerCommand.Request request = SpeakerCommand.PauseSpeakerCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
stub.pausePlayback(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("暂停播放失败", e);
|
||||||
|
throw new RuntimeException("暂停播放失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复暂停的播放
|
||||||
|
* 通过gRPC调用恢复扬声器之前暂停的播放
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void resumePlayback(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
SpeakerCommand.ResumeSpeakerCommand.Request request = SpeakerCommand.ResumeSpeakerCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
stub.resumePlayback(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("恢复播放失败", e);
|
||||||
|
throw new RuntimeException("恢复播放失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置扬声器音量
|
||||||
|
* 通过gRPC调用设置扬声器的音量大小
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @param volume 音量大小(0-100)
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setVolume(String terminalId, String deviceId, int volume) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
SpeakerCommand.SetSpeakerVolumeCommand.Request request = SpeakerCommand.SetSpeakerVolumeCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.setVolume(volume)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求
|
||||||
|
stub.setVolume(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("设置音量失败", e);
|
||||||
|
throw new RuntimeException("设置音量失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前音量
|
||||||
|
* 通过gRPC调用获取扬声器的当前音量大小
|
||||||
|
*
|
||||||
|
* @param terminalId 终端设备ID
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @return int 返回当前音量大小(0-100)
|
||||||
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int getVolume(String terminalId, String deviceId) {
|
||||||
|
try {
|
||||||
|
// 获取gRPC客户端存根
|
||||||
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求消息
|
||||||
|
SpeakerCommand.GetSpeakerVolumeCommand.Request request = SpeakerCommand.GetSpeakerVolumeCommand.Request.newBuilder()
|
||||||
|
.setHeader(buildRequest(deviceId))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 发送请求并获取响应
|
||||||
|
SpeakerCommand.GetSpeakerVolumeCommand.Feedback response = stub.getVolume(request);
|
||||||
|
return response.getVolume();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("获取音量失败", e);
|
||||||
|
throw new RuntimeException("获取音量失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getAll() {
|
||||||
|
// 获取文件名
|
||||||
|
String url = "http://10.148.108.162:8981/files/";
|
||||||
|
HttpResponse response = HttpRequest.get(url)
|
||||||
|
.timeout(5000)
|
||||||
|
.execute().charset("UTF-8");
|
||||||
|
String body = response.body();
|
||||||
|
JSONObject object = JSON.parseObject(body);
|
||||||
|
|
||||||
|
return object.getList("files", String.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import cmvr.api.SystemCommand;
|
||||||
|
import cmvr.api.SystemServiceGrpc;
|
||||||
|
import com.cmvr.device.domain.DeDeviceRegistration;
|
||||||
|
import com.cmvr.device.domain.vo.Device;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.service.EdgeSystemService;
|
||||||
|
import io.grpc.ManagedChannel;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘系统服务实现类
|
||||||
|
* 用于与边缘系统进行gRPC通信,获取系统状态信息
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeSystemServiceImpl implements EdgeSystemService {
|
||||||
|
/**
|
||||||
|
* 日志记录器
|
||||||
|
*/
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(EdgeSystemServiceImpl.class);
|
||||||
|
|
||||||
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
|
||||||
|
|
||||||
|
public List<DeDeviceRegistration> deviceList(String terminalId){
|
||||||
|
|
||||||
|
try {
|
||||||
|
//调用接口获取返回值对象
|
||||||
|
SystemCommand.GetSystemStatusCommand.Feedback response=getSystemStatus(terminalId);
|
||||||
|
|
||||||
|
// 获取设备列表
|
||||||
|
List<SystemCommand.DeviceList> deviceList = response.getDeviceListList();
|
||||||
|
|
||||||
|
// 如果设备列表不为空,则处理设备信息
|
||||||
|
if (!deviceList.isEmpty()) {
|
||||||
|
// 创建Device对象列表,用于存储转换后的设备信息
|
||||||
|
List<DeDeviceRegistration> devices = new ArrayList<>();
|
||||||
|
|
||||||
|
// 遍历设备列表,将每个设备信息转换为Device对象
|
||||||
|
for (SystemCommand.DeviceList device : deviceList) {
|
||||||
|
DeDeviceRegistration d=new DeDeviceRegistration();
|
||||||
|
// 设置设备ID
|
||||||
|
d.setDeviceCode(device.getDeviceId());
|
||||||
|
// 设置设备类型,将枚举类型转换为字符串
|
||||||
|
d.setDeviceModel(device.getDeviceType().name());
|
||||||
|
// 设置设备的终端ID
|
||||||
|
d.setIdDeDeviceTerminalConfig(terminalId);
|
||||||
|
|
||||||
|
devices.add(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录获取到的设备数量
|
||||||
|
logger.info("获取到设备列表,数量:{}", devices.size());
|
||||||
|
return devices;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果响应为空或设备列表为空,记录错误信息
|
||||||
|
logger.error("获取系统状态失败: {}", response != null ?
|
||||||
|
(response.getHeader() != null ? response.getHeader().getErrorMessage() : "响应头为空") : "响应为空");
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
// 捕获并记录调用过程中的异常
|
||||||
|
logger.error("调用系统状态接口异常", e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统状态信息
|
||||||
|
* 包括CPU使用率、内存使用情况、磁盘使用情况和设备列表等信息
|
||||||
|
*
|
||||||
|
* @return 系统状态信息,如果获取失败则返回null
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SystemCommand.GetSystemStatusCommand.Feedback getSystemStatus(String terminalId) {
|
||||||
|
try {
|
||||||
|
// 创建gRPC阻塞式存根,用于调用服务端方法
|
||||||
|
SystemServiceGrpc.SystemServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
|
terminalId,
|
||||||
|
SystemServiceGrpc.SystemServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 构建请求对象,由于是获取系统状态,请求参数为空
|
||||||
|
SystemCommand.GetSystemStatusCommand.Request request = SystemCommand.GetSystemStatusCommand.Request.newBuilder().build();
|
||||||
|
|
||||||
|
// 调用服务端方法获取系统状态
|
||||||
|
SystemCommand.GetSystemStatusCommand.Feedback response = stub.getSystemStatus(request);
|
||||||
|
|
||||||
|
// 检查响应是否有效
|
||||||
|
if (response != null) {
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果响应为空或设备列表为空,记录错误信息
|
||||||
|
logger.error("获取系统状态失败: {}", response != null ?
|
||||||
|
(response.getHeader() != null ? response.getHeader().getErrorMessage() : "响应头为空") : "响应为空");
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 捕获并记录调用过程中的异常
|
||||||
|
logger.error("调用系统状态接口异常", e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import com.cmvr.edge.client.manage.GrpcStreamManager;
|
||||||
|
import com.cmvr.edge.client.service.EdgeStreamService;
|
||||||
|
import com.cmvr.framework.websocket.service.GrpcClientService;
|
||||||
|
import io.grpc.Status;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* grpc客户端服务实现类
|
||||||
|
* 统一调度grpc流式接口
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class GrpcClientServiceImpl implements GrpcClientService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(GrpcClientServiceImpl.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有流式服务
|
||||||
|
*/
|
||||||
|
private final Map<String, EdgeStreamService> serviceMap;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public GrpcClientServiceImpl(Map<String, EdgeStreamService> serviceMap) {
|
||||||
|
this.serviceMap = serviceMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void send(boolean isStart, String terminalId, String deviceId, String service, String method) {
|
||||||
|
try {
|
||||||
|
// 从 Map 中获取服务实例
|
||||||
|
EdgeStreamService serviceInstance = serviceMap.get(service);
|
||||||
|
if (serviceInstance == null) {
|
||||||
|
throw new IllegalArgumentException("未知的service: " + service);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构造流键
|
||||||
|
String key = terminalId + deviceId + service + method;
|
||||||
|
|
||||||
|
if (isStart) {
|
||||||
|
// 通过反射调用指定方法
|
||||||
|
Method streamMethod = serviceInstance.getClass().getMethod(method, String.class, String.class);
|
||||||
|
StreamObserver<?> streamObserver = (StreamObserver<?>) streamMethod.invoke(serviceInstance, terminalId, deviceId);
|
||||||
|
if (streamObserver != null) {
|
||||||
|
GrpcStreamManager.addStream(key, streamObserver);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!GrpcStreamManager.containsKey(key)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 移除并关闭流
|
||||||
|
StreamObserver<?> streamObserver = GrpcStreamManager.removeStream(key);
|
||||||
|
try {
|
||||||
|
streamObserver.onError(Status.CANCELLED.withDescription("流需要关闭").asException());
|
||||||
|
log.info("流关闭: {}", key);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("流结束");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("调用服务失败{}", e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.cmvr.edge.client.utils;
|
||||||
|
|
||||||
|
import cmvr.api.Common;
|
||||||
|
import com.google.protobuf.Timestamp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 边缘系统通用工具类
|
||||||
|
*/
|
||||||
|
public class EdgeCommonUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建边缘系统请求头
|
||||||
|
*
|
||||||
|
* @param deviceId 设备ID
|
||||||
|
* @return 边缘系统服务请求头对象
|
||||||
|
*/
|
||||||
|
public static Common.CommandHeader.Request buildRequest(String deviceId) {
|
||||||
|
return Common.CommandHeader.Request.newBuilder()
|
||||||
|
.setDeviceId(deviceId)
|
||||||
|
.setTimestamp(
|
||||||
|
Timestamp.newBuilder()
|
||||||
|
.setSeconds(System.currentTimeMillis() / 1000)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,264 @@
|
|||||||
|
package com.cmvr.edge.client.utils;
|
||||||
|
|
||||||
|
import org.bytedeco.ffmpeg.global.avcodec;
|
||||||
|
import org.bytedeco.javacv.*;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
|
public class H265DecoderUtil {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(H265DecoderUtil.class);
|
||||||
|
private static final int PIPE_BUFFER_SIZE = 1024 * 1024; // 1MB 缓冲区
|
||||||
|
private static final int GRABBER_TIMEOUT = 500_000; // 500ms 超时
|
||||||
|
|
||||||
|
private static volatile FFmpegFrameGrabber grabber;
|
||||||
|
private static volatile PipedInputStream pipedInputStream;
|
||||||
|
private static volatile PipedOutputStream pipedOutputStream;
|
||||||
|
private static volatile Thread grabberThread;
|
||||||
|
private static final AtomicBoolean isDecoderReady = new AtomicBoolean(false);
|
||||||
|
private static final Object initLock = new Object();
|
||||||
|
|
||||||
|
static {
|
||||||
|
initializeDecoder();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initializeDecoder() {
|
||||||
|
synchronized (initLock) {
|
||||||
|
if (isDecoderReady.get()) {
|
||||||
|
logger.info("Decoder already initialized");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
logger.info("Initializing decoder...");
|
||||||
|
|
||||||
|
// 1. 初始化管道流(增大缓冲区防止阻塞)
|
||||||
|
pipedInputStream = new PipedInputStream(PIPE_BUFFER_SIZE);
|
||||||
|
pipedOutputStream = new PipedOutputStream(pipedInputStream);
|
||||||
|
|
||||||
|
// 2. 配置 FFmpeg 抓取器
|
||||||
|
grabber = new FFmpegFrameGrabber(pipedInputStream);
|
||||||
|
grabber.setFormat("hevc");
|
||||||
|
grabber.setVideoOption("threads", "4"); // 多线程解码
|
||||||
|
grabber.setOption("probesize", "32"); // 减少探测数据量
|
||||||
|
grabber.setOption("analyzeduration", "200000"); // 200ms 分析时长
|
||||||
|
grabber.setOption("timeout", String.valueOf(GRABBER_TIMEOUT));
|
||||||
|
|
||||||
|
// 3. 启动独立线程运行 FFmpeg
|
||||||
|
grabberThread = new Thread(() -> {
|
||||||
|
try {
|
||||||
|
logger.info("Starting FFmpeg grabber...");
|
||||||
|
grabber.startUnsafe();
|
||||||
|
isDecoderReady.set(true);
|
||||||
|
logger.info("FFmpeg grabber started successfully");
|
||||||
|
} catch (FrameGrabber.Exception e) {
|
||||||
|
logger.error("FFmpeg start failed", e);
|
||||||
|
isDecoderReady.set(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
grabberThread.setDaemon(true); // 设为守护线程
|
||||||
|
grabberThread.start();
|
||||||
|
|
||||||
|
// 4. 等待初始化完成
|
||||||
|
int retry = 0;
|
||||||
|
while (!isDecoderReady.get() && retry++ < 5) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(200);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (!isDecoderReady.get()) {
|
||||||
|
// throw new IllegalStateException("Failed to initialize FFmpeg grabber");
|
||||||
|
// }
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error("Decoder initialization failed", e);
|
||||||
|
cleanup();
|
||||||
|
throw new RuntimeException("H265 decoder init failed", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String decodeToBase64Image(byte[] h265Data) {
|
||||||
|
if (h265Data == null || h265Data.length == 0) {
|
||||||
|
logger.warn("Empty H265 data received");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isDecoderReady.get()) {
|
||||||
|
logger.error("Decoder not ready, reinitializing...");
|
||||||
|
synchronized (initLock) {
|
||||||
|
cleanup();
|
||||||
|
initializeDecoder();
|
||||||
|
}
|
||||||
|
if (!isDecoderReady.get()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 1. 写入数据(非阻塞)
|
||||||
|
pipedOutputStream.write(h265Data);
|
||||||
|
pipedOutputStream.flush();
|
||||||
|
|
||||||
|
// 2. 抓取帧(带超时)
|
||||||
|
Frame frame = null;
|
||||||
|
int retry = 0;
|
||||||
|
while (frame == null && retry++ < 3) {
|
||||||
|
try {
|
||||||
|
frame = grabber.grab();
|
||||||
|
if (frame == null) {
|
||||||
|
logger.debug("Frame grab timeout, retrying...");
|
||||||
|
Thread.sleep(50);
|
||||||
|
}
|
||||||
|
} catch (FrameGrabber.Exception e) {
|
||||||
|
logger.warn("Frame grab error", e);
|
||||||
|
if (e.getMessage().contains("Input/output error")) {
|
||||||
|
resetDecoder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (frame == null || frame.image == null) {
|
||||||
|
logger.warn("Failed to grab valid frame after retries");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 转换为 Base64
|
||||||
|
Java2DFrameConverter converter = new Java2DFrameConverter();
|
||||||
|
BufferedImage image = converter.convert(frame);
|
||||||
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
|
ImageIO.write(image, "jpg", baos);
|
||||||
|
return Base64.getEncoder().encodeToString(baos.toByteArray());
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Decoding failed", e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void resetDecoder() {
|
||||||
|
synchronized (initLock) {
|
||||||
|
cleanup();
|
||||||
|
initializeDecoder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void cleanup() {
|
||||||
|
try {
|
||||||
|
if (grabber != null) {
|
||||||
|
grabber.stop();
|
||||||
|
grabber.close();
|
||||||
|
}
|
||||||
|
if (pipedOutputStream != null) {
|
||||||
|
pipedOutputStream.close();
|
||||||
|
}
|
||||||
|
if (pipedInputStream != null) {
|
||||||
|
pipedInputStream.close();
|
||||||
|
}
|
||||||
|
if (grabberThread != null && grabberThread.isAlive()) {
|
||||||
|
grabberThread.interrupt();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.warn("Cleanup error", e);
|
||||||
|
} finally {
|
||||||
|
grabber = null;
|
||||||
|
pipedInputStream = null;
|
||||||
|
pipedOutputStream = null;
|
||||||
|
grabberThread = null;
|
||||||
|
isDecoderReady.set(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isIFrame(byte[] data) {
|
||||||
|
// H.265 NAL 单元类型检测(简化版)
|
||||||
|
if (data.length < 4 || data[0] != 0 || data[1] != 0 || data[2] != 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
int nalType = (data[3] & 0x7E) >> 1;
|
||||||
|
return nalType >= 0x20 && nalType <= 0x23; // VPS/SPS/PPS/IDR
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将H.265帧流转换为MP4视频并编码为Base64
|
||||||
|
*/
|
||||||
|
public static String convertH265FramesToVideo(List<byte[]> frames) {
|
||||||
|
try {
|
||||||
|
// 1. 合并帧数据
|
||||||
|
ByteArrayOutputStream combinedStream = new ByteArrayOutputStream();
|
||||||
|
for (byte[] frame : frames) {
|
||||||
|
combinedStream.write(frame);
|
||||||
|
}
|
||||||
|
byte[] h265Data = combinedStream.toByteArray();
|
||||||
|
|
||||||
|
// 2. 开启FFmpeg日志(关键调试步骤)
|
||||||
|
// FFmpegLogCallback.set();
|
||||||
|
|
||||||
|
// 3. 创建管道流(线程安全传输)
|
||||||
|
PipedInputStream pipedInputStream = new PipedInputStream(2 * 1024 * 1024);
|
||||||
|
PipedOutputStream pipedOutputStream = new PipedOutputStream(pipedInputStream);
|
||||||
|
|
||||||
|
// 4. 启动写线程(将H.265数据写入管道)
|
||||||
|
Thread writerThread = new Thread(() -> {
|
||||||
|
try {
|
||||||
|
pipedOutputStream.write(h265Data);
|
||||||
|
pipedOutputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
writerThread.start();
|
||||||
|
|
||||||
|
// 5. 初始化抓取器(解析H.265流)
|
||||||
|
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(pipedInputStream);
|
||||||
|
grabber.setFormat("hevc"); // 强制指定H.265格式
|
||||||
|
grabber.setOption("loglevel","quiet");
|
||||||
|
grabber.start();
|
||||||
|
|
||||||
|
// 6. 初始化录制器(输出到临时文件)
|
||||||
|
File tempFile = File.createTempFile("temp_video", ".mp4");
|
||||||
|
FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(tempFile, grabber.getImageWidth(), grabber.getImageHeight());
|
||||||
|
recorder.setFormat("mp4"); // 输出MP4格式
|
||||||
|
|
||||||
|
// 关键参数配置(避免默认值失效)
|
||||||
|
recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264); // 使用H.264编码(兼容性更好)
|
||||||
|
recorder.setFrameRate(grabber.getFrameRate()); // 匹配输入帧率
|
||||||
|
recorder.setVideoBitrate(8000000); // 设置合理比特率(如8Mbps)
|
||||||
|
recorder.setGopSize(30); // GOP大小(关键帧间隔)
|
||||||
|
recorder.setOption("loglevel","quiet");
|
||||||
|
recorder.start(); // 启动录制器
|
||||||
|
|
||||||
|
// 7. 逐帧录制
|
||||||
|
Frame frame;
|
||||||
|
while ((frame = grabber.grab()) != null) {
|
||||||
|
recorder.record(frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 8. 停止资源
|
||||||
|
recorder.stop();
|
||||||
|
grabber.stop();
|
||||||
|
|
||||||
|
// 9. 读取临时文件为Base64
|
||||||
|
byte[] mp4Data = Files.readAllBytes(tempFile.toPath());
|
||||||
|
String base64String = Base64.getEncoder().encodeToString(mp4Data);
|
||||||
|
|
||||||
|
// 10. 清理临时文件
|
||||||
|
tempFile.delete();
|
||||||
|
|
||||||
|
return base64String;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
88
cmvr-iot-api/cmvr-iot-edge/cmvr-iot-grpc-lib/pom.xml
Normal file
88
cmvr-iot-api/cmvr-iot-edge/cmvr-iot-grpc-lib/pom.xml
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-edge</artifactId>
|
||||||
|
<version>3.8.9</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cmvr-iot-grpc-lib</artifactId>
|
||||||
|
<description> cmvr-iot gRPC 公共 proto 生成库</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.grpc</groupId>
|
||||||
|
<artifactId>grpc-netty-shaded</artifactId>
|
||||||
|
<version>${grpc.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.grpc</groupId>
|
||||||
|
<artifactId>grpc-protobuf</artifactId>
|
||||||
|
<version>${grpc.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.grpc</groupId>
|
||||||
|
<artifactId>grpc-stub</artifactId>
|
||||||
|
<version>${grpc.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.protobuf</groupId>
|
||||||
|
<artifactId>protobuf-java</artifactId>
|
||||||
|
<version>3.25.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Java 9+ 兼容性依赖 -->
|
||||||
|
<dependency> <!-- necessary for Java 9+ -->
|
||||||
|
<groupId>org.apache.tomcat</groupId>
|
||||||
|
<artifactId>annotations-api</artifactId>
|
||||||
|
<version>6.0.53</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<extensions>
|
||||||
|
<extension>
|
||||||
|
<groupId>kr.motd.maven</groupId>
|
||||||
|
<artifactId>os-maven-plugin</artifactId>
|
||||||
|
<version>1.7.1</version>
|
||||||
|
</extension>
|
||||||
|
</extensions>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.xolstice.maven.plugins</groupId>
|
||||||
|
<artifactId>protobuf-maven-plugin</artifactId>
|
||||||
|
<version>0.6.1</version>
|
||||||
|
<configuration>
|
||||||
|
<protocArtifact>com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier}</protocArtifact>
|
||||||
|
<pluginId>grpc-java</pluginId>
|
||||||
|
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.52.0:exe:${os.detected.classifier}</pluginArtifact>
|
||||||
|
<!-- 输出目录 -->
|
||||||
|
<outputDirectory>${basedir}/src/main/java</outputDirectory>
|
||||||
|
<!-- 每次执行命令时不清空之前生成的代码(追加的方式) -->
|
||||||
|
<clearOutputDirectory>false</clearOutputDirectory>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
<goal>compile-custom</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>8</source>
|
||||||
|
<target>8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,533 @@
|
|||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 生物头部机器人服务接口
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@javax.annotation.Generated(
|
||||||
|
value = "by gRPC proto compiler (version 1.52.0)",
|
||||||
|
comments = "Source: cmvr/api/biohead_service.proto")
|
||||||
|
@io.grpc.stub.annotations.GrpcGenerated
|
||||||
|
public final class BioHeadServiceGrpc {
|
||||||
|
|
||||||
|
private BioHeadServiceGrpc() {}
|
||||||
|
|
||||||
|
public static final String SERVICE_NAME = "cmvr.api.BioHeadService";
|
||||||
|
|
||||||
|
// Static method descriptors that strictly reflect the proto.
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.SetFacialExpression.Request,
|
||||||
|
cmvr.api.BioheadCommand.SetFacialExpression.Feedback> getSetExpressionMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SetExpression",
|
||||||
|
requestType = cmvr.api.BioheadCommand.SetFacialExpression.Request.class,
|
||||||
|
responseType = cmvr.api.BioheadCommand.SetFacialExpression.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.SetFacialExpression.Request,
|
||||||
|
cmvr.api.BioheadCommand.SetFacialExpression.Feedback> getSetExpressionMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.SetFacialExpression.Request, cmvr.api.BioheadCommand.SetFacialExpression.Feedback> getSetExpressionMethod;
|
||||||
|
if ((getSetExpressionMethod = BioHeadServiceGrpc.getSetExpressionMethod) == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
if ((getSetExpressionMethod = BioHeadServiceGrpc.getSetExpressionMethod) == null) {
|
||||||
|
BioHeadServiceGrpc.getSetExpressionMethod = getSetExpressionMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.BioheadCommand.SetFacialExpression.Request, cmvr.api.BioheadCommand.SetFacialExpression.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetExpression"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.SetFacialExpression.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.SetFacialExpression.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceMethodDescriptorSupplier("SetExpression"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetExpressionMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.StreamFacialExpression.Request,
|
||||||
|
cmvr.api.BioheadCommand.StreamFacialExpression.Feedback> getStreamExpressionMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "StreamExpression",
|
||||||
|
requestType = cmvr.api.BioheadCommand.StreamFacialExpression.Request.class,
|
||||||
|
responseType = cmvr.api.BioheadCommand.StreamFacialExpression.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.StreamFacialExpression.Request,
|
||||||
|
cmvr.api.BioheadCommand.StreamFacialExpression.Feedback> getStreamExpressionMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.StreamFacialExpression.Request, cmvr.api.BioheadCommand.StreamFacialExpression.Feedback> getStreamExpressionMethod;
|
||||||
|
if ((getStreamExpressionMethod = BioHeadServiceGrpc.getStreamExpressionMethod) == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
if ((getStreamExpressionMethod = BioHeadServiceGrpc.getStreamExpressionMethod) == null) {
|
||||||
|
BioHeadServiceGrpc.getStreamExpressionMethod = getStreamExpressionMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.BioheadCommand.StreamFacialExpression.Request, cmvr.api.BioheadCommand.StreamFacialExpression.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamExpression"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.StreamFacialExpression.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.StreamFacialExpression.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceMethodDescriptorSupplier("StreamExpression"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStreamExpressionMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.GetStatus.Request,
|
||||||
|
cmvr.api.BioheadCommand.GetStatus.Feedback> getGetSystemStatusMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetSystemStatus",
|
||||||
|
requestType = cmvr.api.BioheadCommand.GetStatus.Request.class,
|
||||||
|
responseType = cmvr.api.BioheadCommand.GetStatus.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.GetStatus.Request,
|
||||||
|
cmvr.api.BioheadCommand.GetStatus.Feedback> getGetSystemStatusMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.GetStatus.Request, cmvr.api.BioheadCommand.GetStatus.Feedback> getGetSystemStatusMethod;
|
||||||
|
if ((getGetSystemStatusMethod = BioHeadServiceGrpc.getGetSystemStatusMethod) == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
if ((getGetSystemStatusMethod = BioHeadServiceGrpc.getGetSystemStatusMethod) == null) {
|
||||||
|
BioHeadServiceGrpc.getGetSystemStatusMethod = getGetSystemStatusMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.BioheadCommand.GetStatus.Request, cmvr.api.BioheadCommand.GetStatus.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSystemStatus"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.GetStatus.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.GetStatus.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceMethodDescriptorSupplier("GetSystemStatus"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetSystemStatusMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.EmergencyStop.Request,
|
||||||
|
cmvr.api.BioheadCommand.EmergencyStop.Feedback> getEmergencyStopMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "EmergencyStop",
|
||||||
|
requestType = cmvr.api.BioheadCommand.EmergencyStop.Request.class,
|
||||||
|
responseType = cmvr.api.BioheadCommand.EmergencyStop.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.EmergencyStop.Request,
|
||||||
|
cmvr.api.BioheadCommand.EmergencyStop.Feedback> getEmergencyStopMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.EmergencyStop.Request, cmvr.api.BioheadCommand.EmergencyStop.Feedback> getEmergencyStopMethod;
|
||||||
|
if ((getEmergencyStopMethod = BioHeadServiceGrpc.getEmergencyStopMethod) == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
if ((getEmergencyStopMethod = BioHeadServiceGrpc.getEmergencyStopMethod) == null) {
|
||||||
|
BioHeadServiceGrpc.getEmergencyStopMethod = getEmergencyStopMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.BioheadCommand.EmergencyStop.Request, cmvr.api.BioheadCommand.EmergencyStop.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "EmergencyStop"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.EmergencyStop.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.EmergencyStop.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceMethodDescriptorSupplier("EmergencyStop"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getEmergencyStopMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new async stub that supports all call types for the service
|
||||||
|
*/
|
||||||
|
public static BioHeadServiceStub newStub(io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<BioHeadServiceStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<BioHeadServiceStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public BioHeadServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new BioHeadServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return BioHeadServiceStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||||
|
*/
|
||||||
|
public static BioHeadServiceBlockingStub newBlockingStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<BioHeadServiceBlockingStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<BioHeadServiceBlockingStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public BioHeadServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new BioHeadServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return BioHeadServiceBlockingStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||||
|
*/
|
||||||
|
public static BioHeadServiceFutureStub newFutureStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<BioHeadServiceFutureStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<BioHeadServiceFutureStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public BioHeadServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new BioHeadServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return BioHeadServiceFutureStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 生物头部机器人服务接口
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static abstract class BioHeadServiceImplBase implements io.grpc.BindableService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 设置面部表情
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void setExpression(cmvr.api.BioheadCommand.SetFacialExpression.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.SetFacialExpression.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetExpressionMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.StreamFacialExpression.Request> streamExpression(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.StreamFacialExpression.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamExpressionMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 获取状态
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void getSystemStatus(cmvr.api.BioheadCommand.GetStatus.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.GetStatus.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSystemStatusMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 紧急停止
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void emergencyStop(cmvr.api.BioheadCommand.EmergencyStop.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.EmergencyStop.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEmergencyStopMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||||
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||||
|
.addMethod(
|
||||||
|
getSetExpressionMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.BioheadCommand.SetFacialExpression.Request,
|
||||||
|
cmvr.api.BioheadCommand.SetFacialExpression.Feedback>(
|
||||||
|
this, METHODID_SET_EXPRESSION)))
|
||||||
|
.addMethod(
|
||||||
|
getStreamExpressionMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.BioheadCommand.StreamFacialExpression.Request,
|
||||||
|
cmvr.api.BioheadCommand.StreamFacialExpression.Feedback>(
|
||||||
|
this, METHODID_STREAM_EXPRESSION)))
|
||||||
|
.addMethod(
|
||||||
|
getGetSystemStatusMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.BioheadCommand.GetStatus.Request,
|
||||||
|
cmvr.api.BioheadCommand.GetStatus.Feedback>(
|
||||||
|
this, METHODID_GET_SYSTEM_STATUS)))
|
||||||
|
.addMethod(
|
||||||
|
getEmergencyStopMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.BioheadCommand.EmergencyStop.Request,
|
||||||
|
cmvr.api.BioheadCommand.EmergencyStop.Feedback>(
|
||||||
|
this, METHODID_EMERGENCY_STOP)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 生物头部机器人服务接口
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class BioHeadServiceStub extends io.grpc.stub.AbstractAsyncStub<BioHeadServiceStub> {
|
||||||
|
private BioHeadServiceStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected BioHeadServiceStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new BioHeadServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 设置面部表情
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void setExpression(cmvr.api.BioheadCommand.SetFacialExpression.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.SetFacialExpression.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetExpressionMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.StreamFacialExpression.Request> streamExpression(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.StreamFacialExpression.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
|
||||||
|
getChannel().newCall(getStreamExpressionMethod(), getCallOptions()), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 获取状态
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void getSystemStatus(cmvr.api.BioheadCommand.GetStatus.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.GetStatus.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetSystemStatusMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 紧急停止
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void emergencyStop(cmvr.api.BioheadCommand.EmergencyStop.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.EmergencyStop.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getEmergencyStopMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 生物头部机器人服务接口
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class BioHeadServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<BioHeadServiceBlockingStub> {
|
||||||
|
private BioHeadServiceBlockingStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected BioHeadServiceBlockingStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new BioHeadServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 设置面部表情
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.BioheadCommand.SetFacialExpression.Feedback setExpression(cmvr.api.BioheadCommand.SetFacialExpression.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetExpressionMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 获取状态
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.BioheadCommand.GetStatus.Feedback getSystemStatus(cmvr.api.BioheadCommand.GetStatus.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetSystemStatusMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 紧急停止
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.BioheadCommand.EmergencyStop.Feedback emergencyStop(cmvr.api.BioheadCommand.EmergencyStop.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getEmergencyStopMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 生物头部机器人服务接口
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class BioHeadServiceFutureStub extends io.grpc.stub.AbstractFutureStub<BioHeadServiceFutureStub> {
|
||||||
|
private BioHeadServiceFutureStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected BioHeadServiceFutureStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new BioHeadServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 设置面部表情
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.BioheadCommand.SetFacialExpression.Feedback> setExpression(
|
||||||
|
cmvr.api.BioheadCommand.SetFacialExpression.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetExpressionMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 获取状态
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.BioheadCommand.GetStatus.Feedback> getSystemStatus(
|
||||||
|
cmvr.api.BioheadCommand.GetStatus.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetSystemStatusMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 紧急停止
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.BioheadCommand.EmergencyStop.Feedback> emergencyStop(
|
||||||
|
cmvr.api.BioheadCommand.EmergencyStop.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getEmergencyStopMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int METHODID_SET_EXPRESSION = 0;
|
||||||
|
private static final int METHODID_GET_SYSTEM_STATUS = 1;
|
||||||
|
private static final int METHODID_EMERGENCY_STOP = 2;
|
||||||
|
private static final int METHODID_STREAM_EXPRESSION = 3;
|
||||||
|
|
||||||
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||||
|
private final BioHeadServiceImplBase serviceImpl;
|
||||||
|
private final int methodId;
|
||||||
|
|
||||||
|
MethodHandlers(BioHeadServiceImplBase serviceImpl, int methodId) {
|
||||||
|
this.serviceImpl = serviceImpl;
|
||||||
|
this.methodId = methodId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_SET_EXPRESSION:
|
||||||
|
serviceImpl.setExpression((cmvr.api.BioheadCommand.SetFacialExpression.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.SetFacialExpression.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_GET_SYSTEM_STATUS:
|
||||||
|
serviceImpl.getSystemStatus((cmvr.api.BioheadCommand.GetStatus.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.GetStatus.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_EMERGENCY_STOP:
|
||||||
|
serviceImpl.emergencyStop((cmvr.api.BioheadCommand.EmergencyStop.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.EmergencyStop.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_STREAM_EXPRESSION:
|
||||||
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamExpression(
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.StreamFacialExpression.Feedback>) responseObserver);
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static abstract class BioHeadServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||||
|
BioHeadServiceBaseDescriptorSupplier() {}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||||
|
return cmvr.api.BioheadService.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
return getFileDescriptor().findServiceByName("BioHeadService");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class BioHeadServiceFileDescriptorSupplier
|
||||||
|
extends BioHeadServiceBaseDescriptorSupplier {
|
||||||
|
BioHeadServiceFileDescriptorSupplier() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class BioHeadServiceMethodDescriptorSupplier
|
||||||
|
extends BioHeadServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||||
|
private final String methodName;
|
||||||
|
|
||||||
|
BioHeadServiceMethodDescriptorSupplier(String methodName) {
|
||||||
|
this.methodName = methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||||
|
return getServiceDescriptor().findMethodByName(methodName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||||
|
|
||||||
|
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceFileDescriptorSupplier())
|
||||||
|
.addMethod(getSetExpressionMethod())
|
||||||
|
.addMethod(getStreamExpressionMethod())
|
||||||
|
.addMethod(getGetSystemStatusMethod())
|
||||||
|
.addMethod(getEmergencyStopMethod())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,48 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: cmvr/api/biohead_service.proto
|
||||||
|
|
||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
public final class BioheadService {
|
||||||
|
private BioheadService() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\036cmvr/api/biohead_service.proto\022\010cmvr.a" +
|
||||||
|
"pi\032\036cmvr/api/biohead_command.proto2\207\003\n\016B" +
|
||||||
|
"ioHeadService\022`\n\rSetExpression\022%.cmvr.ap" +
|
||||||
|
"i.SetFacialExpression.Request\032&.cmvr.api" +
|
||||||
|
".SetFacialExpression.Feedback\"\000\022m\n\020Strea" +
|
||||||
|
"mExpression\022(.cmvr.api.StreamFacialExpre" +
|
||||||
|
"ssion.Request\032).cmvr.api.StreamFacialExp" +
|
||||||
|
"ression.Feedback\"\000(\0010\001\022N\n\017GetSystemStatu" +
|
||||||
|
"s\022\033.cmvr.api.GetStatus.Request\032\034.cmvr.ap" +
|
||||||
|
"i.GetStatus.Feedback\"\000\022T\n\rEmergencyStop\022" +
|
||||||
|
"\037.cmvr.api.EmergencyStop.Request\032 .cmvr." +
|
||||||
|
"api.EmergencyStop.Feedback\"\000b\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
cmvr.api.BioheadCommand.getDescriptor(),
|
||||||
|
});
|
||||||
|
cmvr.api.BioheadCommand.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,968 @@
|
|||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
@javax.annotation.Generated(
|
||||||
|
value = "by gRPC proto compiler (version 1.52.0)",
|
||||||
|
comments = "Source: cmvr/api/camera_service.proto")
|
||||||
|
@io.grpc.stub.annotations.GrpcGenerated
|
||||||
|
public final class CameraServiceGrpc {
|
||||||
|
|
||||||
|
private CameraServiceGrpc() {}
|
||||||
|
|
||||||
|
public static final String SERVICE_NAME = "cmvr.api.CameraService";
|
||||||
|
|
||||||
|
// Static method descriptors that strictly reflect the proto.
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetCameraStateCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetCameraStateCommand.Feedback> getGetStatusMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetStatus",
|
||||||
|
requestType = cmvr.api.CameraCommand.GetCameraStateCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.GetCameraStateCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetCameraStateCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetCameraStateCommand.Feedback> getGetStatusMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetCameraStateCommand.Request, cmvr.api.CameraCommand.GetCameraStateCommand.Feedback> getGetStatusMethod;
|
||||||
|
if ((getGetStatusMethod = CameraServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getGetStatusMethod = CameraServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
CameraServiceGrpc.getGetStatusMethod = getGetStatusMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.GetCameraStateCommand.Request, cmvr.api.CameraCommand.GetCameraStateCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStatus"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetCameraStateCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetCameraStateCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("GetStatus"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetStatusMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StartCameraCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StartCameraCommand.Feedback> getStartCameraMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "StartCamera",
|
||||||
|
requestType = cmvr.api.CameraCommand.StartCameraCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.StartCameraCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StartCameraCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StartCameraCommand.Feedback> getStartCameraMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StartCameraCommand.Request, cmvr.api.CameraCommand.StartCameraCommand.Feedback> getStartCameraMethod;
|
||||||
|
if ((getStartCameraMethod = CameraServiceGrpc.getStartCameraMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getStartCameraMethod = CameraServiceGrpc.getStartCameraMethod) == null) {
|
||||||
|
CameraServiceGrpc.getStartCameraMethod = getStartCameraMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.StartCameraCommand.Request, cmvr.api.CameraCommand.StartCameraCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartCamera"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.StartCameraCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.StartCameraCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("StartCamera"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStartCameraMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StopCameraCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StopCameraCommand.Feedback> getStopCameraMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "StopCamera",
|
||||||
|
requestType = cmvr.api.CameraCommand.StopCameraCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.StopCameraCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StopCameraCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StopCameraCommand.Feedback> getStopCameraMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StopCameraCommand.Request, cmvr.api.CameraCommand.StopCameraCommand.Feedback> getStopCameraMethod;
|
||||||
|
if ((getStopCameraMethod = CameraServiceGrpc.getStopCameraMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getStopCameraMethod = CameraServiceGrpc.getStopCameraMethod) == null) {
|
||||||
|
CameraServiceGrpc.getStopCameraMethod = getStopCameraMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.StopCameraCommand.Request, cmvr.api.CameraCommand.StopCameraCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopCamera"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.StopCameraCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.StopCameraCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("StopCamera"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStopCameraMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBImageCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageCommand.Feedback> getGetRGBImageMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetRGBImage",
|
||||||
|
requestType = cmvr.api.CameraCommand.GetRGBImageCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.GetRGBImageCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBImageCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageCommand.Feedback> getGetRGBImageMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBImageCommand.Request, cmvr.api.CameraCommand.GetRGBImageCommand.Feedback> getGetRGBImageMethod;
|
||||||
|
if ((getGetRGBImageMethod = CameraServiceGrpc.getGetRGBImageMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getGetRGBImageMethod = CameraServiceGrpc.getGetRGBImageMethod) == null) {
|
||||||
|
CameraServiceGrpc.getGetRGBImageMethod = getGetRGBImageMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.GetRGBImageCommand.Request, cmvr.api.CameraCommand.GetRGBImageCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRGBImage"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("GetRGBImage"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetRGBImageMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetDepthImageCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageCommand.Feedback> getGetDepthImageMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetDepthImage",
|
||||||
|
requestType = cmvr.api.CameraCommand.GetDepthImageCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.GetDepthImageCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetDepthImageCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageCommand.Feedback> getGetDepthImageMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetDepthImageCommand.Request, cmvr.api.CameraCommand.GetDepthImageCommand.Feedback> getGetDepthImageMethod;
|
||||||
|
if ((getGetDepthImageMethod = CameraServiceGrpc.getGetDepthImageMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getGetDepthImageMethod = CameraServiceGrpc.getGetDepthImageMethod) == null) {
|
||||||
|
CameraServiceGrpc.getGetDepthImageMethod = getGetDepthImageMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.GetDepthImageCommand.Request, cmvr.api.CameraCommand.GetDepthImageCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDepthImage"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("GetDepthImage"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetDepthImageMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBDImagesCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback> getGetRGBDImagesMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetRGBDImages",
|
||||||
|
requestType = cmvr.api.CameraCommand.GetRGBDImagesCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBDImagesCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback> getGetRGBDImagesMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBDImagesCommand.Request, cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback> getGetRGBDImagesMethod;
|
||||||
|
if ((getGetRGBDImagesMethod = CameraServiceGrpc.getGetRGBDImagesMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getGetRGBDImagesMethod = CameraServiceGrpc.getGetRGBDImagesMethod) == null) {
|
||||||
|
CameraServiceGrpc.getGetRGBDImagesMethod = getGetRGBDImagesMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.GetRGBDImagesCommand.Request, cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRGBDImages"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("GetRGBDImages"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetRGBDImagesMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StartCameraRecordingCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback> getStartRecordingMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "StartRecording",
|
||||||
|
requestType = cmvr.api.CameraCommand.StartCameraRecordingCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StartCameraRecordingCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback> getStartRecordingMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StartCameraRecordingCommand.Request, cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback> getStartRecordingMethod;
|
||||||
|
if ((getStartRecordingMethod = CameraServiceGrpc.getStartRecordingMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getStartRecordingMethod = CameraServiceGrpc.getStartRecordingMethod) == null) {
|
||||||
|
CameraServiceGrpc.getStartRecordingMethod = getStartRecordingMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.StartCameraRecordingCommand.Request, cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartRecording"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.StartCameraRecordingCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("StartRecording"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStartRecordingMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StopCameraRecordingCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback> getStopRecordingMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "StopRecording",
|
||||||
|
requestType = cmvr.api.CameraCommand.StopCameraRecordingCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StopCameraRecordingCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback> getStopRecordingMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.StopCameraRecordingCommand.Request, cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback> getStopRecordingMethod;
|
||||||
|
if ((getStopRecordingMethod = CameraServiceGrpc.getStopRecordingMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getStopRecordingMethod = CameraServiceGrpc.getStopRecordingMethod) == null) {
|
||||||
|
CameraServiceGrpc.getStopRecordingMethod = getStopRecordingMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.StopCameraRecordingCommand.Request, cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopRecording"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.StopCameraRecordingCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("StopRecording"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStopRecordingMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback> getGetRGBImageStreamMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetRGBImageStream",
|
||||||
|
requestType = cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback> getGetRGBImageStreamMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request, cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback> getGetRGBImageStreamMethod;
|
||||||
|
if ((getGetRGBImageStreamMethod = CameraServiceGrpc.getGetRGBImageStreamMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getGetRGBImageStreamMethod = CameraServiceGrpc.getGetRGBImageStreamMethod) == null) {
|
||||||
|
CameraServiceGrpc.getGetRGBImageStreamMethod = getGetRGBImageStreamMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request, cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRGBImageStream"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("GetRGBImageStream"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetRGBImageStreamMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetDepthImageStreamCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback> getGetDepthImageStreamMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetDepthImageStream",
|
||||||
|
requestType = cmvr.api.CameraCommand.GetDepthImageStreamCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetDepthImageStreamCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback> getGetDepthImageStreamMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetDepthImageStreamCommand.Request, cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback> getGetDepthImageStreamMethod;
|
||||||
|
if ((getGetDepthImageStreamMethod = CameraServiceGrpc.getGetDepthImageStreamMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getGetDepthImageStreamMethod = CameraServiceGrpc.getGetDepthImageStreamMethod) == null) {
|
||||||
|
CameraServiceGrpc.getGetDepthImageStreamMethod = getGetDepthImageStreamMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.GetDepthImageStreamCommand.Request, cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDepthImageStream"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageStreamCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("GetDepthImageStream"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetDepthImageStreamMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback> getGetRGBDImagesStreamMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetRGBDImagesStream",
|
||||||
|
requestType = cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback> getGetRGBDImagesStreamMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Request, cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback> getGetRGBDImagesStreamMethod;
|
||||||
|
if ((getGetRGBDImagesStreamMethod = CameraServiceGrpc.getGetRGBDImagesStreamMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getGetRGBDImagesStreamMethod = CameraServiceGrpc.getGetRGBDImagesStreamMethod) == null) {
|
||||||
|
CameraServiceGrpc.getGetRGBDImagesStreamMethod = getGetRGBDImagesStreamMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Request, cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRGBDImagesStream"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("GetRGBDImagesStream"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetRGBDImagesStreamMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new async stub that supports all call types for the service
|
||||||
|
*/
|
||||||
|
public static CameraServiceStub newStub(io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<CameraServiceStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<CameraServiceStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public CameraServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new CameraServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return CameraServiceStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||||
|
*/
|
||||||
|
public static CameraServiceBlockingStub newBlockingStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<CameraServiceBlockingStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<CameraServiceBlockingStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public CameraServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new CameraServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return CameraServiceBlockingStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||||
|
*/
|
||||||
|
public static CameraServiceFutureStub newFutureStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<CameraServiceFutureStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<CameraServiceFutureStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public CameraServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new CameraServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return CameraServiceFutureStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static abstract class CameraServiceImplBase implements io.grpc.BindableService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.CameraCommand.GetCameraStateCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetCameraStateCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStatusMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void startCamera(cmvr.api.CameraCommand.StartCameraCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StartCameraCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartCameraMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void stopCamera(cmvr.api.CameraCommand.StopCameraCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StopCameraCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopCameraMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getRGBImage(cmvr.api.CameraCommand.GetRGBImageCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRGBImageMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getDepthImage(cmvr.api.CameraCommand.GetDepthImageCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetDepthImageCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetDepthImageMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getRGBDImages(cmvr.api.CameraCommand.GetRGBDImagesCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRGBDImagesMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void startRecording(cmvr.api.CameraCommand.StartCameraRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartRecordingMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void stopRecording(cmvr.api.CameraCommand.StopCameraRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopRecordingMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGetRGBImageStreamMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetDepthImageStreamCommand.Request> getDepthImageStream(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGetDepthImageStreamMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Request> getRGBDImagesStream(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGetRGBDImagesStreamMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||||
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||||
|
.addMethod(
|
||||||
|
getGetStatusMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.GetCameraStateCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetCameraStateCommand.Feedback>(
|
||||||
|
this, METHODID_GET_STATUS)))
|
||||||
|
.addMethod(
|
||||||
|
getStartCameraMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.StartCameraCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StartCameraCommand.Feedback>(
|
||||||
|
this, METHODID_START_CAMERA)))
|
||||||
|
.addMethod(
|
||||||
|
getStopCameraMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.StopCameraCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StopCameraCommand.Feedback>(
|
||||||
|
this, METHODID_STOP_CAMERA)))
|
||||||
|
.addMethod(
|
||||||
|
getGetRGBImageMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageCommand.Feedback>(
|
||||||
|
this, METHODID_GET_RGBIMAGE)))
|
||||||
|
.addMethod(
|
||||||
|
getGetDepthImageMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageCommand.Feedback>(
|
||||||
|
this, METHODID_GET_DEPTH_IMAGE)))
|
||||||
|
.addMethod(
|
||||||
|
getGetRGBDImagesMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback>(
|
||||||
|
this, METHODID_GET_RGBDIMAGES)))
|
||||||
|
.addMethod(
|
||||||
|
getStartRecordingMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.StartCameraRecordingCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback>(
|
||||||
|
this, METHODID_START_RECORDING)))
|
||||||
|
.addMethod(
|
||||||
|
getStopRecordingMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.StopCameraRecordingCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback>(
|
||||||
|
this, METHODID_STOP_RECORDING)))
|
||||||
|
.addMethod(
|
||||||
|
getGetRGBImageStreamMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback>(
|
||||||
|
this, METHODID_GET_RGBIMAGE_STREAM)))
|
||||||
|
.addMethod(
|
||||||
|
getGetDepthImageStreamMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageStreamCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback>(
|
||||||
|
this, METHODID_GET_DEPTH_IMAGE_STREAM)))
|
||||||
|
.addMethod(
|
||||||
|
getGetRGBDImagesStreamMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback>(
|
||||||
|
this, METHODID_GET_RGBDIMAGES_STREAM)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class CameraServiceStub extends io.grpc.stub.AbstractAsyncStub<CameraServiceStub> {
|
||||||
|
private CameraServiceStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected CameraServiceStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new CameraServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.CameraCommand.GetCameraStateCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetCameraStateCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void startCamera(cmvr.api.CameraCommand.StartCameraCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StartCameraCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getStartCameraMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void stopCamera(cmvr.api.CameraCommand.StopCameraCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StopCameraCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getStopCameraMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getRGBImage(cmvr.api.CameraCommand.GetRGBImageCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetRGBImageMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getDepthImage(cmvr.api.CameraCommand.GetDepthImageCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetDepthImageCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetDepthImageMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getRGBDImages(cmvr.api.CameraCommand.GetRGBDImagesCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetRGBDImagesMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void startRecording(cmvr.api.CameraCommand.StartCameraRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getStartRecordingMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void stopRecording(cmvr.api.CameraCommand.StopCameraRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getStopRecordingMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
|
||||||
|
getChannel().newCall(getGetRGBImageStreamMethod(), getCallOptions()), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetDepthImageStreamCommand.Request> getDepthImageStream(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
|
||||||
|
getChannel().newCall(getGetDepthImageStreamMethod(), getCallOptions()), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Request> getRGBDImagesStream(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
|
||||||
|
getChannel().newCall(getGetRGBDImagesStreamMethod(), getCallOptions()), responseObserver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class CameraServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<CameraServiceBlockingStub> {
|
||||||
|
private CameraServiceBlockingStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected CameraServiceBlockingStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new CameraServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.CameraCommand.GetCameraStateCommand.Feedback getStatus(cmvr.api.CameraCommand.GetCameraStateCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetStatusMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.CameraCommand.StartCameraCommand.Feedback startCamera(cmvr.api.CameraCommand.StartCameraCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getStartCameraMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.CameraCommand.StopCameraCommand.Feedback stopCamera(cmvr.api.CameraCommand.StopCameraCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getStopCameraMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.CameraCommand.GetRGBImageCommand.Feedback getRGBImage(cmvr.api.CameraCommand.GetRGBImageCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetRGBImageMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.CameraCommand.GetDepthImageCommand.Feedback getDepthImage(cmvr.api.CameraCommand.GetDepthImageCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetDepthImageMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback getRGBDImages(cmvr.api.CameraCommand.GetRGBDImagesCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetRGBDImagesMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback startRecording(cmvr.api.CameraCommand.StartCameraRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getStartRecordingMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback stopRecording(cmvr.api.CameraCommand.StopCameraRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getStopRecordingMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class CameraServiceFutureStub extends io.grpc.stub.AbstractFutureStub<CameraServiceFutureStub> {
|
||||||
|
private CameraServiceFutureStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected CameraServiceFutureStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new CameraServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.CameraCommand.GetCameraStateCommand.Feedback> getStatus(
|
||||||
|
cmvr.api.CameraCommand.GetCameraStateCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.CameraCommand.StartCameraCommand.Feedback> startCamera(
|
||||||
|
cmvr.api.CameraCommand.StartCameraCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getStartCameraMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.CameraCommand.StopCameraCommand.Feedback> stopCamera(
|
||||||
|
cmvr.api.CameraCommand.StopCameraCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getStopCameraMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.CameraCommand.GetRGBImageCommand.Feedback> getRGBImage(
|
||||||
|
cmvr.api.CameraCommand.GetRGBImageCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetRGBImageMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.CameraCommand.GetDepthImageCommand.Feedback> getDepthImage(
|
||||||
|
cmvr.api.CameraCommand.GetDepthImageCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetDepthImageMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback> getRGBDImages(
|
||||||
|
cmvr.api.CameraCommand.GetRGBDImagesCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetRGBDImagesMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback> startRecording(
|
||||||
|
cmvr.api.CameraCommand.StartCameraRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getStartRecordingMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback> stopRecording(
|
||||||
|
cmvr.api.CameraCommand.StopCameraRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getStopRecordingMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int METHODID_GET_STATUS = 0;
|
||||||
|
private static final int METHODID_START_CAMERA = 1;
|
||||||
|
private static final int METHODID_STOP_CAMERA = 2;
|
||||||
|
private static final int METHODID_GET_RGBIMAGE = 3;
|
||||||
|
private static final int METHODID_GET_DEPTH_IMAGE = 4;
|
||||||
|
private static final int METHODID_GET_RGBDIMAGES = 5;
|
||||||
|
private static final int METHODID_START_RECORDING = 6;
|
||||||
|
private static final int METHODID_STOP_RECORDING = 7;
|
||||||
|
private static final int METHODID_GET_RGBIMAGE_STREAM = 8;
|
||||||
|
private static final int METHODID_GET_DEPTH_IMAGE_STREAM = 9;
|
||||||
|
private static final int METHODID_GET_RGBDIMAGES_STREAM = 10;
|
||||||
|
|
||||||
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||||
|
private final CameraServiceImplBase serviceImpl;
|
||||||
|
private final int methodId;
|
||||||
|
|
||||||
|
MethodHandlers(CameraServiceImplBase serviceImpl, int methodId) {
|
||||||
|
this.serviceImpl = serviceImpl;
|
||||||
|
this.methodId = methodId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_GET_STATUS:
|
||||||
|
serviceImpl.getStatus((cmvr.api.CameraCommand.GetCameraStateCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetCameraStateCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_START_CAMERA:
|
||||||
|
serviceImpl.startCamera((cmvr.api.CameraCommand.StartCameraCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StartCameraCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_STOP_CAMERA:
|
||||||
|
serviceImpl.stopCamera((cmvr.api.CameraCommand.StopCameraCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StopCameraCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_GET_RGBIMAGE:
|
||||||
|
serviceImpl.getRGBImage((cmvr.api.CameraCommand.GetRGBImageCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_GET_DEPTH_IMAGE:
|
||||||
|
serviceImpl.getDepthImage((cmvr.api.CameraCommand.GetDepthImageCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetDepthImageCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_GET_RGBDIMAGES:
|
||||||
|
serviceImpl.getRGBDImages((cmvr.api.CameraCommand.GetRGBDImagesCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBDImagesCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_START_RECORDING:
|
||||||
|
serviceImpl.startRecording((cmvr.api.CameraCommand.StartCameraRecordingCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StartCameraRecordingCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_STOP_RECORDING:
|
||||||
|
serviceImpl.stopRecording((cmvr.api.CameraCommand.StopCameraRecordingCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_GET_RGBIMAGE_STREAM:
|
||||||
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getRGBImageStream(
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback>) responseObserver);
|
||||||
|
case METHODID_GET_DEPTH_IMAGE_STREAM:
|
||||||
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getDepthImageStream(
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetDepthImageStreamCommand.Feedback>) responseObserver);
|
||||||
|
case METHODID_GET_RGBDIMAGES_STREAM:
|
||||||
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getRGBDImagesStream(
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBDImagesStreamCommand.Feedback>) responseObserver);
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static abstract class CameraServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||||
|
CameraServiceBaseDescriptorSupplier() {}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||||
|
return cmvr.api.CameraServiceOuterClass.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
return getFileDescriptor().findServiceByName("CameraService");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class CameraServiceFileDescriptorSupplier
|
||||||
|
extends CameraServiceBaseDescriptorSupplier {
|
||||||
|
CameraServiceFileDescriptorSupplier() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class CameraServiceMethodDescriptorSupplier
|
||||||
|
extends CameraServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||||
|
private final String methodName;
|
||||||
|
|
||||||
|
CameraServiceMethodDescriptorSupplier(String methodName) {
|
||||||
|
this.methodName = methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||||
|
return getServiceDescriptor().findMethodByName(methodName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||||
|
|
||||||
|
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||||
|
.setSchemaDescriptor(new CameraServiceFileDescriptorSupplier())
|
||||||
|
.addMethod(getGetStatusMethod())
|
||||||
|
.addMethod(getStartCameraMethod())
|
||||||
|
.addMethod(getStopCameraMethod())
|
||||||
|
.addMethod(getGetRGBImageMethod())
|
||||||
|
.addMethod(getGetDepthImageMethod())
|
||||||
|
.addMethod(getGetRGBDImagesMethod())
|
||||||
|
.addMethod(getStartRecordingMethod())
|
||||||
|
.addMethod(getStopRecordingMethod())
|
||||||
|
.addMethod(getGetRGBImageStreamMethod())
|
||||||
|
.addMethod(getGetDepthImageStreamMethod())
|
||||||
|
.addMethod(getGetRGBDImagesStreamMethod())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: cmvr/api/camera_service.proto
|
||||||
|
|
||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
public final class CameraServiceOuterClass {
|
||||||
|
private CameraServiceOuterClass() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\035cmvr/api/camera_service.proto\022\010cmvr.ap" +
|
||||||
|
"i\032\035cmvr/api/camera_command.proto2\233\t\n\rCam" +
|
||||||
|
"eraService\022`\n\tGetStatus\022\'.cmvr.api.GetCa" +
|
||||||
|
"meraStateCommand.Request\032(.cmvr.api.GetC" +
|
||||||
|
"ameraStateCommand.Feedback\"\000\022\\\n\013StartCam" +
|
||||||
|
"era\022$.cmvr.api.StartCameraCommand.Reques" +
|
||||||
|
"t\032%.cmvr.api.StartCameraCommand.Feedback" +
|
||||||
|
"\"\000\022Y\n\nStopCamera\022#.cmvr.api.StopCameraCo" +
|
||||||
|
"mmand.Request\032$.cmvr.api.StopCameraComma" +
|
||||||
|
"nd.Feedback\"\000\022\\\n\013GetRGBImage\022$.cmvr.api." +
|
||||||
|
"GetRGBImageCommand.Request\032%.cmvr.api.Ge" +
|
||||||
|
"tRGBImageCommand.Feedback\"\000\022b\n\rGetDepthI" +
|
||||||
|
"mage\022&.cmvr.api.GetDepthImageCommand.Req" +
|
||||||
|
"uest\032\'.cmvr.api.GetDepthImageCommand.Fee" +
|
||||||
|
"dback\"\000\022b\n\rGetRGBDImages\022&.cmvr.api.GetR" +
|
||||||
|
"GBDImagesCommand.Request\032\'.cmvr.api.GetR" +
|
||||||
|
"GBDImagesCommand.Feedback\"\000\022q\n\016StartReco" +
|
||||||
|
"rding\022-.cmvr.api.StartCameraRecordingCom" +
|
||||||
|
"mand.Request\032..cmvr.api.StartCameraRecor" +
|
||||||
|
"dingCommand.Feedback\"\000\022n\n\rStopRecording\022" +
|
||||||
|
",.cmvr.api.StopCameraRecordingCommand.Re" +
|
||||||
|
"quest\032-.cmvr.api.StopCameraRecordingComm" +
|
||||||
|
"and.Feedback\"\000\022r\n\021GetRGBImageStream\022*.cm" +
|
||||||
|
"vr.api.GetRGBImageStreamCommand.Request\032" +
|
||||||
|
"+.cmvr.api.GetRGBImageStreamCommand.Feed" +
|
||||||
|
"back\"\000(\0010\001\022x\n\023GetDepthImageStream\022,.cmvr" +
|
||||||
|
".api.GetDepthImageStreamCommand.Request\032" +
|
||||||
|
"-.cmvr.api.GetDepthImageStreamCommand.Fe" +
|
||||||
|
"edback\"\000(\0010\001\022x\n\023GetRGBDImagesStream\022,.cm" +
|
||||||
|
"vr.api.GetRGBDImagesStreamCommand.Reques" +
|
||||||
|
"t\032-.cmvr.api.GetRGBDImagesStreamCommand." +
|
||||||
|
"Feedback\"\000(\0010\001b\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
cmvr.api.CameraCommand.getDescriptor(),
|
||||||
|
});
|
||||||
|
cmvr.api.CameraCommand.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,790 @@
|
|||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
@javax.annotation.Generated(
|
||||||
|
value = "by gRPC proto compiler (version 1.52.0)",
|
||||||
|
comments = "Source: cmvr/api/dexhand_service.proto")
|
||||||
|
@io.grpc.stub.annotations.GrpcGenerated
|
||||||
|
public final class DexHandServiceGrpc {
|
||||||
|
|
||||||
|
private DexHandServiceGrpc() {}
|
||||||
|
|
||||||
|
public static final String SERVICE_NAME = "cmvr.api.DexHandService";
|
||||||
|
|
||||||
|
// Static method descriptors that strictly reflect the proto.
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.GetDexHandStateCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback> getGetStatusMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetStatus",
|
||||||
|
requestType = cmvr.api.DexhandCommand.GetDexHandStateCommand.Request.class,
|
||||||
|
responseType = cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.GetDexHandStateCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback> getGetStatusMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.GetDexHandStateCommand.Request, cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback> getGetStatusMethod;
|
||||||
|
if ((getGetStatusMethod = DexHandServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
synchronized (DexHandServiceGrpc.class) {
|
||||||
|
if ((getGetStatusMethod = DexHandServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
DexHandServiceGrpc.getGetStatusMethod = getGetStatusMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.DexhandCommand.GetDexHandStateCommand.Request, cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStatus"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.GetDexHandStateCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new DexHandServiceMethodDescriptorSupplier("GetStatus"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetStatusMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback> getSetDexHandPosMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SetDexHandPos",
|
||||||
|
requestType = cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request.class,
|
||||||
|
responseType = cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback> getSetDexHandPosMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request, cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback> getSetDexHandPosMethod;
|
||||||
|
if ((getSetDexHandPosMethod = DexHandServiceGrpc.getSetDexHandPosMethod) == null) {
|
||||||
|
synchronized (DexHandServiceGrpc.class) {
|
||||||
|
if ((getSetDexHandPosMethod = DexHandServiceGrpc.getSetDexHandPosMethod) == null) {
|
||||||
|
DexHandServiceGrpc.getSetDexHandPosMethod = getSetDexHandPosMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request, cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetDexHandPos"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new DexHandServiceMethodDescriptorSupplier("SetDexHandPos"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetDexHandPosMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback> getSetDexHandAngleMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SetDexHandAngle",
|
||||||
|
requestType = cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request.class,
|
||||||
|
responseType = cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback> getSetDexHandAngleMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request, cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback> getSetDexHandAngleMethod;
|
||||||
|
if ((getSetDexHandAngleMethod = DexHandServiceGrpc.getSetDexHandAngleMethod) == null) {
|
||||||
|
synchronized (DexHandServiceGrpc.class) {
|
||||||
|
if ((getSetDexHandAngleMethod = DexHandServiceGrpc.getSetDexHandAngleMethod) == null) {
|
||||||
|
DexHandServiceGrpc.getSetDexHandAngleMethod = getSetDexHandAngleMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request, cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetDexHandAngle"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new DexHandServiceMethodDescriptorSupplier("SetDexHandAngle"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetDexHandAngleMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandForceCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback> getSetDexHandForceMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SetDexHandForce",
|
||||||
|
requestType = cmvr.api.DexhandCommand.SetDexHandForceCommand.Request.class,
|
||||||
|
responseType = cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandForceCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback> getSetDexHandForceMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandForceCommand.Request, cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback> getSetDexHandForceMethod;
|
||||||
|
if ((getSetDexHandForceMethod = DexHandServiceGrpc.getSetDexHandForceMethod) == null) {
|
||||||
|
synchronized (DexHandServiceGrpc.class) {
|
||||||
|
if ((getSetDexHandForceMethod = DexHandServiceGrpc.getSetDexHandForceMethod) == null) {
|
||||||
|
DexHandServiceGrpc.getSetDexHandForceMethod = getSetDexHandForceMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.DexhandCommand.SetDexHandForceCommand.Request, cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetDexHandForce"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandForceCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new DexHandServiceMethodDescriptorSupplier("SetDexHandForce"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetDexHandForceMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback> getSetDexHandSpeedMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SetDexHandSpeed",
|
||||||
|
requestType = cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request.class,
|
||||||
|
responseType = cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback> getSetDexHandSpeedMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request, cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback> getSetDexHandSpeedMethod;
|
||||||
|
if ((getSetDexHandSpeedMethod = DexHandServiceGrpc.getSetDexHandSpeedMethod) == null) {
|
||||||
|
synchronized (DexHandServiceGrpc.class) {
|
||||||
|
if ((getSetDexHandSpeedMethod = DexHandServiceGrpc.getSetDexHandSpeedMethod) == null) {
|
||||||
|
DexHandServiceGrpc.getSetDexHandSpeedMethod = getSetDexHandSpeedMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request, cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetDexHandSpeed"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new DexHandServiceMethodDescriptorSupplier("SetDexHandSpeed"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetDexHandSpeedMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback> getSetDexHandPresetActMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SetDexHandPresetAct",
|
||||||
|
requestType = cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request.class,
|
||||||
|
responseType = cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback> getSetDexHandPresetActMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request, cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback> getSetDexHandPresetActMethod;
|
||||||
|
if ((getSetDexHandPresetActMethod = DexHandServiceGrpc.getSetDexHandPresetActMethod) == null) {
|
||||||
|
synchronized (DexHandServiceGrpc.class) {
|
||||||
|
if ((getSetDexHandPresetActMethod = DexHandServiceGrpc.getSetDexHandPresetActMethod) == null) {
|
||||||
|
DexHandServiceGrpc.getSetDexHandPresetActMethod = getSetDexHandPresetActMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request, cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetDexHandPresetAct"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new DexHandServiceMethodDescriptorSupplier("SetDexHandPresetAct"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetDexHandPresetActMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.GetSensorDataCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback> getGetSensorDataMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetSensorData",
|
||||||
|
requestType = cmvr.api.DexhandCommand.GetSensorDataCommand.Request.class,
|
||||||
|
responseType = cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.GetSensorDataCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback> getGetSensorDataMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.GetSensorDataCommand.Request, cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback> getGetSensorDataMethod;
|
||||||
|
if ((getGetSensorDataMethod = DexHandServiceGrpc.getGetSensorDataMethod) == null) {
|
||||||
|
synchronized (DexHandServiceGrpc.class) {
|
||||||
|
if ((getGetSensorDataMethod = DexHandServiceGrpc.getGetSensorDataMethod) == null) {
|
||||||
|
DexHandServiceGrpc.getGetSensorDataMethod = getGetSensorDataMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.DexhandCommand.GetSensorDataCommand.Request, cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSensorData"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new DexHandServiceMethodDescriptorSupplier("GetSensorData"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetSensorDataMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback> getGetSensorDataStreamMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetSensorDataStream",
|
||||||
|
requestType = cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Request.class,
|
||||||
|
responseType = cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback> getGetSensorDataStreamMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Request, cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback> getGetSensorDataStreamMethod;
|
||||||
|
if ((getGetSensorDataStreamMethod = DexHandServiceGrpc.getGetSensorDataStreamMethod) == null) {
|
||||||
|
synchronized (DexHandServiceGrpc.class) {
|
||||||
|
if ((getGetSensorDataStreamMethod = DexHandServiceGrpc.getGetSensorDataStreamMethod) == null) {
|
||||||
|
DexHandServiceGrpc.getGetSensorDataStreamMethod = getGetSensorDataStreamMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Request, cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSensorDataStream"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new DexHandServiceMethodDescriptorSupplier("GetSensorDataStream"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetSensorDataStreamMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new async stub that supports all call types for the service
|
||||||
|
*/
|
||||||
|
public static DexHandServiceStub newStub(io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<DexHandServiceStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<DexHandServiceStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public DexHandServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new DexHandServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return DexHandServiceStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||||
|
*/
|
||||||
|
public static DexHandServiceBlockingStub newBlockingStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<DexHandServiceBlockingStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<DexHandServiceBlockingStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public DexHandServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new DexHandServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return DexHandServiceBlockingStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||||
|
*/
|
||||||
|
public static DexHandServiceFutureStub newFutureStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<DexHandServiceFutureStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<DexHandServiceFutureStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public DexHandServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new DexHandServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return DexHandServiceFutureStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static abstract class DexHandServiceImplBase implements io.grpc.BindableService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.DexhandCommand.GetDexHandStateCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStatusMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandPos(cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetDexHandPosMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandAngle(cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetDexHandAngleMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandForce(cmvr.api.DexhandCommand.SetDexHandForceCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetDexHandForceMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandSpeed(cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetDexHandSpeedMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandPresetAct(cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetDexHandPresetActMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getSensorData(cmvr.api.DexhandCommand.GetSensorDataCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSensorDataMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Request> getSensorDataStream(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGetSensorDataStreamMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||||
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||||
|
.addMethod(
|
||||||
|
getGetStatusMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.DexhandCommand.GetDexHandStateCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback>(
|
||||||
|
this, METHODID_GET_STATUS)))
|
||||||
|
.addMethod(
|
||||||
|
getSetDexHandPosMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback>(
|
||||||
|
this, METHODID_SET_DEX_HAND_POS)))
|
||||||
|
.addMethod(
|
||||||
|
getSetDexHandAngleMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback>(
|
||||||
|
this, METHODID_SET_DEX_HAND_ANGLE)))
|
||||||
|
.addMethod(
|
||||||
|
getSetDexHandForceMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandForceCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback>(
|
||||||
|
this, METHODID_SET_DEX_HAND_FORCE)))
|
||||||
|
.addMethod(
|
||||||
|
getSetDexHandSpeedMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback>(
|
||||||
|
this, METHODID_SET_DEX_HAND_SPEED)))
|
||||||
|
.addMethod(
|
||||||
|
getSetDexHandPresetActMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback>(
|
||||||
|
this, METHODID_SET_DEX_HAND_PRESET_ACT)))
|
||||||
|
.addMethod(
|
||||||
|
getGetSensorDataMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback>(
|
||||||
|
this, METHODID_GET_SENSOR_DATA)))
|
||||||
|
.addMethod(
|
||||||
|
getGetSensorDataStreamMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Request,
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback>(
|
||||||
|
this, METHODID_GET_SENSOR_DATA_STREAM)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class DexHandServiceStub extends io.grpc.stub.AbstractAsyncStub<DexHandServiceStub> {
|
||||||
|
private DexHandServiceStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected DexHandServiceStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new DexHandServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.DexhandCommand.GetDexHandStateCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandPos(cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandPosMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandAngle(cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandAngleMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandForce(cmvr.api.DexhandCommand.SetDexHandForceCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandForceMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandSpeed(cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandSpeedMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setDexHandPresetAct(cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandPresetActMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getSensorData(cmvr.api.DexhandCommand.GetSensorDataCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetSensorDataMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Request> getSensorDataStream(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback> responseObserver) {
|
||||||
|
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
|
||||||
|
getChannel().newCall(getGetSensorDataStreamMethod(), getCallOptions()), responseObserver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class DexHandServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<DexHandServiceBlockingStub> {
|
||||||
|
private DexHandServiceBlockingStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected DexHandServiceBlockingStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new DexHandServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback getStatus(cmvr.api.DexhandCommand.GetDexHandStateCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetStatusMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback setDexHandPos(cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetDexHandPosMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback setDexHandAngle(cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetDexHandAngleMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback setDexHandForce(cmvr.api.DexhandCommand.SetDexHandForceCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetDexHandForceMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback setDexHandSpeed(cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetDexHandSpeedMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback setDexHandPresetAct(cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetDexHandPresetActMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback getSensorData(cmvr.api.DexhandCommand.GetSensorDataCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetSensorDataMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class DexHandServiceFutureStub extends io.grpc.stub.AbstractFutureStub<DexHandServiceFutureStub> {
|
||||||
|
private DexHandServiceFutureStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected DexHandServiceFutureStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new DexHandServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback> getStatus(
|
||||||
|
cmvr.api.DexhandCommand.GetDexHandStateCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback> setDexHandPos(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandPosMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback> setDexHandAngle(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandAngleMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback> setDexHandForce(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandForceCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandForceMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback> setDexHandSpeed(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandSpeedMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback> setDexHandPresetAct(
|
||||||
|
cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetDexHandPresetActMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback> getSensorData(
|
||||||
|
cmvr.api.DexhandCommand.GetSensorDataCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetSensorDataMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int METHODID_GET_STATUS = 0;
|
||||||
|
private static final int METHODID_SET_DEX_HAND_POS = 1;
|
||||||
|
private static final int METHODID_SET_DEX_HAND_ANGLE = 2;
|
||||||
|
private static final int METHODID_SET_DEX_HAND_FORCE = 3;
|
||||||
|
private static final int METHODID_SET_DEX_HAND_SPEED = 4;
|
||||||
|
private static final int METHODID_SET_DEX_HAND_PRESET_ACT = 5;
|
||||||
|
private static final int METHODID_GET_SENSOR_DATA = 6;
|
||||||
|
private static final int METHODID_GET_SENSOR_DATA_STREAM = 7;
|
||||||
|
|
||||||
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||||
|
private final DexHandServiceImplBase serviceImpl;
|
||||||
|
private final int methodId;
|
||||||
|
|
||||||
|
MethodHandlers(DexHandServiceImplBase serviceImpl, int methodId) {
|
||||||
|
this.serviceImpl = serviceImpl;
|
||||||
|
this.methodId = methodId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_GET_STATUS:
|
||||||
|
serviceImpl.getStatus((cmvr.api.DexhandCommand.GetDexHandStateCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetDexHandStateCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SET_DEX_HAND_POS:
|
||||||
|
serviceImpl.setDexHandPos((cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandPositionsCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SET_DEX_HAND_ANGLE:
|
||||||
|
serviceImpl.setDexHandAngle((cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandAnglesCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SET_DEX_HAND_FORCE:
|
||||||
|
serviceImpl.setDexHandForce((cmvr.api.DexhandCommand.SetDexHandForceCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandForceCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SET_DEX_HAND_SPEED:
|
||||||
|
serviceImpl.setDexHandSpeed((cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandSpeedCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SET_DEX_HAND_PRESET_ACT:
|
||||||
|
serviceImpl.setDexHandPresetAct((cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.SetDexHandPresetActCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_GET_SENSOR_DATA:
|
||||||
|
serviceImpl.getSensorData((cmvr.api.DexhandCommand.GetSensorDataCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetSensorDataCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_GET_SENSOR_DATA_STREAM:
|
||||||
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getSensorDataStream(
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.DexhandCommand.GetSensorDataStreamCommand.Feedback>) responseObserver);
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static abstract class DexHandServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||||
|
DexHandServiceBaseDescriptorSupplier() {}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||||
|
return cmvr.api.DexhandService.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
return getFileDescriptor().findServiceByName("DexHandService");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class DexHandServiceFileDescriptorSupplier
|
||||||
|
extends DexHandServiceBaseDescriptorSupplier {
|
||||||
|
DexHandServiceFileDescriptorSupplier() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class DexHandServiceMethodDescriptorSupplier
|
||||||
|
extends DexHandServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||||
|
private final String methodName;
|
||||||
|
|
||||||
|
DexHandServiceMethodDescriptorSupplier(String methodName) {
|
||||||
|
this.methodName = methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||||
|
return getServiceDescriptor().findMethodByName(methodName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||||
|
|
||||||
|
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
synchronized (DexHandServiceGrpc.class) {
|
||||||
|
result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||||
|
.setSchemaDescriptor(new DexHandServiceFileDescriptorSupplier())
|
||||||
|
.addMethod(getGetStatusMethod())
|
||||||
|
.addMethod(getSetDexHandPosMethod())
|
||||||
|
.addMethod(getSetDexHandAngleMethod())
|
||||||
|
.addMethod(getSetDexHandForceMethod())
|
||||||
|
.addMethod(getSetDexHandSpeedMethod())
|
||||||
|
.addMethod(getSetDexHandPresetActMethod())
|
||||||
|
.addMethod(getGetSensorDataMethod())
|
||||||
|
.addMethod(getGetSensorDataStreamMethod())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,60 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: cmvr/api/dexhand_service.proto
|
||||||
|
|
||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
public final class DexhandService {
|
||||||
|
private DexhandService() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\036cmvr/api/dexhand_service.proto\022\010cmvr.a" +
|
||||||
|
"pi\032\036cmvr/api/dexhand_command.proto2\350\006\n\016D" +
|
||||||
|
"exHandService\022`\n\tGetStatus\022(.cmvr.api.Ge" +
|
||||||
|
"tDexHandStateCommand.Request\032).cmvr.api." +
|
||||||
|
"GetDexHandStateCommand.Feedback\022l\n\rSetDe" +
|
||||||
|
"xHandPos\022,.cmvr.api.SetDexHandPositionsC" +
|
||||||
|
"ommand.Request\032-.cmvr.api.SetDexHandPosi" +
|
||||||
|
"tionsCommand.Feedback\022h\n\017SetDexHandAngle" +
|
||||||
|
"\022).cmvr.api.SetDexHandAnglesCommand.Requ" +
|
||||||
|
"est\032*.cmvr.api.SetDexHandAnglesCommand.F" +
|
||||||
|
"eedback\022f\n\017SetDexHandForce\022(.cmvr.api.Se" +
|
||||||
|
"tDexHandForceCommand.Request\032).cmvr.api." +
|
||||||
|
"SetDexHandForceCommand.Feedback\022f\n\017SetDe" +
|
||||||
|
"xHandSpeed\022(.cmvr.api.SetDexHandSpeedCom" +
|
||||||
|
"mand.Request\032).cmvr.api.SetDexHandSpeedC" +
|
||||||
|
"ommand.Feedback\022r\n\023SetDexHandPresetAct\022," +
|
||||||
|
".cmvr.api.SetDexHandPresetActCommand.Req" +
|
||||||
|
"uest\032-.cmvr.api.SetDexHandPresetActComma" +
|
||||||
|
"nd.Feedback\022`\n\rGetSensorData\022&.cmvr.api." +
|
||||||
|
"GetSensorDataCommand.Request\032\'.cmvr.api." +
|
||||||
|
"GetSensorDataCommand.Feedback\022v\n\023GetSens" +
|
||||||
|
"orDataStream\022,.cmvr.api.GetSensorDataStr" +
|
||||||
|
"eamCommand.Request\032-.cmvr.api.GetSensorD" +
|
||||||
|
"ataStreamCommand.Feedback(\0010\001b\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
cmvr.api.DexhandCommand.getDescriptor(),
|
||||||
|
});
|
||||||
|
cmvr.api.DexhandCommand.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,744 @@
|
|||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
@javax.annotation.Generated(
|
||||||
|
value = "by gRPC proto compiler (version 1.52.0)",
|
||||||
|
comments = "Source: cmvr/api/microphone_service.proto")
|
||||||
|
@io.grpc.stub.annotations.GrpcGenerated
|
||||||
|
public final class MicPhoneServiceGrpc {
|
||||||
|
|
||||||
|
private MicPhoneServiceGrpc() {}
|
||||||
|
|
||||||
|
public static final String SERVICE_NAME = "cmvr.api.MicPhoneService";
|
||||||
|
|
||||||
|
// Static method descriptors that strictly reflect the proto.
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.GetMicStateCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback> getGetStatusMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetStatus",
|
||||||
|
requestType = cmvr.api.MicrophoneCommand.GetMicStateCommand.Request.class,
|
||||||
|
responseType = cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.GetMicStateCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback> getGetStatusMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.GetMicStateCommand.Request, cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback> getGetStatusMethod;
|
||||||
|
if ((getGetStatusMethod = MicPhoneServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
synchronized (MicPhoneServiceGrpc.class) {
|
||||||
|
if ((getGetStatusMethod = MicPhoneServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
MicPhoneServiceGrpc.getGetStatusMethod = getGetStatusMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MicrophoneCommand.GetMicStateCommand.Request, cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStatus"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicStateCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MicPhoneServiceMethodDescriptorSupplier("GetStatus"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetStatusMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback> getStartRecordMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "StartRecord",
|
||||||
|
requestType = cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request.class,
|
||||||
|
responseType = cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback> getStartRecordMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request, cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback> getStartRecordMethod;
|
||||||
|
if ((getStartRecordMethod = MicPhoneServiceGrpc.getStartRecordMethod) == null) {
|
||||||
|
synchronized (MicPhoneServiceGrpc.class) {
|
||||||
|
if ((getStartRecordMethod = MicPhoneServiceGrpc.getStartRecordMethod) == null) {
|
||||||
|
MicPhoneServiceGrpc.getStartRecordMethod = getStartRecordMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request, cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartRecord"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MicPhoneServiceMethodDescriptorSupplier("StartRecord"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStartRecordMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback> getStopRecordMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "StopRecord",
|
||||||
|
requestType = cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request.class,
|
||||||
|
responseType = cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback> getStopRecordMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request, cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback> getStopRecordMethod;
|
||||||
|
if ((getStopRecordMethod = MicPhoneServiceGrpc.getStopRecordMethod) == null) {
|
||||||
|
synchronized (MicPhoneServiceGrpc.class) {
|
||||||
|
if ((getStopRecordMethod = MicPhoneServiceGrpc.getStopRecordMethod) == null) {
|
||||||
|
MicPhoneServiceGrpc.getStopRecordMethod = getStopRecordMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request, cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopRecord"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MicPhoneServiceMethodDescriptorSupplier("StopRecord"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStopRecordMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback> getPauseRecordMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "PauseRecord",
|
||||||
|
requestType = cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request.class,
|
||||||
|
responseType = cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback> getPauseRecordMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request, cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback> getPauseRecordMethod;
|
||||||
|
if ((getPauseRecordMethod = MicPhoneServiceGrpc.getPauseRecordMethod) == null) {
|
||||||
|
synchronized (MicPhoneServiceGrpc.class) {
|
||||||
|
if ((getPauseRecordMethod = MicPhoneServiceGrpc.getPauseRecordMethod) == null) {
|
||||||
|
MicPhoneServiceGrpc.getPauseRecordMethod = getPauseRecordMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request, cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "PauseRecord"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MicPhoneServiceMethodDescriptorSupplier("PauseRecord"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getPauseRecordMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback> getResumeRecordMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "ResumeRecord",
|
||||||
|
requestType = cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request.class,
|
||||||
|
responseType = cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback> getResumeRecordMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request, cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback> getResumeRecordMethod;
|
||||||
|
if ((getResumeRecordMethod = MicPhoneServiceGrpc.getResumeRecordMethod) == null) {
|
||||||
|
synchronized (MicPhoneServiceGrpc.class) {
|
||||||
|
if ((getResumeRecordMethod = MicPhoneServiceGrpc.getResumeRecordMethod) == null) {
|
||||||
|
MicPhoneServiceGrpc.getResumeRecordMethod = getResumeRecordMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request, cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResumeRecord"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MicPhoneServiceMethodDescriptorSupplier("ResumeRecord"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getResumeRecordMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback> getSetVolumeMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SetVolume",
|
||||||
|
requestType = cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request.class,
|
||||||
|
responseType = cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback> getSetVolumeMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request, cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback> getSetVolumeMethod;
|
||||||
|
if ((getSetVolumeMethod = MicPhoneServiceGrpc.getSetVolumeMethod) == null) {
|
||||||
|
synchronized (MicPhoneServiceGrpc.class) {
|
||||||
|
if ((getSetVolumeMethod = MicPhoneServiceGrpc.getSetVolumeMethod) == null) {
|
||||||
|
MicPhoneServiceGrpc.getSetVolumeMethod = getSetVolumeMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request, cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetVolume"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MicPhoneServiceMethodDescriptorSupplier("SetVolume"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetVolumeMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback> getGetVolumeMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetVolume",
|
||||||
|
requestType = cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request.class,
|
||||||
|
responseType = cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback> getGetVolumeMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request, cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback> getGetVolumeMethod;
|
||||||
|
if ((getGetVolumeMethod = MicPhoneServiceGrpc.getGetVolumeMethod) == null) {
|
||||||
|
synchronized (MicPhoneServiceGrpc.class) {
|
||||||
|
if ((getGetVolumeMethod = MicPhoneServiceGrpc.getGetVolumeMethod) == null) {
|
||||||
|
MicPhoneServiceGrpc.getGetVolumeMethod = getGetVolumeMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request, cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetVolume"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MicPhoneServiceMethodDescriptorSupplier("GetVolume"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetVolumeMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new async stub that supports all call types for the service
|
||||||
|
*/
|
||||||
|
public static MicPhoneServiceStub newStub(io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<MicPhoneServiceStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<MicPhoneServiceStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public MicPhoneServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MicPhoneServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return MicPhoneServiceStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||||
|
*/
|
||||||
|
public static MicPhoneServiceBlockingStub newBlockingStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<MicPhoneServiceBlockingStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<MicPhoneServiceBlockingStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public MicPhoneServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MicPhoneServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return MicPhoneServiceBlockingStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||||
|
*/
|
||||||
|
public static MicPhoneServiceFutureStub newFutureStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<MicPhoneServiceFutureStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<MicPhoneServiceFutureStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public MicPhoneServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MicPhoneServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return MicPhoneServiceFutureStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static abstract class MicPhoneServiceImplBase implements io.grpc.BindableService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.MicrophoneCommand.GetMicStateCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStatusMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void startRecord(cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartRecordMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void stopRecord(cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopRecordMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void pauseRecord(cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPauseRecordMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void resumeRecord(cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getResumeRecordMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 音量控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void setVolume(cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetVolumeMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getVolume(cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetVolumeMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||||
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||||
|
.addMethod(
|
||||||
|
getGetStatusMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicStateCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback>(
|
||||||
|
this, METHODID_GET_STATUS)))
|
||||||
|
.addMethod(
|
||||||
|
getStartRecordMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback>(
|
||||||
|
this, METHODID_START_RECORD)))
|
||||||
|
.addMethod(
|
||||||
|
getStopRecordMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback>(
|
||||||
|
this, METHODID_STOP_RECORD)))
|
||||||
|
.addMethod(
|
||||||
|
getPauseRecordMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback>(
|
||||||
|
this, METHODID_PAUSE_RECORD)))
|
||||||
|
.addMethod(
|
||||||
|
getResumeRecordMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback>(
|
||||||
|
this, METHODID_RESUME_RECORD)))
|
||||||
|
.addMethod(
|
||||||
|
getSetVolumeMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback>(
|
||||||
|
this, METHODID_SET_VOLUME)))
|
||||||
|
.addMethod(
|
||||||
|
getGetVolumeMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request,
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback>(
|
||||||
|
this, METHODID_GET_VOLUME)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class MicPhoneServiceStub extends io.grpc.stub.AbstractAsyncStub<MicPhoneServiceStub> {
|
||||||
|
private MicPhoneServiceStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected MicPhoneServiceStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MicPhoneServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.MicrophoneCommand.GetMicStateCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void startRecord(cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getStartRecordMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void stopRecord(cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getStopRecordMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void pauseRecord(cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getPauseRecordMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void resumeRecord(cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getResumeRecordMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 音量控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void setVolume(cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetVolumeMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getVolume(cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetVolumeMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class MicPhoneServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<MicPhoneServiceBlockingStub> {
|
||||||
|
private MicPhoneServiceBlockingStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected MicPhoneServiceBlockingStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MicPhoneServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback getStatus(cmvr.api.MicrophoneCommand.GetMicStateCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetStatusMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback startRecord(cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getStartRecordMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback stopRecord(cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getStopRecordMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback pauseRecord(cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getPauseRecordMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback resumeRecord(cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getResumeRecordMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 音量控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback setVolume(cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetVolumeMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback getVolume(cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetVolumeMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class MicPhoneServiceFutureStub extends io.grpc.stub.AbstractFutureStub<MicPhoneServiceFutureStub> {
|
||||||
|
private MicPhoneServiceFutureStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected MicPhoneServiceFutureStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MicPhoneServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback> getStatus(
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicStateCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback> startRecord(
|
||||||
|
cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getStartRecordMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback> stopRecord(
|
||||||
|
cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getStopRecordMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback> pauseRecord(
|
||||||
|
cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getPauseRecordMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback> resumeRecord(
|
||||||
|
cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getResumeRecordMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 音量控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback> setVolume(
|
||||||
|
cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetVolumeMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback> getVolume(
|
||||||
|
cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetVolumeMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int METHODID_GET_STATUS = 0;
|
||||||
|
private static final int METHODID_START_RECORD = 1;
|
||||||
|
private static final int METHODID_STOP_RECORD = 2;
|
||||||
|
private static final int METHODID_PAUSE_RECORD = 3;
|
||||||
|
private static final int METHODID_RESUME_RECORD = 4;
|
||||||
|
private static final int METHODID_SET_VOLUME = 5;
|
||||||
|
private static final int METHODID_GET_VOLUME = 6;
|
||||||
|
|
||||||
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||||
|
private final MicPhoneServiceImplBase serviceImpl;
|
||||||
|
private final int methodId;
|
||||||
|
|
||||||
|
MethodHandlers(MicPhoneServiceImplBase serviceImpl, int methodId) {
|
||||||
|
this.serviceImpl = serviceImpl;
|
||||||
|
this.methodId = methodId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_GET_STATUS:
|
||||||
|
serviceImpl.getStatus((cmvr.api.MicrophoneCommand.GetMicStateCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.GetMicStateCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_START_RECORD:
|
||||||
|
serviceImpl.startRecord((cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.StartMicRecordingCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_STOP_RECORD:
|
||||||
|
serviceImpl.stopRecord((cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.StopMicRecordingCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_PAUSE_RECORD:
|
||||||
|
serviceImpl.pauseRecord((cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.PauseMicRecordingCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_RESUME_RECORD:
|
||||||
|
serviceImpl.resumeRecord((cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.ResumeMicRecordingCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SET_VOLUME:
|
||||||
|
serviceImpl.setVolume((cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.SetMicPhoneVolumeCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_GET_VOLUME:
|
||||||
|
serviceImpl.getVolume((cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MicrophoneCommand.GetMicPhoneVolumeCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static abstract class MicPhoneServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||||
|
MicPhoneServiceBaseDescriptorSupplier() {}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||||
|
return cmvr.api.MicrophoneService.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
return getFileDescriptor().findServiceByName("MicPhoneService");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class MicPhoneServiceFileDescriptorSupplier
|
||||||
|
extends MicPhoneServiceBaseDescriptorSupplier {
|
||||||
|
MicPhoneServiceFileDescriptorSupplier() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class MicPhoneServiceMethodDescriptorSupplier
|
||||||
|
extends MicPhoneServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||||
|
private final String methodName;
|
||||||
|
|
||||||
|
MicPhoneServiceMethodDescriptorSupplier(String methodName) {
|
||||||
|
this.methodName = methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||||
|
return getServiceDescriptor().findMethodByName(methodName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||||
|
|
||||||
|
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
synchronized (MicPhoneServiceGrpc.class) {
|
||||||
|
result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||||
|
.setSchemaDescriptor(new MicPhoneServiceFileDescriptorSupplier())
|
||||||
|
.addMethod(getGetStatusMethod())
|
||||||
|
.addMethod(getStartRecordMethod())
|
||||||
|
.addMethod(getStopRecordMethod())
|
||||||
|
.addMethod(getPauseRecordMethod())
|
||||||
|
.addMethod(getResumeRecordMethod())
|
||||||
|
.addMethod(getSetVolumeMethod())
|
||||||
|
.addMethod(getGetVolumeMethod())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,57 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: cmvr/api/microphone_service.proto
|
||||||
|
|
||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
public final class MicrophoneService {
|
||||||
|
private MicrophoneService() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n!cmvr/api/microphone_service.proto\022\010cmv" +
|
||||||
|
"r.api\032!cmvr/api/microphone_command.proto" +
|
||||||
|
"2\327\005\n\017MicPhoneService\022X\n\tGetStatus\022$.cmvr" +
|
||||||
|
".api.GetMicStateCommand.Request\032%.cmvr.a" +
|
||||||
|
"pi.GetMicStateCommand.Feedback\022f\n\013StartR" +
|
||||||
|
"ecord\022*.cmvr.api.StartMicRecordingComman" +
|
||||||
|
"d.Request\032+.cmvr.api.StartMicRecordingCo" +
|
||||||
|
"mmand.Feedback\022c\n\nStopRecord\022).cmvr.api." +
|
||||||
|
"StopMicRecordingCommand.Request\032*.cmvr.a" +
|
||||||
|
"pi.StopMicRecordingCommand.Feedback\022f\n\013P" +
|
||||||
|
"auseRecord\022*.cmvr.api.PauseMicRecordingC" +
|
||||||
|
"ommand.Request\032+.cmvr.api.PauseMicRecord" +
|
||||||
|
"ingCommand.Feedback\022i\n\014ResumeRecord\022+.cm" +
|
||||||
|
"vr.api.ResumeMicRecordingCommand.Request" +
|
||||||
|
"\032,.cmvr.api.ResumeMicRecordingCommand.Fe" +
|
||||||
|
"edback\022d\n\tSetVolume\022*.cmvr.api.SetMicPho" +
|
||||||
|
"neVolumeCommand.Request\032+.cmvr.api.SetMi" +
|
||||||
|
"cPhoneVolumeCommand.Feedback\022d\n\tGetVolum" +
|
||||||
|
"e\022*.cmvr.api.GetMicPhoneVolumeCommand.Re" +
|
||||||
|
"quest\032+.cmvr.api.GetMicPhoneVolumeComman" +
|
||||||
|
"d.Feedbackb\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
cmvr.api.MicrophoneCommand.getDescriptor(),
|
||||||
|
});
|
||||||
|
cmvr.api.MicrophoneCommand.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,744 @@
|
|||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
@javax.annotation.Generated(
|
||||||
|
value = "by gRPC proto compiler (version 1.52.0)",
|
||||||
|
comments = "Source: cmvr/api/speaker_service.proto")
|
||||||
|
@io.grpc.stub.annotations.GrpcGenerated
|
||||||
|
public final class SpeakerServiceGrpc {
|
||||||
|
|
||||||
|
private SpeakerServiceGrpc() {}
|
||||||
|
|
||||||
|
public static final String SERVICE_NAME = "cmvr.api.SpeakerService";
|
||||||
|
|
||||||
|
// Static method descriptors that strictly reflect the proto.
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback> getGetStatusMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetStatus",
|
||||||
|
requestType = cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request.class,
|
||||||
|
responseType = cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback> getGetStatusMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request, cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback> getGetStatusMethod;
|
||||||
|
if ((getGetStatusMethod = SpeakerServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
synchronized (SpeakerServiceGrpc.class) {
|
||||||
|
if ((getGetStatusMethod = SpeakerServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
SpeakerServiceGrpc.getGetStatusMethod = getGetStatusMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request, cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStatus"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new SpeakerServiceMethodDescriptorSupplier("GetStatus"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetStatusMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.PlayAudioCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback> getPlayAudioMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "PlayAudio",
|
||||||
|
requestType = cmvr.api.SpeakerCommand.PlayAudioCommand.Request.class,
|
||||||
|
responseType = cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.PlayAudioCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback> getPlayAudioMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.PlayAudioCommand.Request, cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback> getPlayAudioMethod;
|
||||||
|
if ((getPlayAudioMethod = SpeakerServiceGrpc.getPlayAudioMethod) == null) {
|
||||||
|
synchronized (SpeakerServiceGrpc.class) {
|
||||||
|
if ((getPlayAudioMethod = SpeakerServiceGrpc.getPlayAudioMethod) == null) {
|
||||||
|
SpeakerServiceGrpc.getPlayAudioMethod = getPlayAudioMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.SpeakerCommand.PlayAudioCommand.Request, cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "PlayAudio"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.PlayAudioCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new SpeakerServiceMethodDescriptorSupplier("PlayAudio"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getPlayAudioMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.StopSpeakerCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback> getStopPlaybackMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "StopPlayback",
|
||||||
|
requestType = cmvr.api.SpeakerCommand.StopSpeakerCommand.Request.class,
|
||||||
|
responseType = cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.StopSpeakerCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback> getStopPlaybackMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.StopSpeakerCommand.Request, cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback> getStopPlaybackMethod;
|
||||||
|
if ((getStopPlaybackMethod = SpeakerServiceGrpc.getStopPlaybackMethod) == null) {
|
||||||
|
synchronized (SpeakerServiceGrpc.class) {
|
||||||
|
if ((getStopPlaybackMethod = SpeakerServiceGrpc.getStopPlaybackMethod) == null) {
|
||||||
|
SpeakerServiceGrpc.getStopPlaybackMethod = getStopPlaybackMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.SpeakerCommand.StopSpeakerCommand.Request, cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopPlayback"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.StopSpeakerCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new SpeakerServiceMethodDescriptorSupplier("StopPlayback"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStopPlaybackMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback> getPausePlaybackMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "PausePlayback",
|
||||||
|
requestType = cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request.class,
|
||||||
|
responseType = cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback> getPausePlaybackMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request, cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback> getPausePlaybackMethod;
|
||||||
|
if ((getPausePlaybackMethod = SpeakerServiceGrpc.getPausePlaybackMethod) == null) {
|
||||||
|
synchronized (SpeakerServiceGrpc.class) {
|
||||||
|
if ((getPausePlaybackMethod = SpeakerServiceGrpc.getPausePlaybackMethod) == null) {
|
||||||
|
SpeakerServiceGrpc.getPausePlaybackMethod = getPausePlaybackMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request, cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "PausePlayback"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new SpeakerServiceMethodDescriptorSupplier("PausePlayback"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getPausePlaybackMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback> getResumePlaybackMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "ResumePlayback",
|
||||||
|
requestType = cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request.class,
|
||||||
|
responseType = cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback> getResumePlaybackMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request, cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback> getResumePlaybackMethod;
|
||||||
|
if ((getResumePlaybackMethod = SpeakerServiceGrpc.getResumePlaybackMethod) == null) {
|
||||||
|
synchronized (SpeakerServiceGrpc.class) {
|
||||||
|
if ((getResumePlaybackMethod = SpeakerServiceGrpc.getResumePlaybackMethod) == null) {
|
||||||
|
SpeakerServiceGrpc.getResumePlaybackMethod = getResumePlaybackMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request, cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResumePlayback"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new SpeakerServiceMethodDescriptorSupplier("ResumePlayback"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getResumePlaybackMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback> getSetVolumeMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SetVolume",
|
||||||
|
requestType = cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request.class,
|
||||||
|
responseType = cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback> getSetVolumeMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request, cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback> getSetVolumeMethod;
|
||||||
|
if ((getSetVolumeMethod = SpeakerServiceGrpc.getSetVolumeMethod) == null) {
|
||||||
|
synchronized (SpeakerServiceGrpc.class) {
|
||||||
|
if ((getSetVolumeMethod = SpeakerServiceGrpc.getSetVolumeMethod) == null) {
|
||||||
|
SpeakerServiceGrpc.getSetVolumeMethod = getSetVolumeMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request, cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetVolume"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new SpeakerServiceMethodDescriptorSupplier("SetVolume"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetVolumeMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback> getGetVolumeMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetVolume",
|
||||||
|
requestType = cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request.class,
|
||||||
|
responseType = cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback> getGetVolumeMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request, cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback> getGetVolumeMethod;
|
||||||
|
if ((getGetVolumeMethod = SpeakerServiceGrpc.getGetVolumeMethod) == null) {
|
||||||
|
synchronized (SpeakerServiceGrpc.class) {
|
||||||
|
if ((getGetVolumeMethod = SpeakerServiceGrpc.getGetVolumeMethod) == null) {
|
||||||
|
SpeakerServiceGrpc.getGetVolumeMethod = getGetVolumeMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request, cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetVolume"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new SpeakerServiceMethodDescriptorSupplier("GetVolume"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetVolumeMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new async stub that supports all call types for the service
|
||||||
|
*/
|
||||||
|
public static SpeakerServiceStub newStub(io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<SpeakerServiceStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<SpeakerServiceStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public SpeakerServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new SpeakerServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return SpeakerServiceStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||||
|
*/
|
||||||
|
public static SpeakerServiceBlockingStub newBlockingStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<SpeakerServiceBlockingStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<SpeakerServiceBlockingStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public SpeakerServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new SpeakerServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return SpeakerServiceBlockingStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||||
|
*/
|
||||||
|
public static SpeakerServiceFutureStub newFutureStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<SpeakerServiceFutureStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<SpeakerServiceFutureStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public SpeakerServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new SpeakerServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return SpeakerServiceFutureStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static abstract class SpeakerServiceImplBase implements io.grpc.BindableService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStatusMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void playAudio(cmvr.api.SpeakerCommand.PlayAudioCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPlayAudioMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void stopPlayback(cmvr.api.SpeakerCommand.StopSpeakerCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopPlaybackMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void pausePlayback(cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPausePlaybackMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void resumePlayback(cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getResumePlaybackMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 音量控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void setVolume(cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetVolumeMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getVolume(cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetVolumeMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||||
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||||
|
.addMethod(
|
||||||
|
getGetStatusMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback>(
|
||||||
|
this, METHODID_GET_STATUS)))
|
||||||
|
.addMethod(
|
||||||
|
getPlayAudioMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.SpeakerCommand.PlayAudioCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback>(
|
||||||
|
this, METHODID_PLAY_AUDIO)))
|
||||||
|
.addMethod(
|
||||||
|
getStopPlaybackMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.SpeakerCommand.StopSpeakerCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback>(
|
||||||
|
this, METHODID_STOP_PLAYBACK)))
|
||||||
|
.addMethod(
|
||||||
|
getPausePlaybackMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback>(
|
||||||
|
this, METHODID_PAUSE_PLAYBACK)))
|
||||||
|
.addMethod(
|
||||||
|
getResumePlaybackMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback>(
|
||||||
|
this, METHODID_RESUME_PLAYBACK)))
|
||||||
|
.addMethod(
|
||||||
|
getSetVolumeMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback>(
|
||||||
|
this, METHODID_SET_VOLUME)))
|
||||||
|
.addMethod(
|
||||||
|
getGetVolumeMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request,
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback>(
|
||||||
|
this, METHODID_GET_VOLUME)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class SpeakerServiceStub extends io.grpc.stub.AbstractAsyncStub<SpeakerServiceStub> {
|
||||||
|
private SpeakerServiceStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected SpeakerServiceStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new SpeakerServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void playAudio(cmvr.api.SpeakerCommand.PlayAudioCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getPlayAudioMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void stopPlayback(cmvr.api.SpeakerCommand.StopSpeakerCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getStopPlaybackMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void pausePlayback(cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getPausePlaybackMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void resumePlayback(cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getResumePlaybackMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 音量控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void setVolume(cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetVolumeMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getVolume(cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetVolumeMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class SpeakerServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<SpeakerServiceBlockingStub> {
|
||||||
|
private SpeakerServiceBlockingStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected SpeakerServiceBlockingStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new SpeakerServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback getStatus(cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetStatusMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback playAudio(cmvr.api.SpeakerCommand.PlayAudioCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getPlayAudioMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback stopPlayback(cmvr.api.SpeakerCommand.StopSpeakerCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getStopPlaybackMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback pausePlayback(cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getPausePlaybackMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback resumePlayback(cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getResumePlaybackMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 音量控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback setVolume(cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetVolumeMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback getVolume(cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetVolumeMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class SpeakerServiceFutureStub extends io.grpc.stub.AbstractFutureStub<SpeakerServiceFutureStub> {
|
||||||
|
private SpeakerServiceFutureStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected SpeakerServiceFutureStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new SpeakerServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 基本控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback> getStatus(
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback> playAudio(
|
||||||
|
cmvr.api.SpeakerCommand.PlayAudioCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getPlayAudioMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback> stopPlayback(
|
||||||
|
cmvr.api.SpeakerCommand.StopSpeakerCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getStopPlaybackMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback> pausePlayback(
|
||||||
|
cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getPausePlaybackMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback> resumePlayback(
|
||||||
|
cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getResumePlaybackMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 音量控制
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback> setVolume(
|
||||||
|
cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetVolumeMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback> getVolume(
|
||||||
|
cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetVolumeMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int METHODID_GET_STATUS = 0;
|
||||||
|
private static final int METHODID_PLAY_AUDIO = 1;
|
||||||
|
private static final int METHODID_STOP_PLAYBACK = 2;
|
||||||
|
private static final int METHODID_PAUSE_PLAYBACK = 3;
|
||||||
|
private static final int METHODID_RESUME_PLAYBACK = 4;
|
||||||
|
private static final int METHODID_SET_VOLUME = 5;
|
||||||
|
private static final int METHODID_GET_VOLUME = 6;
|
||||||
|
|
||||||
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||||
|
private final SpeakerServiceImplBase serviceImpl;
|
||||||
|
private final int methodId;
|
||||||
|
|
||||||
|
MethodHandlers(SpeakerServiceImplBase serviceImpl, int methodId) {
|
||||||
|
this.serviceImpl = serviceImpl;
|
||||||
|
this.methodId = methodId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_GET_STATUS:
|
||||||
|
serviceImpl.getStatus((cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.GetSpeakerStateCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_PLAY_AUDIO:
|
||||||
|
serviceImpl.playAudio((cmvr.api.SpeakerCommand.PlayAudioCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.PlayAudioCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_STOP_PLAYBACK:
|
||||||
|
serviceImpl.stopPlayback((cmvr.api.SpeakerCommand.StopSpeakerCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.StopSpeakerCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_PAUSE_PLAYBACK:
|
||||||
|
serviceImpl.pausePlayback((cmvr.api.SpeakerCommand.PauseSpeakerCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.PauseSpeakerCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_RESUME_PLAYBACK:
|
||||||
|
serviceImpl.resumePlayback((cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.ResumeSpeakerCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SET_VOLUME:
|
||||||
|
serviceImpl.setVolume((cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.SetSpeakerVolumeCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_GET_VOLUME:
|
||||||
|
serviceImpl.getVolume((cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.SpeakerCommand.GetSpeakerVolumeCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static abstract class SpeakerServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||||
|
SpeakerServiceBaseDescriptorSupplier() {}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||||
|
return cmvr.api.SpeakerServiceOuterClass.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
return getFileDescriptor().findServiceByName("SpeakerService");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class SpeakerServiceFileDescriptorSupplier
|
||||||
|
extends SpeakerServiceBaseDescriptorSupplier {
|
||||||
|
SpeakerServiceFileDescriptorSupplier() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class SpeakerServiceMethodDescriptorSupplier
|
||||||
|
extends SpeakerServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||||
|
private final String methodName;
|
||||||
|
|
||||||
|
SpeakerServiceMethodDescriptorSupplier(String methodName) {
|
||||||
|
this.methodName = methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||||
|
return getServiceDescriptor().findMethodByName(methodName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||||
|
|
||||||
|
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
synchronized (SpeakerServiceGrpc.class) {
|
||||||
|
result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||||
|
.setSchemaDescriptor(new SpeakerServiceFileDescriptorSupplier())
|
||||||
|
.addMethod(getGetStatusMethod())
|
||||||
|
.addMethod(getPlayAudioMethod())
|
||||||
|
.addMethod(getStopPlaybackMethod())
|
||||||
|
.addMethod(getPausePlaybackMethod())
|
||||||
|
.addMethod(getResumePlaybackMethod())
|
||||||
|
.addMethod(getSetVolumeMethod())
|
||||||
|
.addMethod(getGetVolumeMethod())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: cmvr/api/speaker_service.proto
|
||||||
|
|
||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
public final class SpeakerServiceOuterClass {
|
||||||
|
private SpeakerServiceOuterClass() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\036cmvr/api/speaker_service.proto\022\010cmvr.a" +
|
||||||
|
"pi\032\036cmvr/api/speaker_command.proto2\260\005\n\016S" +
|
||||||
|
"peakerService\022`\n\tGetStatus\022(.cmvr.api.Ge" +
|
||||||
|
"tSpeakerStateCommand.Request\032).cmvr.api." +
|
||||||
|
"GetSpeakerStateCommand.Feedback\022T\n\tPlayA" +
|
||||||
|
"udio\022\".cmvr.api.PlayAudioCommand.Request" +
|
||||||
|
"\032#.cmvr.api.PlayAudioCommand.Feedback\022[\n" +
|
||||||
|
"\014StopPlayback\022$.cmvr.api.StopSpeakerComm" +
|
||||||
|
"and.Request\032%.cmvr.api.StopSpeakerComman" +
|
||||||
|
"d.Feedback\022^\n\rPausePlayback\022%.cmvr.api.P" +
|
||||||
|
"auseSpeakerCommand.Request\032&.cmvr.api.Pa" +
|
||||||
|
"useSpeakerCommand.Feedback\022a\n\016ResumePlay" +
|
||||||
|
"back\022&.cmvr.api.ResumeSpeakerCommand.Req" +
|
||||||
|
"uest\032\'.cmvr.api.ResumeSpeakerCommand.Fee" +
|
||||||
|
"dback\022b\n\tSetVolume\022).cmvr.api.SetSpeaker" +
|
||||||
|
"VolumeCommand.Request\032*.cmvr.api.SetSpea" +
|
||||||
|
"kerVolumeCommand.Feedback\022b\n\tGetVolume\022)" +
|
||||||
|
".cmvr.api.GetSpeakerVolumeCommand.Reques" +
|
||||||
|
"t\032*.cmvr.api.GetSpeakerVolumeCommand.Fee" +
|
||||||
|
"dbackb\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
cmvr.api.SpeakerCommand.getDescriptor(),
|
||||||
|
});
|
||||||
|
cmvr.api.SpeakerCommand.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user