diff --git a/app/api/v1/api.py b/app/api/v1/api.py index 95c61a3..353b84d 100644 --- a/app/api/v1/api.py +++ b/app/api/v1/api.py @@ -8,7 +8,7 @@ from flask import session from app import rpc 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 api = APIBlueprint('api', __name__) @@ -112,6 +112,13 @@ def get_image_presign_url(query_data): 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') def hello(): result_one = f'我是您的专属接口提供服务器:' diff --git a/app/api/v1/schema/api.py b/app/api/v1/schema/api.py index afa3122..2c2373f 100644 --- a/app/api/v1/schema/api.py +++ b/app/api/v1/schema/api.py @@ -24,3 +24,7 @@ class ImageIdOut(Schema): image_id = String() +class ProfilingIn(Schema): + token = String() + +