fix: handler

This commit is contained in:
xtaodada 2024-11-04 22:02:59 +08:00
parent dfd39412f6
commit f5786d5d1e
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
5 changed files with 6 additions and 7 deletions

View File

@ -4,6 +4,6 @@ from persica.context.application import ApplicationContext
app = (
ApplicationBuilder()
.set_application_context_class(ApplicationContext)
.set_scanner_packages(["src.core", "src.plugin", "src.route"])
.set_scanner_packages(["src.core", "src.services", "src.plugin", "src.route"])
.build()
)

View File

@ -1,2 +1 @@
from ._handler import handler
from ._plugin import Plugin

View File

@ -90,7 +90,7 @@ class _GetHandler(_Handler):
def __init__(
self,
path: str,
admin: bool = False,
admin: bool = True,
student: bool = False,
out: bool = False,
**kwargs,
@ -110,7 +110,7 @@ class _PostHandler(_Handler):
def __init__(
self,
path: str,
admin: bool = False,
admin: bool = True,
student: bool = False,
out: bool = False,
**kwargs,

View File

@ -3,12 +3,12 @@ from typing import TYPE_CHECKING
from fastapi_amis_admin.crud import BaseApiOut
from fastapi import HTTPException
from persica.factory.component import AsyncInitializingComponent
from starlette import status
from starlette.requests import Request
from starlette.responses import Response
from src.plugin import Plugin, handler
from src.plugin import handler
from src.plugin.plugin import Plugin
from src.services.users.schemas import (
UserRegIn,
SystemUserEnum,
@ -21,7 +21,7 @@ if TYPE_CHECKING:
from fastapi_user_auth.auth import Auth
class UserRoutes(Plugin, AsyncInitializingComponent):
class UserRoutes(Plugin):
_prefix = "/user"
def __init__(self, user_services: UserServices):