Browse Source

提交

pull/1/head
袁强 6 months ago
parent
commit
c32d9a336f
  1. 9
      dk-modules/sample/pom.xml
  2. 9
      dk-modules/sample/src/main/java/org/dromara/sample/CloudApiSampleApplication.java
  3. 1
      dk-modules/sample/src/main/java/org/dromara/sample/control/model/param/DrcModeParam.java
  4. 3
      dk-modules/sample/src/main/java/org/dromara/sample/map/model/param/SyncFlightAreaParam.java
  5. 2
      dk-modules/sample/src/main/java/org/dromara/sample/wayline/controller/WaylineJobController.java
  6. 132
      dk-modules/sample/src/main/resources/application.yml
  7. 28
      dk-modules/sample/src/main/resources/logback-plus.xml

9
dk-modules/sample/pom.xml

@ -108,6 +108,10 @@
<groupId>org.dromara</groupId>
<artifactId>api-resource</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>api-resource</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>common-websocket</artifactId>
@ -122,7 +126,10 @@
<groupId>org.dromara</groupId>
<artifactId>common-oss</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>common-web</artifactId>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>

9
dk-modules/sample/src/main/java/org/dromara/sample/CloudApiSampleApplication.java

@ -1,15 +1,16 @@
package org.dromara.sample;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
@MapperScan("org.dromara.sample.*.dao")
@SpringBootApplication
@EnableScheduling
@ComponentScan("com.dji")
@EnableDubbo
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class CloudApiSampleApplication {
public static void main(String[] args) {

1
dk-modules/sample/src/main/java/org/dromara/sample/control/model/param/DrcModeParam.java

@ -7,6 +7,7 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dromara.common.redis.config.RedisConst;
import org.hibernate.validator.constraints.Range;

3
dk-modules/sample/src/main/java/org/dromara/sample/map/model/param/SyncFlightAreaParam.java

@ -3,7 +3,8 @@ package org.dromara.sample.map.model.param;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotNull;
import java.util.List;
/**

2
dk-modules/sample/src/main/java/org/dromara/sample/wayline/controller/WaylineJobController.java

@ -55,7 +55,7 @@ public class WaylineJobController {
*/
@GetMapping("/jobs")
public HttpResultResponse<PaginationData<WaylineJobDTO>> getJobs(@RequestParam(defaultValue = "1") Long page,
@RequestParam(name = "page_size", defaultValue = "10") Long pageSize,) {
@RequestParam(name = "page_size", defaultValue = "10") Long pageSize) {
LoginUser loginUser = LoginHelper.getLoginUser();
PaginationData<WaylineJobDTO> data = waylineJobService.getJobsByWorkspaceId(loginUser.getTenantId(), page, pageSize);
return HttpResultResponse.success(data);

132
dk-modules/sample/src/main/resources/application.yml

@ -1,116 +1,38 @@
server:
port: 6789
# Spring
spring:
main:
allow-bean-definition-overriding: true
application:
name: cloud-api-sample
datasource:
druid:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3307/cloud_sample?useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
initial-size: 10
min-idle: 10
max-active: 20
max-wait: 60000
# 应用名称
name: cloud-sample
profiles:
# 环境配置
active: @profiles.active@
servlet:
multipart:
max-file-size: 2GB
max-request-size: 2GB
mqtt:
# @see org.dromara.sample.component.mqtt.model.MqttUseEnum
# BASIC parameters are required.
BASIC:
protocol: MQTT # @see org.dromara.sample.component.mqtt.model.MqttProtocolEnum
host: 114.235.183.162
port: 1883
username: adminPCBASIC
password: yongqiang666
client-id: gengbao1
# If the protocol is ws/wss, this value is required.
path:
DRC:
protocol: WS # @see org.dromara.sample.component.mqtt.model.MqttProtocolEnum
host: 114.235.183.162
port: 8083
path: /mqtt
username: adminPCDRC
password: yongqiang666
cloud-sdk:
mqtt:
# Topics that need to be subscribed when initially connecting to mqtt, multiple topics are divided by ",".
inbound-topic: sys/product/+/status,thing/product/+/requests
url:
manage:
prefix: manage
version: /api/v1
map:
prefix: map
version: /api/v1
media:
prefix: media
version: /api/v1
wayline:
prefix: wayline
version: /api/v1
storage:
prefix: storage
version: /api/v1
control:
prefix: control
version: /api/v1
logging:
level:
com.dji: debug
file:
name: logs/cloud-api-sample.log
ntp:
server:
host: ntp.aliyun.com
# To create a license for an application: https://developer.dji.com/user/apps/#all
cloud-api:
app:
id: 125297
key: 182ae1ca69d9ba5103c0148bf16d68b
license: FixRisR747uGMZwaNbgCAWZojgrcUgZB1qhRyMTtptyKPKI/uETVwMK41HikhP+wbCjSKODdaQH4JIGAvzxdN/4HMrsEj3srLyGXi+BeJyFNyi94mpprv1Cx59fknCrBexAxLoc3f9GcgojEWrB0wCYxGp7l8mulwSDMP5yl++w=
livestream:
url:
# It is recommended to use a program to create Token. https://github.com/AgoraIO/Tools/blob/master/DynamicKey/AgoraDynamicKey/java/src/main/java/io/agora/media/RtcTokenBuilder2.java
agora:
channel: cloud
token: 007eJxTYBBinhSg416uaGdw6G9J4bSDxYZ/mTm5HErajtq2+j09r6bAYGpinGKUkphokmYMxBZJiebJqWYGaanJyUnG5haGyda/RNMaAhkZNp5YxcrIAIEgPitDck5+aQoDAwC1CB6R
uid: 65432
--- # nacos 配置
spring:
cloud:
nacos:
# nacos 服务地址
server-addr: @nacos.server@
username: @nacos.username@
password: @nacos.password@
discovery:
# 注册组
group: @nacos.discovery.group@
namespace: ${spring.profiles.active}
config:
# 配置组
group: @nacos.config.group@
namespace: ${spring.profiles.active}
config:
import:
- optional:nacos:application-common.yml
- optional:nacos:datasource.yml
- optional:nacos:${spring.application.name}.yml
# RTMP Note: This IP is the address of the streaming server. If you want to see livestream on web page, you need to convert the RTMP stream to WebRTC stream.
rtmp:
url: rtmp://114.235.183.163/live/livesteam/ # Example: 'rtmp://192.168.1.1/live/'
rtsp:
username: Please enter the username.
password: Please enter the password.
port: 8554
# GB28181 Note:If you don't know what these parameters mean, you can go to Pilot2 and select the GB28181 page in the cloud platform. Where the parameters same as these parameters.
gb28181:
serverIP: Please enter the server ip.
serverPort: 7788
serverID: Please enter the server id.
agentID: Please enter the agent id.
agentPassword: Please enter the agent password.
localPort: 7788
channel: Please enter the channel.
# Webrtc: Only supports using whip standard
whip:
url: http://114.235.183.163:1985/rtc/v1/whip/?app=live/livesteam&stream= # Example:http://192.168.1.1:1985/rtc/v1/whip/?app=live&stream=

28
dk-modules/sample/src/main/resources/logback-plus.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/${project.artifactId}"/>
<!-- 日志输出格式 -->
<property name="console.log.pattern"
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${console.log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<include resource="logback-common.xml" />
<include resource="logback-logstash.xml" />
<!-- 开启 skywalking 日志收集 -->
<include resource="logback-skylog.xml" />
<!--系统操作日志-->
<root level="info">
<appender-ref ref="console"/>
</root>
</configuration>
Loading…
Cancel
Save