fastapi / full-stack-fastapi-template

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
MIT License
27.1k stars 4.82k forks source link

The code is very bad. Fastapi provides dependency injection function, but developers don’t know how to use it. #1334

Closed jianchao123 closed 1 month ago

jianchao123 commented 1 month ago

Privileged issue

Issue Content

The code is very bad. Fastapi provides dependency injection function, but developers don’t know how to use it.I suspect the developer has no real project experience

jianchao123 commented 1 month ago

The directory structure of the project is not designed hierarchically. I would like to ask developers what is MVC?

jianchao123 commented 1 month ago

The app/main.py file is at the top level of the directory structure, but it imports the api_router object from a lower-level file. This shouldn't be a mistake made by a developer.

Atticuszz commented 1 month ago

shut up,you are the shame of chinese developer.

useless issues should be closed.

jianchao123 commented 1 month ago

shut up,you are the shame of chinese developer.

useless issues should be closed.

菜鸡,看看你写的破烂代码。async def identify_ws(connection: WebSocketConnection): while True:

test identifyResult

    try:
        rec_data = await connection.receive_data(Face2SearchSchema)
        logger.debug("rec_data:", rec_data)
        search_data = Face2Search.from_schema(rec_data)
        logger.debug(f"get the search data:{search_data}")

        await task_queue.put_async((TaskType.IDENTIFY, search_data.to_face()))

        try:
            res: MatchedResult = await result_queue.get_async()
            result = IdentifyResult.from_matched_result(res)
            await connection.send_data(result)
        except Empty:
            logger.warn("empty in result queue")

        # time_now = datetime.datetime.now()
        # result = IdentifyResult(
        #     uid=str(uuid.uuid4()),
        #     name=session.user.user_metadata.get("name"),
        #     time=time_now.strftime("%Y-%m-%d %H:%M:%S"),
        #     uid=search_data.uid,
        #     score=0.99
        # )

        # await asyncio.sleep(1)  # 示例延时
    except (
        ConnectionClosedOK,
        ConnectionClosedError,
        RuntimeError,
        WebSocketDisconnect,
    ) as e:
        logger.info(f"WebSocket error occurred: {e.__class__.__name__} - {e}")
        logger.info(f"Client left the chat")
        break
jianchao123 commented 1 month ago

shut up,you are the shame of chinese developer.

useless issues should be closed.

try...except里面嵌套try...except,就你这水平来教训我?

jianchao123 commented 1 month ago

shut up,you are the shame of chinese developer.

useless issues should be closed.

建议你注销github账号,不要再给中国开发者丢脸

Atticuszz commented 1 month ago

@alejsdev I respectfully request that this issue be closed. The content appears to contain unsubstantiated claims and potentially harmful remakes that does not align with our community guidelines.