add: api for profiling
continuous-integration/drone/push Build is passing Details

This commit is contained in:
BryantHe 2023-10-26 11:03:50 +08:00
parent 7ae20b8153
commit f613848d4c
2 changed files with 12 additions and 1 deletions

View File

@ -8,7 +8,7 @@ from flask import session
from app import rpc from app import rpc
from app.api.v1.exception.api import ImageUploadError, UserInfoError, ImageNotFound, DietCreationError from app.api.v1.exception.api import ImageUploadError, UserInfoError, ImageNotFound, DietCreationError
from app.api.v1.schema.api import ImageIn, ImagePreSignUrlOut, ImagePreSignUrlIn, DietImageIn from app.api.v1.schema.api import ImageIn, ImagePreSignUrlOut, ImagePreSignUrlIn, DietImageIn, ProfilingIn
from app.util.auth import login_required from app.util.auth import login_required
api = APIBlueprint('api', __name__) api = APIBlueprint('api', __name__)
@ -112,6 +112,13 @@ def get_image_presign_url(query_data):
return {'image_presign_url': presign_url} return {'image_presign_url': presign_url}
@api.get('/profiling')
@api.input(ProfilingIn, location='query')
@api.doc(summary='此接口用于性能测试', description='此接口用于性能测试')
def profiling(query_data):
result = rpc.storage.admin.identify(query_data['token'])
@api.get('/hello') @api.get('/hello')
def hello(): def hello():
result_one = f'我是您的专属接口提供服务器:' result_one = f'我是您的专属接口提供服务器:'

View File

@ -24,3 +24,7 @@ class ImageIdOut(Schema):
image_id = String() image_id = String()
class ProfilingIn(Schema):
token = String()