first commit

This commit is contained in:
552068321@qq.com
2022-11-04 17:37:08 +08:00
commit 6f7de660aa
192 changed files with 32574 additions and 0 deletions

View File

@ -0,0 +1,33 @@
import logging
from flask import Blueprint, app
from app.exts import redisClient
from app.utils.StandardizedOutput import output_wrapped
bp = Blueprint('WebStatus', __name__)
@bp.route('/ping', methods=['GET'])
def ping():
""" For health check.
"""
res = output_wrapped(0, 'pong', '')
return res
@bp.route('/redis/set', methods=['post'])
def redis_set():
redisClient.set('foo', 'bar', ex=60*60*6)
res = output_wrapped(0, 'set foo', '')
return res
@bp.route('/redis/get', methods=['get'])
def redis_get():
""" For health check.
"""
the_food = redisClient.get('foo')
if not the_food:
return output_wrapped(5006, 'foo', "")
return output_wrapped(0, 'foo', the_food.decode("utf-8"))