Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Deali-Axy
Copy link

enhance: 优化API接口代码以及Swagger界面显示

原本的代码是直接在 create_item 方法里读取 request body

接口需要传入的各个参数在Swagger界面都没有展示,不够直观,代码冗余度比较高

第24-26行重复进行了无意义的json序列化和反序列化

本 pr 对API接口进行了重写,接口方法的代码缩减到了38行,swagger更加直观

效果如下

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant