File size: 2,319 Bytes
842b5ee
ff0163b
3dcffd6
ff0163b
 
 
 
842b5ee
ff0163b
 
 
 
 
3dcffd6
 
842b5ee
3dcffd6
ff0163b
3dcffd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff0163b
3dcffd6
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# coding=utf-8
packages = [
    {
        'id': '1',
        'title': '基础套餐(推荐)',
        'basic_chat_limit': 10,
        'advanced_chat_limit': 10,
        'price': 1,  # 以分计算
        'expiration': -1
    },
    {
        'id': '2',
        'title': '高级套餐',
        'basic_chat_limit': -1,  # -1 表示无限次
        'advanced_chat_limit': -1,
        'price': 100,   # 以分计算
        'expiration': -1
    }
]


test_packages = [{
    "id": 8,
    "uuid": "3a07df99-e0d7-4855-835d-ff957e118946",
    "title": "李振超级无敌套餐",
    "subTitle": "",
                "tokens": -1,
                "chatCount": -1,
                "advancedChatCount": -1,
                "drawCount": -1,
                "days": 99999,
                "state": 10,
                "calcTypeId": 2,
                "calcType": "Daily",
                "price": 9999.00,
                "top": 0,
                "createTime": "2023-07-03 22:54:22",
                "updateTime": "2023-07-03 22:54:27"
}, {
    "id": 9,
    "uuid": "b2cadc5e-0a18-4aef-99c5-8375f5867534",
    "title": "X套餐",
    "subTitle": "",
                "tokens": 10000,
                "chatCount": 0,
                "advancedChatCount": 0,
                "drawCount": 0,
                "days": 30,
                "state": 10,
                "calcTypeId": 1,
                "calcType": "Total",
                "price": 10.00,
                "top": 0,
                "createTime": "2023-07-14 22:01:54",
                "updateTime": "2023-07-14 22:02:07"
}, {
    "id": 10,
    "uuid": "e1623644-caf0-43a2-a298-9894a68290a3",
    "title": "小时套餐",
    "subTitle": "小时套餐",
                "tokens": 0,
                "chatCount": 2,
                "advancedChatCount": 0,
                "drawCount": 0,
                "days": 31,
                "state": 10,
                "calcTypeId": 4,
                "calcType": "ThreeHourly",
                "price": 0.01,
                "top": 0,
                "createTime": "2023-07-23 12:55:30",
                "updateTime": "2023-07-23 12:55:33"
}]


# 根据套餐ID获取套餐信息
def get_package_by_id(package_id):
    for package in packages:
        if package['id'] == package_id:
            return package
    return None