21 lines
648 B
Python
21 lines
648 B
Python
|
|
# pyrefly: ignore [missing-import]
|
||
|
|
from flask import Blueprint
|
||
|
|
|
||
|
|
from modules.device.controller import (
|
||
|
|
get_devices,
|
||
|
|
get_device_by_id,
|
||
|
|
create_device,
|
||
|
|
update_device,
|
||
|
|
delete_device
|
||
|
|
)
|
||
|
|
|
||
|
|
# Khởi tạo Blueprint cho Module Device
|
||
|
|
device_bp = Blueprint("device", __name__)
|
||
|
|
|
||
|
|
# Đăng ký các endpoints với controller tương ứng
|
||
|
|
device_bp.route("", methods=["GET"])(get_devices)
|
||
|
|
device_bp.route("/<device_id>", methods=["GET"])(get_device_by_id)
|
||
|
|
device_bp.route("", methods=["POST"])(create_device)
|
||
|
|
device_bp.route("/<device_id>", methods=["PUT"])(update_device)
|
||
|
|
device_bp.route("/<device_id>", methods=["DELETE"])(delete_device)
|