You've already forked my-video-workflow
posting+video_part预
This commit is contained in:
18
controller/api/video_part_blueprint.py
Normal file
18
controller/api/video_part_blueprint.py
Normal file
@ -0,0 +1,18 @@
|
||||
from flask import Blueprint, jsonify
|
||||
from model.VideoPart import VideoPart
|
||||
from util.flask import not_found_json_response
|
||||
|
||||
blueprint = Blueprint("api_video_part", __name__, url_prefix="/api/video_part")
|
||||
|
||||
@blueprint.get("/")
|
||||
def get_all_posting():
|
||||
_video_parts = VideoPart.query.all()
|
||||
return jsonify([_i.to_json() for _i in _video_parts])
|
||||
|
||||
|
||||
@blueprint.get("/<int:video_part_id>")
|
||||
def get_posting_detail(video_part_id):
|
||||
video_part = VideoPart.query.get(video_part_id)
|
||||
if video_part is None:
|
||||
return not_found_json_response(id=video_part_id)
|
||||
return jsonify(video_part.to_dict())
|
Reference in New Issue
Block a user