Test XML

Text
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML 测试配置文件 -->

<configuration>

  <app>
    <name>demo-service</name>
    <version>1.0.0</version>
    <env>development</env>
    <debug>true</debug>
  </app>

  <server>
    <host>0.0.0.0</host>
    <port>8080</port>
    <contextPath>/api</contextPath>
    <timeout>
      <read unit="ms">5000</read>
      <write unit="ms">5000</write>
    </timeout>
  </server>

  <database type="mysql">
    <host>localhost</host>
    <port>3306</port>
    <name>demo_db</name>
    <username>demo_user</username>
    <password>demo_password</password>
    <pool>
      <maxSize>20</maxSize>
      <minIdle>5</minIdle>
      <maxLifetime>1800000</maxLifetime>
    </pool>
  </database>

  <redis enabled="true">
    <host>127.0.0.1</host>
    <port>6379</port>
    <database>0</database>
    <timeout unit="ms">2000</timeout>
  </redis>

  <features>
    <login enabled="true"/>
    <signup enabled="false"/>
    <experimental>
      <feature>new-ui</feature>
      <feature>fast-sync</feature>
    </experimental>
  </features>

  <logging>
    <level>
      <root>INFO</root>
      <comExample>DEBUG</comExample>
    </level>
    <file enabled="true">
      <path>/var/log/demo-service/app.log</path>
    </file>
  </logging>

  <security>
    <jwt>
      <secret>change-me</secret>
      <expireSeconds>3600</expireSeconds>
    </jwt>
    <cors>
      <allowedOrigins>
        <origin>*</origin>
      </allowedOrigins>
      <allowedMethods>
        <method>GET</method>
        <method>POST</method>
        <method>PUT</method>
        <method>DELETE</method>
      </allowedMethods>
    </cors>
  </security>

  <tasks>
    <task enabled="true">
      <name>daily-cleanup</name>
      <cron>0 0 3 * * ?</cron>
    </task>
    <task enabled="false">
      <name>sync-data</name>
      <cron>0 */10 * * * ?</cron>
    </task>
  </tasks>

</configuration>
1,892 characters92 lines< 5.5 KB