Browse Source

添加日志,后端配置环境独立

S0025136190 1 year ago
parent
commit
51abe8447e

+ 2 - 1
Backend/sample/src/main/java/com/dji/sample/media/controller/MediaController.java

@@ -34,7 +34,7 @@ public class MediaController implements IHttpMediaService {
     @Override
     public HttpResultResponse mediaFastUpload(String workspaceId, @Valid MediaFastUploadRequest request, HttpServletRequest req, HttpServletResponse rsp) {
         boolean isExist = mediaService.fastUpload(workspaceId, request.getFingerprint());
-
+        log.info("==============mediaFastUpload====================workspaceId:" + workspaceId + "=============isExist:" + isExist);
         return isExist ? HttpResultResponse.success() : HttpResultResponse.error(request.getFingerprint() + "don't exist.");
     }
 
@@ -47,6 +47,7 @@ public class MediaController implements IHttpMediaService {
      */
     @Override
     public HttpResultResponse<String> mediaUploadCallback(String workspaceId, @Valid MediaUploadCallbackRequest request, HttpServletRequest req, HttpServletResponse rsp) {
+        log.info("==============mediaUploadCallback====================workspaceId:" + workspaceId);
         mediaService.saveMediaFile(workspaceId, request);
         return HttpResultResponse.success(request.getObjectKey());
     }

+ 4 - 0
Backend/sample/src/main/java/com/dji/sample/storage/controller/StorageController.java

@@ -4,6 +4,7 @@ import com.dji.sample.storage.service.IStorageService;
 import com.dji.sdk.cloudapi.storage.StsCredentialsResponse;
 import com.dji.sdk.cloudapi.storage.api.IHttpStorageService;
 import com.dji.sdk.common.HttpResultResponse;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -15,6 +16,7 @@ import javax.servlet.http.HttpServletResponse;
  * @version 0.3
  * @date 2021/12/29
  */
+@Slf4j
 @RestController
 public class StorageController implements IHttpStorageService {
 
@@ -28,7 +30,9 @@ public class StorageController implements IHttpStorageService {
      */
     @Override
     public HttpResultResponse<StsCredentialsResponse> getTemporaryCredential(String workspaceId, HttpServletRequest req, HttpServletResponse rsp) {
+
         StsCredentialsResponse stsCredentials = storageService.getSTSCredentials();
+        log.info("==============getTemporaryCredential====================workspaceId:" + workspaceId+ "====stsCredentials:" + stsCredentials.toString());
         return HttpResultResponse.success(stsCredentials);
     }
 }

+ 171 - 0
Backend/sample/src/main/resources/application-test.yml

@@ -0,0 +1,171 @@
+server:
+  port: 6789
+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://60.204.184.98:33308/dji_uas?useSSL=false&allowPublicKeyRetrieval=true
+      username: dji_uas
+      password: AD24cGwazeX5DYeLTaV
+      initial-size: 10
+      min-idle: 10
+      max-active: 20
+      max-wait: 60000
+
+  redis:
+    host: localhost
+    port: 6379
+    database: 0
+    username: # if you enable
+    password:
+    lettuce:
+      pool:
+        max-active: 8
+        max-idle: 8
+        min-idle: 0
+
+  servlet:
+    multipart:
+      max-file-size: 2GB
+      max-request-size: 2GB
+
+jwt:
+  issuer: DJI
+  subject: CloudApiSample
+  secret: CloudApiSample
+  age: 86400
+
+mqtt:
+  # @see com.dji.sample.component.mqtt.model.MqttUseEnum
+  # BASIC parameters are required.
+  BASIC:
+    protocol: MQTT # @see com.dji.sample.component.mqtt.model.MqttProtocolEnum
+    host: xia0miduo.gicp.net
+    port: 1883
+    username: mqttUser
+    password: 123456
+    client-id: testServer
+    # If the protocol is ws/wss, this value is required.
+    path:
+  DRC:
+    protocol: WS # @see com.dji.sample.component.mqtt.model.MqttProtocolEnum
+    host: xia0miduo.gicp.net
+    port: 8083
+    path: /mqtt
+    username: mqttUser
+    password: 123456
+
+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
+
+# Tutorial: https://www.alibabacloud.com/help/en/object-storage-service/latest/use-a-temporary-credential-provided-by-sts-to-access-oss
+#oss:
+#  enable: false
+#  provider: ALIYUN # @see com.dji.sample.component.OssConfiguration.model.enums.OssTypeEnum
+#  endpoint: https://oss-cn-hangzhou.aliyuncs.com
+#  access-key: Please enter your access key.
+#  secret-key: Please enter your secret key.
+#  expire: 3600
+#  region: Please enter your oss region. # cn-hangzhou
+#  role-session-name: cloudApi
+#  role-arn: Please enter your role arn. # acs:ram::123456789:role/stsrole
+#  bucket: Please enter your bucket name.
+#  object-dir-prefix: Please enter a folder name.
+
+#oss:
+#  enable: true
+#  provider: aws
+#  endpoint: https://s3.us-east-1.amazonaws.com
+#  access-key:
+#  secret-key:
+#  expire: 3600
+#  region: us-east-1
+#  role-session-name: cloudApi
+#  role-arn:
+#  bucket: cloudapi-bucket
+#  object-dir-prefix: wayline
+
+oss:
+  enable: true
+  provider: minio
+  endpoint: http://60.204.184.98:39000
+  access-key: dji_minio2
+  secret-key: 12345678
+  bucket: dji-cloudapi
+  expire: 3600
+  region: us-east-1
+  object-dir-prefix: wayline
+
+logging:
+  level:
+    com.dji: info
+  file:
+    name: logs/cloud-api-sample.log
+
+ntp:
+  server:
+    host: Google.mzr.me
+
+# To create a license for an application: https://developer.dji.com/user/apps/#all
+cloud-api:
+  app:
+    id: 146815
+    key: 7c9e9108f2ddcbab32d2b508f452151
+    license: ZK7Dzih4Qc9JCZhDiyDsWJwTW+1rhnnzT1SqDxbdSPVV24bbDC4r1KNjXo7tIPBnPne7ipnXeefP0lJ0OHvxMpkKiag5lFCIndKSvYYdQkyScT3dahCXjmYsd0YyWyHj4tvXoR2DRVq1PdBHLB1iUo2FGLCIZ8QHbGyqglyGdHY=
+
+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: Please enter the agora channel.
+      token: Please enter the agora temporary token.
+      uid:  654321
+
+    # 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: Please enter the rtmp access address.  # 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: Please enter the server port.
+#      serverID: Please enter the server id.
+#      agentID: Please enter the agent id.
+#      agentPassword: Please enter the agent password.
+#      localPort: Please enter the local port.
+#      channel: Please enter the channel.
+
+    # Webrtc: Only supports using whip standard
+    whip:
+      url: Please enter the rtmp access address. #  Example:http://192.168.1.1:1985/rtc/v1/whip/?app=live&stream=

+ 1 - 1
Backend/sample/src/main/resources/application.yml

@@ -2,7 +2,7 @@ server:
   port: 6789
 spring:
   profiles:
-    active: prd
+    active: test
   main:
     allow-bean-definition-overriding: true
   application:

+ 4 - 2
Web/src/api/http/config.ts

@@ -5,8 +5,10 @@ export const CURRENT_CONFIG = {
   appLicense: 'ZK7Dzih4Qc9JCZhDiyDsWJwTW+1rhnnzT1SqDxbdSPVV24bbDC4r1KNjXo7tIPBnPne7ipnXeefP0lJ0OHvxMpkKiag5lFCIndKSvYYdQkyScT3dahCXjmYsd0YyWyHj4tvXoR2DRVq1PdBHLB1iUo2FGLCIZ8QHbGyqglyGdHY=',
   // 网络请求
   baseURL: '/api',
-  apiURL: 'http://192.168.3.42:6789',
-  websocketURL: 'ws://192.168.3.42:6789/api/v1/ws',
+  //apiURL: 'http://192.168.3.42:6789',
+  //websocketURL: 'ws://192.168.3.42:6789/api/v1/ws',
+  apiURL: 'http://49.234.30.234:6789',
+  websocketURL: 'ws://49.234.30.234:6789/api/v1/ws',
   // livestreaming
   // 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.
   rtmpURL: 'Please enter the rtmp access address.', // Example: 'rtmp://192.168.1.1/live/'

+ 36 - 0
Web/src/components/devices/feedbackRecord/components/Drawer.vue

@@ -0,0 +1,36 @@
+<template>
+    <a-drawer :width="800" title="详情" placement="right" v-model:visible="visible" @close="onClose">
+        详情
+    </a-drawer>
+</template>
+
+<script lang="ts" setup>
+import { reactive, onMounted } from 'vue'
+import { apis } from '/@/api/custom/index'
+
+interface Props {
+    id: string,
+    visible: boolean,
+    onClose: () => void,
+};
+
+const props = withDefaults(defineProps<Props>(), {
+
+});
+
+interface State {
+    listLoading: boolean,
+    list: any[],
+};
+
+const state: State = reactive({
+    listLoading: false,
+    list: [],
+});
+
+onMounted(async () => {
+
+})
+</script>
+
+<style lang="scss" scoped></style>