1 回答

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超10個(gè)贊
@ns.route("/dev/get_rec_id", methods=["POST"])
@ns.param('mine_id', 'unique ECP ID')
class RecommendationService(Resource):
@ns.doc('path to generate a unique recommendationid, and to determine which frames predictions can be made for. Expected/optional input : JSON string as a https html data objects with keys: mine_id -- unique ECP ID. If this is not provided generic frames recommendations will be provided.')
@ns.marshal_list_with(myModel)
def post(self):
mine_id = np.nan
if request.is_json:
mine_id = request.json.get('mine_id', np.nan)
return {'rec_id': np.random.choice(1000),
'fun_id_prob': [[1, 0.1], [2, 0.1], [3, 0.1], [4, 0.1], [5, 0.6]],
'comment': 'these games suit everyone',
'mine_id': mine_id
}
在此簽名不匹配即fun_id_prob不在 API 簽名中,也由于某種原因在調(diào)用X-Fields時(shí),它需要保持為空。
只需使用
@ns.route("/dev/get_rec_id", methods=["POST"])
@ns.param('mine_id', 'unique ECP ID')
class RecommendationService(Resource):
@ns.doc('path to generate a unique recommendationid, and to determine which frames predictions can be made for. Expected/optional input : JSON string as a https html data objects with keys: mine_id -- unique ECP ID. If this is not provided generic frames recommendations will be provided.')
@ns.marshal_list_with(myModel)
def post(self):
mine_id = np.nan
if request.is_json:
mine_id = request.json.get('mine_id', np.nan)
return {'rec_id': np.random.choice(1000),
'comment': 'these games suit everyone',
'mine_id': mine_id
}
或?qū)⒘斜硖砑拥胶灻?,它將起作?)。
添加回答
舉報(bào)