liusuyi
2025-09-30 846c1855c8984d14356f6846ec35504c229412fb
优化
5 files modified
74 ■■■■■ changed files
ard-admin/src/main/java/com/ard/ArdUavApplication.java 2 ●●●●● patch | view | raw | blame | history
ard-admin/src/main/java/com/ard/web/core/config/SwaggerConfig.java 19 ●●●●● patch | view | raw | blame | history
ard-admin/src/main/resources/application.yml 49 ●●●●● patch | view | raw | blame | history
ard-admin/src/main/resources/logback.xml 2 ●●●●● patch | view | raw | blame | history
ard-work/src/main/resources/mapper/UavWaylineMapper.xml 2 ●●●●● patch | view | raw | blame | history
ard-admin/src/main/java/com/ard/ArdUavApplication.java
@@ -16,7 +16,7 @@
{
    public static void main(String[] args)
    {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(ArdUavApplication.class, args);
        System.out.println("(♥◠‿◠)ノ゙  智云 [3.0] 平台启动成功   ლ(´ڡ`ლ)゙  \n" +
                "      ___           ___                               \n" +
ard-admin/src/main/java/com/ard/web/core/config/SwaggerConfig.java
@@ -110,6 +110,25 @@
                .securitySchemes(securitySchemes())
                .securityContexts(securityContexts());
    }
    @Bean
    public Docket deviceApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .enable(true)
                .groupName("设备接口")   // 分组名
                .apiInfo(apiInfo("设备管理接口"))
                .select()
                // 扫描指定包下,但只扫描加了 @ApiOperation 注解的方法
                .apis(requestHandler ->
                        requestHandler.declaringClass().getPackage().getName().startsWith("com.ard.web.controller" +
                                ".device") &&
                                requestHandler.isAnnotatedWith(io.swagger.annotations.ApiOperation.class)
                )
                .paths(PathSelectors.any())
                .build()
                /* 设置安全模式,swagger可以设置访问token */
                .securitySchemes(securitySchemes())
                .securityContexts(securityContexts());
    }
    /**
     * 安全模式,这里指定token通过Authorization头请求头传递
     */
ard-admin/src/main/resources/application.yml
@@ -91,6 +91,21 @@
  log-response-content: true   # 打开/关闭Forest响应内容日志(默认为 false)
  async-mode: platform         # [自v1.5.27版本起可用] 异步模式(默认为 platform)
# 服务端点检查
management:
  endpoints:
    web:
      exposure:
        include: health,info,logfile,loggers
  endpoint:
    info:
      enabled: true
    health:
      enabled: true
      show-details: always
    logfile:
      external-file: logs/info.log
# Spring配置
spring:
  application:
@@ -133,16 +148,7 @@
        max-active: 8
        # #连接池最大阻塞等待时间(使用负值表示没有限制)
        max-wait: -1ms
  jackson:
    property-naming-strategy: SNAKE_CASE
    date-format: yyyy-MM-dd HH:mm:ss
    default-property-inclusion: NON_NULL
    deserialization:
      FAIL_ON_UNKNOWN_PROPERTIES: false
  # 激活配置文件
  profiles:
    # active: prod-druid,prod
    active: dev-druid,dev
  #健康监控
  boot:
    admin:
@@ -150,18 +156,13 @@
        url: http://127.0.0.1:9100
        username: admin
        password: admin
        instance:
          name: ard-uav
          management-url: http://127.0.0.1:8080/actuator
          service-url: http://127.0.0.1:8080/
# 服务端点检查
management:
  endpoints:
    web:
      exposure:
        include: health,info,logfile,loggers
  endpoint:
    info:
      enabled: true
    health:
      enabled: true
      show-details: always
    logfile:
      external-file: logs/${spring.application.name}/info.log
  # 激活配置文件
  profiles:
    #active: prod-druid,prod
    active: dev-druid,dev
ard-admin/src/main/resources/logback.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
    <!-- 日志存放路径 -->
    <property name="log.path" value="logs/ard-uav" />
    <property name="log.path" value="logs" />
    <!-- 日志输出格式 -->
    <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
ard-work/src/main/resources/mapper/UavWaylineMapper.xml
@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ard.tianyu.mapper.UavWaylineMapper">
<mapper namespace="com.ard.work.mapper.UavWaylineMapper">
    
    <resultMap type="UavWayline" id="UavWaylineResult">
        <result property="id"    column="id"    />