Files
simapi-cj/src/configurations/SimApiJobOptions.cj
T
2026-08-16 12:46:15 +08:00

66 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* Copyright (c) 2025 SimcuTeam. All rights reserved.
* 移植自 C# 项目 SimApiE:\simcu\simapi-net),遵循 MIT 许可证。
* 对齐 C# 的 Configurations/SimApiJobOptions.cs。
*/
package simapi.configurations
import std.collection.*
/**
* 任务调度服务器配置(对齐 C# SimApiJobServerConfig)。
*/
public class SimApiJobServer {
/**
* 队列(默认 ["default"])。
*/
public var queues: Array<String> = ["default"]
/**
* 工作线程数(默认 5)。
*/
public var workerNum: Int64 = 5
public init() {}
}
/**
* 任务调度相关配置(默认值与 C# 一致)。
*/
public class SimApiJobOptions {
/**
* WebUi 地址,设置为 null 表示不启用(默认 /jobs)。
*/
public var dashboardUrl: ?String = Some("/jobs")
/**
* WebUi 用户(默认 admin)。
*/
public var dashboardAuthUser: String = "admin"
/**
* WebUi 密码(默认 Admin@123!)。
*/
public var dashboardAuthPass: String = "Admin@123!"
/**
* 设置为 null 使用默认 redis 配置。
*/
public var redisConfiguration: ?String = None
/**
* 设置为 null 使用默认 redis 配置。
*/
public var database: ?Int64 = None
/**
* 任务服务器配置(默认 [new()])。
*/
public var servers: ArrayList<SimApiJobServer> = ArrayList<SimApiJobServer>()
public init() {
servers.add(SimApiJobServer())
}
}