feat(ids): 实现基于Snowflake的分布式ID生成功能

新增rs-snowflake依赖并实现分布式ID生成工具
在utils模块中添加ids子模块,提供业务ID生成与解析功能
替换原有UUID生成方式为分布式ID生成器
This commit is contained in:
2025-09-23 00:22:06 +08:00
parent 89baf9a96b
commit cadd336dee
8 changed files with 102 additions and 4 deletions

View File

@ -17,7 +17,7 @@ pub struct CreateLogInput {
pub async fn create(db: &Db, input: CreateLogInput) -> anyhow::Result<i64> {
let am = request_log::ActiveModel {
id: Default::default(),
id: Set(crate::utils::generate_request_log_id()),
path: Set(input.path),
method: Set(input.method),
request_params: Set(input.request_params),