Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: 开发spring boot starter #11

Open
13 of 18 tasks
fzdwx opened this issue May 16, 2022 · 1 comment
Open
13 of 18 tasks

✨ feat: 开发spring boot starter #11

fzdwx opened this issue May 16, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request in processing in development

Comments

@fzdwx
Copy link
Owner

fzdwx commented May 16, 2022

result :
兼容正常的spring boot starter web 的一切行为。

step:

  • 1. 一个简单的spring boot starter,引入后能启动一个web服务
  • 2. 兼容@Controller等注解
  • 3. 兼容@RequestBody等参数注入注解
  • 4. 兼容@RestControllerAdvice自定义异常处理
  • 5. 实现所有controller的收集
  • 6. 兼容Spring的/hello/{name}的语法
  • 7. 抽象出DispatchHandler
  • 8. 支持filter(可能兼容不了)
  • 9. todo

nosuport:

  1. 初步发现支持servlet有点困难

参数解析器:

  • 1. @PathVariable
  • 2. @RequestBody
  • 3. @RequestParam
  • 4. @RequestHeader
  • 5. HttpServerResponse
  • 6. HttpServerRequest

返回值解析器:

  • 1. default result handler(默认返回值解析器,直接返回所有数据)
  • 2. @responsebody handler
  • 3. ResponseEntity 解析
    • 暂时只支持简单的读取http status、header、body(统一转换为json数据)

解析器的类型转换实现?
抽象出了一个ValConvertor,默认使用的是hutool的cn.hutool.core.convert.ConverterRegistry

@fzdwx fzdwx self-assigned this May 16, 2022
@fzdwx fzdwx added the enhancement New feature or request label May 16, 2022
fzdwx added a commit that referenced this issue May 16, 2022
@fzdwx fzdwx added the in processing in development label May 16, 2022
@fzdwx
Copy link
Owner Author

fzdwx commented May 16, 2022

关于http.ext.HttpHandelr

  1. 用户可以自定义注入(后续一切行为由用户自己负责)
  2. 框架定义,用于实现类似DispatchServlet的效果
  3. 收集handlerMapping參考DispatcherServlet#initHandlerMappings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in processing in development
Projects
None yet
Development

No branches or pull requests

1 participant