fund.py 1.26 KB
Newer Older
pengxiong's avatar
pengxiong committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# -*- encoding: utf-8 -*-
# -----------------------------------------------------------------------------
# @File Name  : fund.py
# @Time       : 2021/1/14 下午5:31
# @Author     : X. Peng
# @Email      : acepengxiong@163.com
# @Software   : PyCharm
# -----------------------------------------------------------------------------
import datetime
import time
import uuid

import oss2
from flask_restful import Resource, reqparse
from flask import request, render_template
from flask import make_response
from app.api.engine import pdf_folder, redis
pengxiong's avatar
pengxiong committed
18 19 20
from app.service.fund_service import single_evaluation
from app.utils.auth import login_require

pengxiong's avatar
pengxiong committed
21 22 23 24 25 26

class FundEvaluation(Resource):
    def __init__(self):
        """."""
        self.parser = reqparse.RequestParser()

pengxiong's avatar
pengxiong committed
27
    @login_require
pengxiong's avatar
pengxiong committed
28 29 30
    def get(self):
        """"""
        self.parser.add_argument('fund_id', type=str, required=True, help='基金id不能为空')
pengxiong's avatar
pengxiong committed
31
        self.parser.add_argument('type', type=int, required=True, help='基金类型不能为空')
pengxiong's avatar
pengxiong committed
32
        args = self.parser.parse_args()
pengxiong's avatar
pengxiong committed
33
        data = single_evaluation(fund_id=args.get('fund_id'), invest_type=args.get('type'))
pengxiong's avatar
pengxiong committed
34 35 36 37 38 39
        resp = {
            "statusCode": "0000",
            "message": "成功",
            "attributes": data
        }
        return resp