tibba_model_token/lib.rs
1// Copyright 2026 Tree xie.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15pub(crate) use tibba_model::{
16 Error, JsonSnafu, ModelListParams, Schema, SchemaAllowCreate, SchemaAllowEdit, SchemaOption,
17 SchemaOptionValue, SchemaType, SchemaView, SqlxSnafu, Status, format_datetime,
18 new_schema_options,
19};
20
21// ── 充值来源常量 ──────────────────────────────────────────────────────────────
22
23/// 充值来源:购买
24pub const RECHARGE_SOURCE_PURCHASE: i16 = 1;
25/// 充值来源:系统赠送
26pub const RECHARGE_SOURCE_GIFT: i16 = 2;
27/// 充值来源:退款
28pub const RECHARGE_SOURCE_REFUND: i16 = 3;
29/// 充值来源:管理员调整
30pub const RECHARGE_SOURCE_ADMIN: i16 = 4;
31
32// ── 服务类型常量 ──────────────────────────────────────────────────────────────
33
34/// 服务类型:大语言模型
35pub const SERVICE_LLM: &str = "llm";
36/// 服务类型:通用 API 调用
37pub const SERVICE_API: &str = "api";
38/// 服务类型:文件存储
39pub const SERVICE_STORAGE: &str = "storage";
40
41mod account;
42mod key;
43mod llm;
44mod price;
45mod recharge;
46mod service;
47mod usage;
48
49pub use account::*;
50pub use key::*;
51pub use llm::*;
52pub use price::*;
53pub use recharge::*;
54pub use service::*;
55pub use usage::*;