- Enhances development with annotations, enabling a Java-like controller development approach
- Reduces code duplication and improves development efficiency
- One-click generation of Swagger documentation
- Supports custom annotations for implementing features like logging and access control
- Create a service file in the service folder
- Run the iris-enhance command to generate corresponding handler and router code
- Register routes
- Bind Swagger documentation (UI from knife4j)
For detailed examples, please refer to the Chinese README.
- @zService
- @zResult
- @zSummary
- @zDescription
- @zTags
- @zParam
- @zResultData
- @zAccept
- @zProduce
- @zRouter
For detailed explanations of these tags, please refer to the Chinese README.
-
Installation:
go get github.com/celt237/iris-enhance/cmd/iris-enhance@latest
-
Add github.com/celt237/iris-enhance dependency to your project
-
Run the iris-enhance command:
iris-enhance --servicePath=xxx --handlePath=xxx --result=xxx --errorCode=xxx
For detailed instructions and troubleshooting, please refer to the Chinese README.
- knife4j: https://github.com/xiaomin/knife4j
- go-annotation: https://github.com/celt237/go-annotation