xtn-tools-pro 1.0.0.9.0__py3-none-any.whl → 1.0.0.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xtn_tools_pro/flask_demo/cli.py +6 -6
- xtn_tools_pro/flask_demo/templates/.gitignore +0 -0
- xtn_tools_pro/flask_demo/templates/Dockerfile +15 -0
- xtn_tools_pro/flask_demo/templates/README.md +0 -0
- xtn_tools_pro/flask_demo/templates/app/api/__init__.py +10 -0
- xtn_tools_pro/flask_demo/templates/app/api/v1/__init__.py +13 -0
- xtn_tools_pro/flask_demo/templates/app/api/v1/demo.py +21 -0
- xtn_tools_pro/flask_demo/templates/app/config/__init__.py +10 -0
- xtn_tools_pro/flask_demo/templates/app/config/secure.py +13 -0
- xtn_tools_pro/flask_demo/templates/app/config/setting.py +4 -0
- xtn_tools_pro/flask_demo/templates/app/libs/__init__.py +10 -0
- xtn_tools_pro/flask_demo/templates/app/libs/base.py +7 -0
- xtn_tools_pro/flask_demo/templates/app/libs/error.py +49 -0
- xtn_tools_pro/flask_demo/templates/app/libs/error_code.py +48 -0
- xtn_tools_pro/flask_demo/templates/app/libs/redprint.py +21 -0
- xtn_tools_pro/flask_demo/templates/app/libs/token_auth.py +37 -0
- xtn_tools_pro/flask_demo/templates/app/models/__init__.py +10 -0
- xtn_tools_pro/flask_demo/templates/app/models/base.py +19 -0
- xtn_tools_pro/flask_demo/templates/app/models/redis_demo.py +17 -0
- xtn_tools_pro/flask_demo/templates/app/validators/__init__.py +10 -0
- xtn_tools_pro/flask_demo/templates/app/validators/base.py +65 -0
- xtn_tools_pro/flask_demo/templates/app/validators/demo.py +16 -0
- xtn_tools_pro/flask_demo/templates/docker-compose.yml +20 -0
- xtn_tools_pro/flask_demo/templates/logs/__init__.py +10 -0
- xtn_tools_pro/flask_demo/templates/obj/__init__.py +10 -0
- xtn_tools_pro/flask_demo/templates/requirements.txt +14 -0
- xtn_tools_pro/flask_demo/templates/test/__init__.py +10 -0
- xtn_tools_pro/flask_demo/templates/uwsgi.ini +28 -0
- {xtn_tools_pro-1.0.0.9.0.dist-info → xtn_tools_pro-1.0.0.9.1.dist-info}/METADATA +1 -1
- xtn_tools_pro-1.0.0.9.1.dist-info/RECORD +68 -0
- xtn_tools_pro-1.0.0.9.0.dist-info/RECORD +0 -41
- {xtn_tools_pro-1.0.0.9.0.dist-info → xtn_tools_pro-1.0.0.9.1.dist-info}/LICENSE +0 -0
- {xtn_tools_pro-1.0.0.9.0.dist-info → xtn_tools_pro-1.0.0.9.1.dist-info}/WHEEL +0 -0
- {xtn_tools_pro-1.0.0.9.0.dist-info → xtn_tools_pro-1.0.0.9.1.dist-info}/entry_points.txt +0 -0
- {xtn_tools_pro-1.0.0.9.0.dist-info → xtn_tools_pro-1.0.0.9.1.dist-info}/top_level.txt +0 -0
xtn_tools_pro/flask_demo/cli.py
CHANGED
@@ -41,15 +41,15 @@ def create_project(args):
|
|
41
41
|
|
42
42
|
# 复制模板文件到项目目录
|
43
43
|
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
|
44
|
-
print("template_dir", template_dir)
|
45
|
-
print("project_dir", project_dir)
|
44
|
+
# print("template_dir", template_dir)
|
45
|
+
# print("project_dir", project_dir)
|
46
46
|
for item in os.listdir(template_dir):
|
47
47
|
src = os.path.join(template_dir, item)
|
48
48
|
dst = os.path.join(project_dir, item)
|
49
|
-
print("item", item)
|
50
|
-
print("src", src)
|
51
|
-
print("dst", dst)
|
52
|
-
print("==========================")
|
49
|
+
# print("item", item)
|
50
|
+
# print("src", src)
|
51
|
+
# print("dst", dst)
|
52
|
+
# print("==========================")
|
53
53
|
|
54
54
|
if os.path.isdir(src):
|
55
55
|
shutil.copytree(src, dst) # 判断是否为目录,递归地复制整个目录树
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# 使用自定义的python-environment:1.0作为基础镜像
|
2
|
+
FROM python:3.8
|
3
|
+
|
4
|
+
# 设置工作目录
|
5
|
+
WORKDIR /app
|
6
|
+
|
7
|
+
# 复制应用代码到容器中
|
8
|
+
COPY . /app
|
9
|
+
|
10
|
+
# 安装应用所需的依赖
|
11
|
+
RUN pip install -r requirements.txt
|
12
|
+
|
13
|
+
# 启动应用
|
14
|
+
CMD ["uwsgi", "--ini","uwsgi.ini"]
|
15
|
+
#CMD ["python", "{{ project_name }}.py"]
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# 说明:
|
5
|
+
# 程序说明xxxxxxxxxxxxxxxxxxx
|
6
|
+
# History:
|
7
|
+
# Date Author Version Modification
|
8
|
+
# --------------------------------------------------------------------------------------------------
|
9
|
+
# 2025/3/13 xiatn V00.01.000 新建
|
10
|
+
# --------------------------------------------------------------------------------------------------
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
from app.libs.redprint import Redprint
|
4
|
+
from app.libs.token_auth import user_auth
|
5
|
+
from app.libs.error_code import Success200
|
6
|
+
from app.validators.ios import UpdateDataFileValidatorsForm
|
7
|
+
|
8
|
+
obj = "demo"
|
9
|
+
api = Redprint(obj)
|
10
|
+
|
11
|
+
|
12
|
+
@api.route("/pro", methods=["POST"])
|
13
|
+
@user_auth.login_required
|
14
|
+
def ai_pro():
|
15
|
+
form = UpdateDataFileValidatorsForm().validate_for_api()
|
16
|
+
xxxxx = form.xxxxx.data
|
17
|
+
return Success200(data=xxxxx)
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# 说明:
|
5
|
+
# 程序说明xxxxxxxxxxxxxxxxxxx
|
6
|
+
# History:
|
7
|
+
# Date Author Version Modification
|
8
|
+
# --------------------------------------------------------------------------------------------------
|
9
|
+
# 2025/3/13 xiatn V00.01.000 新建
|
10
|
+
# --------------------------------------------------------------------------------------------------
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
DEBUG = True
|
5
|
+
|
6
|
+
SECRET_KEY = "6d9d1e582d50eb948fa9b6"
|
7
|
+
|
8
|
+
# redis
|
9
|
+
REDIS_01_URL = 'redis://:密码@ip:端口/0'
|
10
|
+
REDIS_02_URL = 'redis://:密码@ip:端口/1'
|
11
|
+
|
12
|
+
# mongo
|
13
|
+
MONGO_URI_01 = "mongodb://用户名:密码@ip:端口/库?authSource=admin"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# 说明:
|
5
|
+
# 程序说明xxxxxxxxxxxxxxxxxxx
|
6
|
+
# History:
|
7
|
+
# Date Author Version Modification
|
8
|
+
# --------------------------------------------------------------------------------------------------
|
9
|
+
# 2025/3/13 xiatn V00.01.000 新建
|
10
|
+
# --------------------------------------------------------------------------------------------------
|
@@ -0,0 +1,49 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
from flask import request, json
|
5
|
+
from werkzeug.exceptions import HTTPException
|
6
|
+
from xtn_tools_pro.utils.time_utils import get_time_now_timestamp
|
7
|
+
|
8
|
+
class APIException(HTTPException):
|
9
|
+
code = 500
|
10
|
+
msg = 'sorry, we made a mistake'
|
11
|
+
error_code = 5000
|
12
|
+
data = {}
|
13
|
+
data_type = "dict"
|
14
|
+
|
15
|
+
def __init__(self, msg=None, code=None, error_code=None, headers=None, data=None, data_type=None):
|
16
|
+
if code:
|
17
|
+
self.code = code
|
18
|
+
if error_code:
|
19
|
+
self.error_code = error_code
|
20
|
+
if msg:
|
21
|
+
self.msg = msg
|
22
|
+
if data:
|
23
|
+
self.data = data
|
24
|
+
if data_type == "list" and not data:
|
25
|
+
self.data = []
|
26
|
+
super(APIException, self).__init__(msg, None)
|
27
|
+
|
28
|
+
def get_body(self, environ=None, scope=None):
|
29
|
+
# 重写 父类的get_body
|
30
|
+
body = dict(
|
31
|
+
msg=self.msg,
|
32
|
+
error_code=self.error_code,
|
33
|
+
code=self.code,
|
34
|
+
request=request.method + ' ' + self.get_url_no_param(),
|
35
|
+
data=self.data,
|
36
|
+
timestamp=get_time_now_timestamp(is_time_13=True)
|
37
|
+
)
|
38
|
+
text = json.dumps(body)
|
39
|
+
return text
|
40
|
+
|
41
|
+
def get_headers(self, environ=None, scope=None):
|
42
|
+
"""Get a list of headers."""
|
43
|
+
return [('Content-Type', 'application/json')]
|
44
|
+
|
45
|
+
@staticmethod
|
46
|
+
def get_url_no_param():
|
47
|
+
full_path = str(request.full_path)
|
48
|
+
main_path = full_path.split('?')
|
49
|
+
return main_path[0]
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
from app.libs.error import APIException
|
5
|
+
|
6
|
+
|
7
|
+
class ServerError500(APIException):
|
8
|
+
code = 500
|
9
|
+
error_code = 5000
|
10
|
+
msg = 'sorry, we made a mistake (* ̄︶ ̄)!'
|
11
|
+
|
12
|
+
|
13
|
+
class Success200(APIException):
|
14
|
+
# 成功
|
15
|
+
code = 200
|
16
|
+
error_code = 2000
|
17
|
+
msg = "成功"
|
18
|
+
|
19
|
+
|
20
|
+
class NotFound400(APIException):
|
21
|
+
code = 400
|
22
|
+
error_code = 4000
|
23
|
+
msg = '资源未找到'
|
24
|
+
|
25
|
+
|
26
|
+
class ParameterException(NotFound400):
|
27
|
+
msg = '无效的参数'
|
28
|
+
error_code = 4001
|
29
|
+
|
30
|
+
|
31
|
+
class MethodException(NotFound400):
|
32
|
+
msg = '请求的URL不允许使用该方法'
|
33
|
+
error_code = 4002
|
34
|
+
|
35
|
+
|
36
|
+
class TokenException(NotFound400):
|
37
|
+
msg = 'token认证不通过'
|
38
|
+
error_code = 4003
|
39
|
+
|
40
|
+
|
41
|
+
class Error600(APIException):
|
42
|
+
code = 600
|
43
|
+
error_code = 6000
|
44
|
+
msg = '未知错误'
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
class Redprint:
|
5
|
+
def __init__(self, name):
|
6
|
+
self.name = name
|
7
|
+
self.mound = []
|
8
|
+
|
9
|
+
def route(self, rule, **options):
|
10
|
+
def decorator(f):
|
11
|
+
self.mound.append((f, rule, options))
|
12
|
+
return f
|
13
|
+
|
14
|
+
return decorator
|
15
|
+
|
16
|
+
def register(self, bp, url_prefix=None):
|
17
|
+
if url_prefix is None:
|
18
|
+
url_prefix = '/' + self.name
|
19
|
+
for f, rule, options in self.mound:
|
20
|
+
endpoint = self.name + '+' + options.pop("endpoint", f.__name__)
|
21
|
+
bp.add_url_rule(url_prefix + rule, endpoint, f, **options)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
import jwt
|
4
|
+
from flask import current_app, g
|
5
|
+
from app.models.base import logger
|
6
|
+
from app.models.user import UserDB
|
7
|
+
from flask_httpauth import HTTPBasicAuth
|
8
|
+
from app.libs.error_code import TokenException
|
9
|
+
|
10
|
+
user_auth = HTTPBasicAuth()
|
11
|
+
|
12
|
+
|
13
|
+
@user_auth.verify_password
|
14
|
+
def user_verify_password(token, password):
|
15
|
+
user_info = verify_user_auth_token(token)
|
16
|
+
# print(user_info)
|
17
|
+
if not user_info:
|
18
|
+
# token验证不通过
|
19
|
+
raise TokenException()
|
20
|
+
# token验证通过
|
21
|
+
g.user = user_info
|
22
|
+
return True
|
23
|
+
|
24
|
+
|
25
|
+
def verify_user_auth_token(token):
|
26
|
+
secret_key = current_app.config['SECRET_KEY']
|
27
|
+
try:
|
28
|
+
payload = jwt.decode(token, secret_key, algorithms=["HS256"])
|
29
|
+
# print("payload",payload)
|
30
|
+
if not payload:
|
31
|
+
logger.critical(f"验证身份失败")
|
32
|
+
return
|
33
|
+
logger.debug(f"验证身份成功,{payload},{token}")
|
34
|
+
return payload
|
35
|
+
except Exception as e:
|
36
|
+
logger.critical(f"验证身份失败,{e}")
|
37
|
+
return
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# 说明:
|
5
|
+
# 程序说明xxxxxxxxxxxxxxxxxxx
|
6
|
+
# History:
|
7
|
+
# Date Author Version Modification
|
8
|
+
# --------------------------------------------------------------------------------------------------
|
9
|
+
# 2025/3/13 xiatn V00.01.000 新建
|
10
|
+
# --------------------------------------------------------------------------------------------------
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
from flask_pymongo import PyMongo
|
5
|
+
from flask_redis import FlaskRedis
|
6
|
+
|
7
|
+
|
8
|
+
def get_init_log():
|
9
|
+
from xtn_tools_pro.utils.log import Log
|
10
|
+
logger = Log('{{ project_name }}', './xxx.log', log_level='DEBUG', is_write_to_console=True,
|
11
|
+
is_write_to_file=True,
|
12
|
+
color=True, mode='a', save_time_log_path='./logs')
|
13
|
+
return logger
|
14
|
+
|
15
|
+
|
16
|
+
redis_db_01 = FlaskRedis(decode_responses=True, config_prefix="REDIS_01") # decode_responses=True:连接redis存的数据是字符串格式
|
17
|
+
redis_db_02 = FlaskRedis(decode_responses=True, config_prefix="REDIS_02") # decode_responses=True:连接redis存的数据是字符串格式
|
18
|
+
mongo_db_01 = PyMongo()
|
19
|
+
logger = get_init_log()
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import json
|
2
|
+
from app.models.base import redis_db_01
|
3
|
+
|
4
|
+
|
5
|
+
class UserDB:
|
6
|
+
@staticmethod
|
7
|
+
def get_user_info(user_name):
|
8
|
+
"""
|
9
|
+
根据用户名获取结果
|
10
|
+
:param order_id:
|
11
|
+
:return:
|
12
|
+
"""
|
13
|
+
key = f"user:{user_name}"
|
14
|
+
user_info = redis_db_01.get(key)
|
15
|
+
if user_info:
|
16
|
+
return True
|
17
|
+
return False
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# 说明:
|
5
|
+
# 程序说明xxxxxxxxxxxxxxxxxxx
|
6
|
+
# History:
|
7
|
+
# Date Author Version Modification
|
8
|
+
# --------------------------------------------------------------------------------------------------
|
9
|
+
# 2025/3/13 xiatn V00.01.000 新建
|
10
|
+
# --------------------------------------------------------------------------------------------------
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
import json
|
4
|
+
import random
|
5
|
+
from wtforms import Form
|
6
|
+
from flask import request
|
7
|
+
from app.libs.error_code import ValidatorsErrorException
|
8
|
+
|
9
|
+
|
10
|
+
class BaseForm(Form):
|
11
|
+
def __init__(self, formdata=None, obj=None, prefix='', data=None, meta=None, **kwargs):
|
12
|
+
# 合并请求中的数据
|
13
|
+
request_data = request.get_json(silent=True) or {}
|
14
|
+
values = request.values.to_dict()
|
15
|
+
args = request.args.to_dict()
|
16
|
+
file_args = request.files.to_dict()
|
17
|
+
|
18
|
+
combined_data = {}
|
19
|
+
combined_data.update(self.validate_data_type(request_data))
|
20
|
+
combined_data.update(self.validate_data_type(values))
|
21
|
+
combined_data.update(self.validate_data_type(args))
|
22
|
+
combined_data.update(self.validate_data_type(file_args))
|
23
|
+
|
24
|
+
# 合并传入的 data 参数(如果有)
|
25
|
+
if data is not None:
|
26
|
+
combined_data.update(data)
|
27
|
+
|
28
|
+
# 调用父类构造函数,传递所有参数
|
29
|
+
super(BaseForm, self).__init__(
|
30
|
+
formdata=formdata,
|
31
|
+
obj=obj,
|
32
|
+
prefix=prefix,
|
33
|
+
data=combined_data,
|
34
|
+
meta=meta,
|
35
|
+
**kwargs
|
36
|
+
)
|
37
|
+
|
38
|
+
def validate_for_api(self):
|
39
|
+
valid = super(BaseForm, self).validate()
|
40
|
+
if not valid:
|
41
|
+
# 只返回一个错误
|
42
|
+
error_msg = ""
|
43
|
+
for error_k, error_v in self.errors.items():
|
44
|
+
# print(error_k, error_v)
|
45
|
+
if not error_v: continue
|
46
|
+
error_v_item = error_v[0]
|
47
|
+
if not error_v_item: continue
|
48
|
+
if type(error_v_item) == str:
|
49
|
+
error_msg = error_v_item
|
50
|
+
break
|
51
|
+
if type(error_v_item) == dict:
|
52
|
+
first_key = next(iter(error_v_item))
|
53
|
+
first_value = error_v_item[first_key]
|
54
|
+
if not first_value: continue
|
55
|
+
error_msg = first_value[0]
|
56
|
+
break
|
57
|
+
|
58
|
+
raise ValidatorsErrorException(msg=error_msg)
|
59
|
+
|
60
|
+
return self
|
61
|
+
|
62
|
+
def validate_data_type(self, data):
|
63
|
+
if type(data) == str:
|
64
|
+
data = json.loads(data)
|
65
|
+
return data
|
@@ -0,0 +1,16 @@
|
|
1
|
+
from flask_wtf.file import DataRequired
|
2
|
+
from app.validators.base import BaseForm as Form
|
3
|
+
from wtforms import StringField, FieldList, FormField
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
class xxxxxDictInfoForm(Form):
|
8
|
+
xxxxx = StringField('xxxxx', validators=[DataRequired(message="order_id is required")])
|
9
|
+
|
10
|
+
|
11
|
+
class UpdateDataFileValidatorsForm(Form):
|
12
|
+
result = FieldList(
|
13
|
+
FormField(xxxxxDictInfoForm), # 使用 FormField 包装子表单
|
14
|
+
min_entries=1,
|
15
|
+
validators=[DataRequired(message='xxx 不允许为空')]
|
16
|
+
)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
version: '3'
|
2
|
+
services:
|
3
|
+
python-app:
|
4
|
+
container_name: {{ project_name }}
|
5
|
+
build:
|
6
|
+
context: . # 使用当前目录作为构建上下文
|
7
|
+
dockerfile: Dockerfile # 指定Dockerfile路径
|
8
|
+
volumes:
|
9
|
+
- /home/{{ project_name }}:/app # 将本地目录挂载到容器内
|
10
|
+
ports:
|
11
|
+
- "10089:10089" # 映射Python应用程序端口到主机上
|
12
|
+
- "5000:5000" # 映射Python应用程序端口到主机上
|
13
|
+
networks:
|
14
|
+
- 1panel-network # 指定连接到现有的网络
|
15
|
+
environment:
|
16
|
+
- TZ=Asia/Shanghai # 设置容器的时区为上海时间
|
17
|
+
restart: always # 设置失败重启策略
|
18
|
+
networks:
|
19
|
+
1panel-network:
|
20
|
+
external: true # 声明连接到外部网络
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# 说明:
|
5
|
+
# 程序说明xxxxxxxxxxxxxxxxxxx
|
6
|
+
# History:
|
7
|
+
# Date Author Version Modification
|
8
|
+
# --------------------------------------------------------------------------------------------------
|
9
|
+
# 2025/3/13 xiatn V00.01.000 新建
|
10
|
+
# --------------------------------------------------------------------------------------------------
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# 说明:
|
5
|
+
# 程序说明xxxxxxxxxxxxxxxxxxx
|
6
|
+
# History:
|
7
|
+
# Date Author Version Modification
|
8
|
+
# --------------------------------------------------------------------------------------------------
|
9
|
+
# 2025/3/13 xiatn V00.01.000 新建
|
10
|
+
# --------------------------------------------------------------------------------------------------
|
@@ -0,0 +1,14 @@
|
|
1
|
+
cryptography==41.0.7
|
2
|
+
Flask==2.2.5
|
3
|
+
Flask-HTTPAuth==4.8.0
|
4
|
+
Flask-Migrate==2.7.0
|
5
|
+
flask-redis==0.4.0
|
6
|
+
Flask-RESTful==0.3.10
|
7
|
+
flask-sqlalchemy==3.0.5
|
8
|
+
PyExecJS==1.5.1
|
9
|
+
requests==2.31.0
|
10
|
+
six==1.16.0
|
11
|
+
Flask-WTF
|
12
|
+
Flask-PyMongo
|
13
|
+
xtn-tools-pro
|
14
|
+
PyJWT
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
# 说明:
|
5
|
+
# 程序说明xxxxxxxxxxxxxxxxxxx
|
6
|
+
# History:
|
7
|
+
# Date Author Version Modification
|
8
|
+
# --------------------------------------------------------------------------------------------------
|
9
|
+
# 2025/3/13 xiatn V00.01.000 新建
|
10
|
+
# --------------------------------------------------------------------------------------------------
|
@@ -0,0 +1,28 @@
|
|
1
|
+
[uwsgi]
|
2
|
+
#项目目录
|
3
|
+
chdir = /app
|
4
|
+
#指定项目application
|
5
|
+
wsgi-file = /app/{{ project_name }}.py
|
6
|
+
#python 程序内用以启动的application 变量名
|
7
|
+
callable = app
|
8
|
+
# 进程个数
|
9
|
+
processes = 20
|
10
|
+
# 线程个数
|
11
|
+
threads = 200
|
12
|
+
#指定启动时的pid文件路径(用于停止服务和重启服务,请勿删除)
|
13
|
+
pidfile = uwsgi.pid
|
14
|
+
# 在多进程多线程环境中,启用 thunder-lock 可以提高性能。
|
15
|
+
thunder-lock = true
|
16
|
+
# 指定ip及端口
|
17
|
+
# 默认http模式,可切换至socket模式
|
18
|
+
http = 0.0.0.0:5000
|
19
|
+
# socket=0.0.0.0:5000
|
20
|
+
#启用主进程
|
21
|
+
master = true
|
22
|
+
# 设置缓冲区大小
|
23
|
+
buffer-size = 32768
|
24
|
+
# 后台运行,并输出日志
|
25
|
+
# daemonize = uwsgi.log # 这会强制 uWSGI 以 守护进程(后台)模式 启动。此时,uWSGI 主进程会立即退出,Docker 检测到主进程退出后,认为容器任务已完成,因此触发重启
|
26
|
+
logger = file:/dev/stdout
|
27
|
+
log-format = '[%(ltime)] "%(method) %(uri) %(proto)" %(status)'
|
28
|
+
|
@@ -0,0 +1,68 @@
|
|
1
|
+
xtn_tools_pro/__init__.py,sha256=26Tf9j2wj88M1Ldg3b1DJ40KyGgN9ZmQdBLuV453388,395
|
2
|
+
xtn_tools_pro/tools.py,sha256=KmOOrSnjZNJ3u9vFkMO3FX0DxtlW3fnI5fL4e_raCRs,542
|
3
|
+
xtn_tools_pro/tools_flie.py,sha256=-FID31G8AnV2u2djRO3Ae3Ei9ld9bSBWgzwqhYzZ5JQ,1517
|
4
|
+
xtn_tools_pro/tools_time.py,sha256=DMjsw9h4E_mrPsanPA8CEhpUE1AA6Z2FU4OJqJKZc1k,4867
|
5
|
+
xtn_tools_pro/db/MongoDB.py,sha256=CljtA5NnutOPL0j2ClrCE4RXW-9N_306D3PAdRANmuk,5699
|
6
|
+
xtn_tools_pro/db/MysqlDB.py,sha256=SBJrcjbZdxmtTKPGwl57NthPhs4uX8J3P6o_rK01O4k,13373
|
7
|
+
xtn_tools_pro/db/RedisDB.py,sha256=YSWxYEPE2jp6r1ZKam2LyPgL0S2S9lGDmt36PLSwThg,6470
|
8
|
+
xtn_tools_pro/db/__init__.py,sha256=Zg91UWS02TO0Ba_0AY56s0oabRy93xLNFkpIIL_6mMM,416
|
9
|
+
xtn_tools_pro/flask_demo/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
10
|
+
xtn_tools_pro/flask_demo/cli.py,sha256=wBcdWu5uN1QB8begyGHnhSln4IiZJPTFE8CDy0sQGTk,3116
|
11
|
+
xtn_tools_pro/flask_demo/ai_server_api/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
12
|
+
xtn_tools_pro/flask_demo/ai_server_api/recognize_ai_server_pro.py,sha256=l3VGFGGSVh2PjWodwOGCWfdCQ6ERXf3ZIccURIxUYqk,896
|
13
|
+
xtn_tools_pro/flask_demo/ai_server_api/app/__init__.py,sha256=GtoReIEP40zQZUH8yzouon-YWLctoexY_DlW-eIbojw,912
|
14
|
+
xtn_tools_pro/flask_demo/ai_server_api/app/app.py,sha256=1X6pp3yD5iygTv6SRJGwEZEFTQZw-oSaO2i45T2oyKM,476
|
15
|
+
xtn_tools_pro/flask_demo/templates/.gitignore,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
+
xtn_tools_pro/flask_demo/templates/Dockerfile,sha256=qWH1FaAQLiBf4ncXpKm7UfnaP7ugLAdId-y74TbSTBE,317
|
17
|
+
xtn_tools_pro/flask_demo/templates/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
+
xtn_tools_pro/flask_demo/templates/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
19
|
+
xtn_tools_pro/flask_demo/templates/docker-compose.yml,sha256=g_yP1-oMwX8hxSgbz4fMYVZm8n-J7PRpXEuzjx49ntw,714
|
20
|
+
xtn_tools_pro/flask_demo/templates/recognize_ai_server_pro.py,sha256=l3VGFGGSVh2PjWodwOGCWfdCQ6ERXf3ZIccURIxUYqk,896
|
21
|
+
xtn_tools_pro/flask_demo/templates/requirements.txt,sha256=sJT53DTd6HN7WnGUH6Vn-9hljiOz93YrCnMnqF5Em9k,243
|
22
|
+
xtn_tools_pro/flask_demo/templates/server_run.py,sha256=l3VGFGGSVh2PjWodwOGCWfdCQ6ERXf3ZIccURIxUYqk,896
|
23
|
+
xtn_tools_pro/flask_demo/templates/uwsgi.ini,sha256=PYx2q5EAQ9FpfROg0Oo2e_skNF8wq2mquW95htE6gcw,983
|
24
|
+
xtn_tools_pro/flask_demo/templates/app/__init__.py,sha256=GtoReIEP40zQZUH8yzouon-YWLctoexY_DlW-eIbojw,912
|
25
|
+
xtn_tools_pro/flask_demo/templates/app/app.py,sha256=1X6pp3yD5iygTv6SRJGwEZEFTQZw-oSaO2i45T2oyKM,476
|
26
|
+
xtn_tools_pro/flask_demo/templates/app/api/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
27
|
+
xtn_tools_pro/flask_demo/templates/app/api/v1/__init__.py,sha256=zFfA1K-9BnLgPbsFsxJ5YqBDMsoaZxocps5fHuUPjDk,278
|
28
|
+
xtn_tools_pro/flask_demo/templates/app/api/v1/demo.py,sha256=1UlfVoTW9d6FfhcGNLCtrsRVv1STZzWYgzz9G8Rq8B4,491
|
29
|
+
xtn_tools_pro/flask_demo/templates/app/config/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
30
|
+
xtn_tools_pro/flask_demo/templates/app/config/secure.py,sha256=1L9ke_bbdpaBH912IYu7MUroWLg0vOVsJiPNLEiMxS8,295
|
31
|
+
xtn_tools_pro/flask_demo/templates/app/config/setting.py,sha256=TX_hVWaL7ZlEJDTSdLgKGojm5eLfDXtqlwnK08ShfxU,52
|
32
|
+
xtn_tools_pro/flask_demo/templates/app/libs/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
33
|
+
xtn_tools_pro/flask_demo/templates/app/libs/base.py,sha256=RZrlRCujdrSPR_Qw3zw_OsLHgP_GlcuPhuxETCmPepU,112
|
34
|
+
xtn_tools_pro/flask_demo/templates/app/libs/error.py,sha256=kkjQjxBDgnapCRfGGgO_Id9A9tlWzAx8FKE9bcbZCk4,1541
|
35
|
+
xtn_tools_pro/flask_demo/templates/app/libs/error_code.py,sha256=I55_pukaH4xThlxRIUBAwWTAmjuCF_L3n5_UGwIsoJk,854
|
36
|
+
xtn_tools_pro/flask_demo/templates/app/libs/redprint.py,sha256=955yIMDTJNTFVYvY1IrVh00WhFn5tO4HUR1Tn2uaO3k,635
|
37
|
+
xtn_tools_pro/flask_demo/templates/app/libs/token_auth.py,sha256=SEMTCQyp43cRfBMoIR4dObz0P0T5NlthpMh7ng9J0vc,1071
|
38
|
+
xtn_tools_pro/flask_demo/templates/app/models/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
39
|
+
xtn_tools_pro/flask_demo/templates/app/models/base.py,sha256=9LzwSqunbaKE64MwIWaVXeAUVt7OgtzxidFYvK17_kM,760
|
40
|
+
xtn_tools_pro/flask_demo/templates/app/models/redis_demo.py,sha256=N-w0fQIruR4bbXaSTKFAy_3UKY3c3wxkKNkt0p_WJyc,385
|
41
|
+
xtn_tools_pro/flask_demo/templates/app/validators/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
42
|
+
xtn_tools_pro/flask_demo/templates/app/validators/base.py,sha256=3PSrXqwvfvOqaeGMBSsb7J3AEjoyQPfhf49LMaE47dE,2249
|
43
|
+
xtn_tools_pro/flask_demo/templates/app/validators/demo.py,sha256=sToACLlWALx0xSDfD9P3RpNMEeolvtPqbTrcHsCf8xE,521
|
44
|
+
xtn_tools_pro/flask_demo/templates/logs/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
45
|
+
xtn_tools_pro/flask_demo/templates/obj/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
46
|
+
xtn_tools_pro/flask_demo/templates/test/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
47
|
+
xtn_tools_pro/proxy/XiaoXiangProxy.py,sha256=45SsMZDc-3Ta4THX38vScjaeRBJSp420AJwBeogC_-I,11049
|
48
|
+
xtn_tools_pro/proxy/__init__.py,sha256=WRwh6s2lruMu5buh0ejo9EK54kWT_VQhCsFGNFAmcyo,418
|
49
|
+
xtn_tools_pro/proxy/proxy.py,sha256=No6E1pFY5yx2F4976pXPrLtq-QEVp79KupzcufjSN58,8703
|
50
|
+
xtn_tools_pro/task_pro/__init__.py,sha256=nK3U47hWwE1H875ieEToH9r-jzXHS-PXk8cDstOvRE8,418
|
51
|
+
xtn_tools_pro/task_pro/go_fun.py,sha256=hWEt2uJ9FCvJH7PhVZttS-11A7J6zbRKwX7c5YLYQag,19144
|
52
|
+
xtn_tools_pro/task_pro/go_fun_v2.py,sha256=SgcXgtEBGSVL1V2LyqO0z8Md2H8JZxucYrLLIwqtiLM,18489
|
53
|
+
xtn_tools_pro/task_pro/go_fun_v3.py,sha256=PdmT59wTJYS3gYS8d3LQX8JvQcREqfZENiy3MARb0UY,17991
|
54
|
+
xtn_tools_pro/utils/__init__.py,sha256=I1_n_NP23F2lBqlF4EOlnOdLYxM8M4pbn63UhJN1hRE,418
|
55
|
+
xtn_tools_pro/utils/crypto.py,sha256=oyzFqWum_oimUtzhfVCELQhdMjxDbLu-nOWfcNmazcc,4087
|
56
|
+
xtn_tools_pro/utils/file_utils.py,sha256=obaBP7CaBCsXxzqGeWzV2l0yw7vicgKOaXzmpMV8ips,2567
|
57
|
+
xtn_tools_pro/utils/helpers.py,sha256=H-a3gnahIah3kJqyKzzKlPWtVQYcFlJncz2rAfBqIiw,4444
|
58
|
+
xtn_tools_pro/utils/log.py,sha256=mf5huJDA8xVxxFWPG_tl_vOsAA2_ywGDFycYSGHIDCo,10202
|
59
|
+
xtn_tools_pro/utils/retry.py,sha256=0wjHsR5DBBKpv4naMfxiky8kprrZes4WURIfFQ4H708,1657
|
60
|
+
xtn_tools_pro/utils/set_data.py,sha256=IthfAclck7AbaxOIKOgJZ2wdcfEmlvC-C63Tywcr4bA,11180
|
61
|
+
xtn_tools_pro/utils/sql.py,sha256=EAKzbkZP7Q09j15Gm6o0_uq0qgQmcCQT6EAawbpp4v0,6263
|
62
|
+
xtn_tools_pro/utils/time_utils.py,sha256=TUtzG61PeVYXhaQd6pBrXAdlz7tBispNIRQRcGhE2No,4859
|
63
|
+
xtn_tools_pro-1.0.0.9.1.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
64
|
+
xtn_tools_pro-1.0.0.9.1.dist-info/METADATA,sha256=Iq-XIpN4T-Y8ahnprGrrCu-Pvp4Eho55piq0XpSHrEw,498
|
65
|
+
xtn_tools_pro-1.0.0.9.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
66
|
+
xtn_tools_pro-1.0.0.9.1.dist-info/entry_points.txt,sha256=t8CtXWOgw7nRDW3XNlZh8MT_P4l8EzsFnyWi5b3ovrc,68
|
67
|
+
xtn_tools_pro-1.0.0.9.1.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
|
68
|
+
xtn_tools_pro-1.0.0.9.1.dist-info/RECORD,,
|
@@ -1,41 +0,0 @@
|
|
1
|
-
xtn_tools_pro/__init__.py,sha256=26Tf9j2wj88M1Ldg3b1DJ40KyGgN9ZmQdBLuV453388,395
|
2
|
-
xtn_tools_pro/tools.py,sha256=KmOOrSnjZNJ3u9vFkMO3FX0DxtlW3fnI5fL4e_raCRs,542
|
3
|
-
xtn_tools_pro/tools_flie.py,sha256=-FID31G8AnV2u2djRO3Ae3Ei9ld9bSBWgzwqhYzZ5JQ,1517
|
4
|
-
xtn_tools_pro/tools_time.py,sha256=DMjsw9h4E_mrPsanPA8CEhpUE1AA6Z2FU4OJqJKZc1k,4867
|
5
|
-
xtn_tools_pro/db/MongoDB.py,sha256=CljtA5NnutOPL0j2ClrCE4RXW-9N_306D3PAdRANmuk,5699
|
6
|
-
xtn_tools_pro/db/MysqlDB.py,sha256=SBJrcjbZdxmtTKPGwl57NthPhs4uX8J3P6o_rK01O4k,13373
|
7
|
-
xtn_tools_pro/db/RedisDB.py,sha256=YSWxYEPE2jp6r1ZKam2LyPgL0S2S9lGDmt36PLSwThg,6470
|
8
|
-
xtn_tools_pro/db/__init__.py,sha256=Zg91UWS02TO0Ba_0AY56s0oabRy93xLNFkpIIL_6mMM,416
|
9
|
-
xtn_tools_pro/flask_demo/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
10
|
-
xtn_tools_pro/flask_demo/cli.py,sha256=NAvCYsmsUEn6OrrMO9dluuoMZRtXUybWBwLCGMn4ymE,3104
|
11
|
-
xtn_tools_pro/flask_demo/ai_server_api/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
12
|
-
xtn_tools_pro/flask_demo/ai_server_api/recognize_ai_server_pro.py,sha256=l3VGFGGSVh2PjWodwOGCWfdCQ6ERXf3ZIccURIxUYqk,896
|
13
|
-
xtn_tools_pro/flask_demo/ai_server_api/app/__init__.py,sha256=GtoReIEP40zQZUH8yzouon-YWLctoexY_DlW-eIbojw,912
|
14
|
-
xtn_tools_pro/flask_demo/ai_server_api/app/app.py,sha256=1X6pp3yD5iygTv6SRJGwEZEFTQZw-oSaO2i45T2oyKM,476
|
15
|
-
xtn_tools_pro/flask_demo/templates/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
16
|
-
xtn_tools_pro/flask_demo/templates/recognize_ai_server_pro.py,sha256=l3VGFGGSVh2PjWodwOGCWfdCQ6ERXf3ZIccURIxUYqk,896
|
17
|
-
xtn_tools_pro/flask_demo/templates/server_run.py,sha256=l3VGFGGSVh2PjWodwOGCWfdCQ6ERXf3ZIccURIxUYqk,896
|
18
|
-
xtn_tools_pro/flask_demo/templates/app/__init__.py,sha256=GtoReIEP40zQZUH8yzouon-YWLctoexY_DlW-eIbojw,912
|
19
|
-
xtn_tools_pro/flask_demo/templates/app/app.py,sha256=1X6pp3yD5iygTv6SRJGwEZEFTQZw-oSaO2i45T2oyKM,476
|
20
|
-
xtn_tools_pro/proxy/XiaoXiangProxy.py,sha256=45SsMZDc-3Ta4THX38vScjaeRBJSp420AJwBeogC_-I,11049
|
21
|
-
xtn_tools_pro/proxy/__init__.py,sha256=WRwh6s2lruMu5buh0ejo9EK54kWT_VQhCsFGNFAmcyo,418
|
22
|
-
xtn_tools_pro/proxy/proxy.py,sha256=No6E1pFY5yx2F4976pXPrLtq-QEVp79KupzcufjSN58,8703
|
23
|
-
xtn_tools_pro/task_pro/__init__.py,sha256=nK3U47hWwE1H875ieEToH9r-jzXHS-PXk8cDstOvRE8,418
|
24
|
-
xtn_tools_pro/task_pro/go_fun.py,sha256=hWEt2uJ9FCvJH7PhVZttS-11A7J6zbRKwX7c5YLYQag,19144
|
25
|
-
xtn_tools_pro/task_pro/go_fun_v2.py,sha256=SgcXgtEBGSVL1V2LyqO0z8Md2H8JZxucYrLLIwqtiLM,18489
|
26
|
-
xtn_tools_pro/task_pro/go_fun_v3.py,sha256=PdmT59wTJYS3gYS8d3LQX8JvQcREqfZENiy3MARb0UY,17991
|
27
|
-
xtn_tools_pro/utils/__init__.py,sha256=I1_n_NP23F2lBqlF4EOlnOdLYxM8M4pbn63UhJN1hRE,418
|
28
|
-
xtn_tools_pro/utils/crypto.py,sha256=oyzFqWum_oimUtzhfVCELQhdMjxDbLu-nOWfcNmazcc,4087
|
29
|
-
xtn_tools_pro/utils/file_utils.py,sha256=obaBP7CaBCsXxzqGeWzV2l0yw7vicgKOaXzmpMV8ips,2567
|
30
|
-
xtn_tools_pro/utils/helpers.py,sha256=H-a3gnahIah3kJqyKzzKlPWtVQYcFlJncz2rAfBqIiw,4444
|
31
|
-
xtn_tools_pro/utils/log.py,sha256=mf5huJDA8xVxxFWPG_tl_vOsAA2_ywGDFycYSGHIDCo,10202
|
32
|
-
xtn_tools_pro/utils/retry.py,sha256=0wjHsR5DBBKpv4naMfxiky8kprrZes4WURIfFQ4H708,1657
|
33
|
-
xtn_tools_pro/utils/set_data.py,sha256=IthfAclck7AbaxOIKOgJZ2wdcfEmlvC-C63Tywcr4bA,11180
|
34
|
-
xtn_tools_pro/utils/sql.py,sha256=EAKzbkZP7Q09j15Gm6o0_uq0qgQmcCQT6EAawbpp4v0,6263
|
35
|
-
xtn_tools_pro/utils/time_utils.py,sha256=TUtzG61PeVYXhaQd6pBrXAdlz7tBispNIRQRcGhE2No,4859
|
36
|
-
xtn_tools_pro-1.0.0.9.0.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
|
-
xtn_tools_pro-1.0.0.9.0.dist-info/METADATA,sha256=4jVE3_-8qYhn09Wr_GibSMqObUcgH26nmWU_59A7XoE,498
|
38
|
-
xtn_tools_pro-1.0.0.9.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
39
|
-
xtn_tools_pro-1.0.0.9.0.dist-info/entry_points.txt,sha256=t8CtXWOgw7nRDW3XNlZh8MT_P4l8EzsFnyWi5b3ovrc,68
|
40
|
-
xtn_tools_pro-1.0.0.9.0.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
|
41
|
-
xtn_tools_pro-1.0.0.9.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|