Skip to main content

tibba_model_token/
lib.rs

1// Copyright 2025 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};
19
20// ── 充值来源常量 ──────────────────────────────────────────────────────────────
21
22/// 充值来源:购买
23pub const RECHARGE_SOURCE_PURCHASE: i16 = 1;
24/// 充值来源:系统赠送
25pub const RECHARGE_SOURCE_GIFT: i16 = 2;
26/// 充值来源:退款
27pub const RECHARGE_SOURCE_REFUND: i16 = 3;
28/// 充值来源:管理员调整
29pub const RECHARGE_SOURCE_ADMIN: i16 = 4;
30
31// ── 服务类型常量 ──────────────────────────────────────────────────────────────
32
33/// 服务类型:大语言模型
34pub const SERVICE_LLM: &str = "llm";
35/// 服务类型:通用 API 调用
36pub const SERVICE_API: &str = "api";
37/// 服务类型:文件存储
38pub const SERVICE_STORAGE: &str = "storage";
39
40mod account;
41mod key;
42mod price;
43mod recharge;
44mod usage;
45
46pub use account::*;
47pub use key::*;
48pub use price::*;
49pub use recharge::*;
50pub use usage::*;