scope_operations.py 1.07 KB
Newer Older
lcn's avatar
lcn committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
from pot_libs.sanic_api import summary
from unify_api.modules.zhiwei_u.components.scope_operations_cps import \
    SearchScopeRep, SearchScopeResq, ScopeDetailRep
from unify_api.modules.zhiwei_u.service.scope_operations_service import *


# 录波查询
@summary('录波查询')
async def post_search_scope(req, body: SearchScopeRep) -> SearchScopeResq:
    prod_id = body.prod_id
    cid = body.cid
    pid = body.pid
    start = body.start
    end = body.end
    sid = body.sid
    page_size = body.page_size
    page_num = body.page_num
    return await search_scope_service(prod_id, cid, pid, sid, page_num,
                                      page_size, start, end)


@summary('录波查询-详情')
lcn's avatar
lcn committed
23
async def post_scope_detail(req, body: ScopeDetailRep) -> SearchScopeResq:
lcn's avatar
lcn committed
24 25 26 27 28 29 30 31 32 33 34 35
    id = body.id
    wave_range = body.wave_range
    return await scope_detail_service(id, wave_range)


@summary('录波查询-下载')
async def get_download_scope(req):
    id = req.args.get("id")
    user_id = req.ctx.user_id
    download = 1
    return await scope_detail_service(id, "all", download, user_id)