Device
This commit is contained in:
20
backend/modules/device/routes.py
Normal file
20
backend/modules/device/routes.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# 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)
|
||||
Reference in New Issue
Block a user