XMOJ-Script-dev / XMOJ-bbs

XMOJ增强脚本后台
https://api.xmoj-bbs.me
GNU Affero General Public License v3.0
5 stars 1 forks source link

[Feature Request] use a meta-framework #12

Open boomzero opened 9 months ago

boomzero commented 9 months ago

检查项

描述

like nitro!

Please track at https://github.com/XMOJ-Script-dev/xmoj-bbs-v2

原因

our implementation is very ad-hoc...

boomzero commented 9 months ago

@PythonSmall-Q @zhouyiqing0304 any news?

boomzero commented 9 months ago

Plus, we get an openapi yml

boomzero commented 9 months ago

...

PythonSmall-Q commented 8 months ago

Plus, we get an openapi yml

whats that @boomzero

boomzero commented 7 months ago

https://spec.openapis.org/oas/latest.html

boomzero commented 2 months ago

I have decided to rewrite the backend.

boomzero commented 2 months ago

The main reason is that I hate @langningchen 's legacy code, and I want to actually own a piece of code in the project.

boomzero commented 2 months ago

https://github.com/XMOJ-Script-dev/xmoj-bbs-v2

boomzero commented 2 months ago

Trying to get error handling to work... I currently can only extract a cryptic stack trace

boomzero commented 2 months ago

https://xmoj-bbs-v2.xmoj-script.workers.dev/GetNotice works now

boomzero commented 2 months ago

Okay... I am preserving some compatibility, ~so I can copy some code~. The Result class can stay.

boomzero commented 2 months ago

One thing that will definitely not stay is Database.ts

boomzero commented 2 months ago

I am going to use an actual ORM, not one that @langningchen wrote.

boomzero commented 2 months ago

Just realized that this should be v3, since v1 is php...

langningchen commented 2 months ago

The main reason is that I hate @langningchen 's legacy code, and I want to actually own a piece of code in the project.

我当时根本没有想要将这个 XMOJ-Script 发布,本来就是自己随便写了一个,最开始开发的时候根本没有按照任何规范开发……

boomzero commented 2 months ago

The main reason is that I hate @langningchen 's legacy code, and I want to actually own a piece of code in the project.

我当时根本没有想要将这个 XMOJ-Script 发布,本来就是自己随便写了一个,最开始开发的时候根本没有按照任何规范开发……

@langningchen 我这里说的是 XMOJ-bbs, 显然后台的开发时间晚于 “最开始” ……

我不喜欢的主要是它一层一层 return 下来的结构,即你没法直接向客户端发 response,必须经过几层 return, 而这样会导致改变一个东西可能有意外的副作用。

然后就是看似没有问题的代码会有很多 Bug,比如 https://github.com/XMOJ-Script-dev/XMOJ-bbs/commit/fce057afb9d34dd1f4ee3470a5a41a0885d6f7cf 就是因为我实在调不出来

boomzero commented 2 months ago

然后在 iPadOS 上用键盘打字的感觉好奇怪……

boomzero commented 2 months ago

The main reason is that I hate @langningchen 's legacy code, and I want to actually own a piece of code in the project.

我当时根本没有想要将这个 XMOJ-Script 发布,本来就是自己随便写了一个,最开始开发的时候根本没有按照任何规范开发……

@langningchen 我这里说的是 XMOJ-bbs, 显然后台的开发时间晚于 “最开始” ……

我不喜欢的主要是它一层一层 return 下来的结构,即你没法直接向客户端发 response,必须经过几层 return, 而这样会导致改变一个东西可能有意外的副作用。

然后就是看似没有问题的代码会有很多 Bug,比如 fce057a 就是因为我实在调不出来

备注一下,在 nitro 中可以用 send 函数

https://github.com/XMOJ-Script-dev/xmoj-bbs-v2/blob/b9768dcbe03392f68d733699645204c39e6e9605/server/error.ts#L5

langningchen commented 2 months ago