diff --git a/.env b/.env deleted file mode 100644 index de606ef..0000000 --- a/.env +++ /dev/null @@ -1,21 +0,0 @@ -# 数据库配置 -DB_USER=postgres -DB_PASSWORD=postgres12341234 -DB_NAME=postgres -DB_PORT=5432 -DB_SSL_MODE=disable -DB_MAX_OPEN_CONNS=25 -DB_MAX_IDLE_CONNS=25 -DB_TIMEOUT=30s - -# 时区配置 -TZ=Asia/Shanghai - -# 网关端口 -PORT=80 - -# 日志配置 -LOG_LEVEL=info - -# Gin模式 (debug/release/test) -GIN_MODE=release \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index a16bc2d..6e9a61e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -19,7 +19,7 @@ services: - ai-trading-network cn_futures_trading_records: - image: rust:1.92.0-alpine3.23 + build: services/cn_futures_trading_records container_name: cn_futures_trading_records_api restart: always ports: @@ -32,6 +32,7 @@ services: DATABASE_URL: postgres://postgres:postgres12341234@postgres:5432/postgres RUST_LOG: info TZ: Asia/Shanghai + networks: ai-trading-network: driver: bridge diff --git a/services/cn_futures_trading_records/Cargo.toml b/services/cn_futures_trading_records/Cargo.toml new file mode 100644 index 0000000..c5e6bf8 --- /dev/null +++ b/services/cn_futures_trading_records/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "cn_futures_trading_records" +version = "1.0.0" +edition = "2025" + +[dependencies] +axum = "0.7" +tokio = { version = "1", features = ["full"] } +sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "uuid"] } +uuid = { version = "1", features = ["v4"] } +serde = { version = "1", features = ["derive"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +anyhow = "1" \ No newline at end of file diff --git a/services/cn_futures_trading_records/Dockerfile b/services/cn_futures_trading_records/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/services/cn_futures_trading_records/README.md b/services/cn_futures_trading_records/README.md new file mode 100644 index 0000000..e69de29 diff --git a/services/cn_futures_trading_records/src/main.rs b/services/cn_futures_trading_records/src/main.rs new file mode 100644 index 0000000..e69de29