Skip to content

Commit

Permalink
upade docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zhufuyi committed May 11, 2024
1 parent a7fbe48 commit b746646
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Change log

- Add generate grpc+http service code
- Add generate service+handler CRUD code
- Fix known bugs
- Fix bug in generating mongodb CRUD code.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

</div>

**Sponge** is a powerful development framework that integrates `automatic code generation`, `Gin and GRPC`. Sponge has a rich set of code generation commands, and the generated different functional codes can be combined into a complete service (similar to how artificially broken sponge cells can automatically reassemble into a new complete sponge). From development, testing, API documentation to deployment, one-stop project development greatly improves development efficiency and reduces development difficulty, implementation of "low-code way" development projects.
**Sponge** is a powerful development framework that integrates `automatic code generation`, `Gin and GRPC`. Sponge has a rich set of code generation commands, and the generated different functional codes can be combined into a complete service (similar to how artificially broken sponge cells can automatically reassemble into a new complete sponge). From code generation, development, testing, API documentation to deployment, one-stop project development greatly improves development efficiency and reduces development difficulty, implementation of "low-code way" development projects.

<br>

Expand Down
2 changes: 1 addition & 1 deletion assets/install-en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Recommended to use go version 1.2.0 or above, [https://go.dev/doc/install](https://go.dev/doc/install)
Recommended to use go version 1.20 or above, [https://go.dev/doc/install](https://go.dev/doc/install)

<br>

Expand Down
2 changes: 1 addition & 1 deletion assets/readme-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<br>

[sponge](https://github.com/zhufuyi/sponge) 是一个集成了 `自动生成代码``Gin和GRPC` 的强大的开发框架。sponge拥有丰富的生成代码命令,生成不同的功能代码可以组合成完整的服务(类似人为打散的海绵细胞可以自动重组成一个新的海绵)。从开发、测试、api文档到部署一站式项目开发,大幅提高了开发效率和降低了开发难度,实现"低代码方式"进行开发项目。
[sponge](https://github.com/zhufuyi/sponge) 是一个集成了 `自动生成代码``Gin和GRPC` 的强大的开发框架。sponge拥有丰富的生成代码命令,生成不同的功能代码可以组合成完整的服务(类似人为打散的海绵细胞可以自动重组成一个新的海绵)。从生成代码、开发、测试、api文档到部署一站式项目开发,大幅提高了开发效率和降低了开发难度,实现"低代码方式"进行开发项目。

<br>

Expand Down
9 changes: 9 additions & 0 deletions internal/handler/userExample.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func NewUserExampleHandler() UserExampleHandler {
// @Param data body types.CreateUserExampleRequest true "userExample information"
// @Success 200 {object} types.CreateUserExampleRespond{}
// @Router /api/v1/userExample [post]
// @Security BearerAuth
func (h *userExampleHandler) Create(c *gin.Context) {
form := &types.CreateUserExampleRequest{}
err := c.ShouldBindJSON(form)
Expand Down Expand Up @@ -93,6 +94,7 @@ func (h *userExampleHandler) Create(c *gin.Context) {
// @Param id path string true "id"
// @Success 200 {object} types.DeleteUserExampleByIDRespond{}
// @Router /api/v1/userExample/{id} [delete]
// @Security BearerAuth
func (h *userExampleHandler) DeleteByID(c *gin.Context) {
_, id, isAbort := getUserExampleIDFromPath(c)
if isAbort {
Expand Down Expand Up @@ -120,6 +122,7 @@ func (h *userExampleHandler) DeleteByID(c *gin.Context) {
// @Produce json
// @Success 200 {object} types.DeleteUserExamplesByIDsRespond{}
// @Router /api/v1/userExample/delete/ids [post]
// @Security BearerAuth
func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
form := &types.DeleteUserExamplesByIDsRequest{}
err := c.ShouldBindJSON(form)
Expand Down Expand Up @@ -150,6 +153,7 @@ func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
// @Param data body types.UpdateUserExampleByIDRequest true "userExample information"
// @Success 200 {object} types.UpdateUserExampleByIDRespond{}
// @Router /api/v1/userExample/{id} [put]
// @Security BearerAuth
func (h *userExampleHandler) UpdateByID(c *gin.Context) {
_, id, isAbort := getUserExampleIDFromPath(c)
if isAbort {
Expand Down Expand Up @@ -193,6 +197,7 @@ func (h *userExampleHandler) UpdateByID(c *gin.Context) {
// @Produce json
// @Success 200 {object} types.GetUserExampleByIDRespond{}
// @Router /api/v1/userExample/{id} [get]
// @Security BearerAuth
func (h *userExampleHandler) GetByID(c *gin.Context) {
idStr, id, isAbort := getUserExampleIDFromPath(c)
if isAbort {
Expand Down Expand Up @@ -233,6 +238,7 @@ func (h *userExampleHandler) GetByID(c *gin.Context) {
// @Produce json
// @Success 200 {object} types.GetUserExampleByConditionRespond{}
// @Router /api/v1/userExample/condition [post]
// @Security BearerAuth
func (h *userExampleHandler) GetByCondition(c *gin.Context) {
form := &types.GetUserExampleByConditionRequest{}
err := c.ShouldBindJSON(form)
Expand Down Expand Up @@ -281,6 +287,7 @@ func (h *userExampleHandler) GetByCondition(c *gin.Context) {
// @Produce json
// @Success 200 {object} types.ListUserExamplesByIDsRespond{}
// @Router /api/v1/userExample/list/ids [post]
// @Security BearerAuth
func (h *userExampleHandler) ListByIDs(c *gin.Context) {
form := &types.ListUserExamplesByIDsRequest{}
err := c.ShouldBindJSON(form)
Expand Down Expand Up @@ -326,6 +333,7 @@ func (h *userExampleHandler) ListByIDs(c *gin.Context) {
// @Param sort query string false "sort by column name of table, and the "-" sign before column name indicates reverse order" default(-id)
// @Success 200 {object} types.ListUserExamplesRespond{}
// @Router /api/v1/userExample/list [get]
// @Security BearerAuth
func (h *userExampleHandler) ListByLastID(c *gin.Context) {
lastID := utils.StrToUint64(c.Query("lastID"))
if lastID == 0 {
Expand Down Expand Up @@ -365,6 +373,7 @@ func (h *userExampleHandler) ListByLastID(c *gin.Context) {
// @Param data body types.Params true "query parameters"
// @Success 200 {object} types.ListUserExamplesRespond{}
// @Router /api/v1/userExample/list [post]
// @Security BearerAuth
func (h *userExampleHandler) List(c *gin.Context) {
form := &types.ListUserExamplesRequest{}
err := c.ShouldBindJSON(form)
Expand Down
9 changes: 9 additions & 0 deletions internal/handler/userExample.go.mgo
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func NewUserExampleHandler() UserExampleHandler {
// @Param data body types.CreateUserExampleRequest true "userExample information"
// @Success 200 {object} types.CreateUserExampleRespond{}
// @Router /api/v1/userExample [post]
// @Security BearerAuth
func (h *userExampleHandler) Create(c *gin.Context) {
form := &types.CreateUserExampleRequest{}
err := c.ShouldBindJSON(form)
Expand Down Expand Up @@ -94,6 +95,7 @@ func (h *userExampleHandler) Create(c *gin.Context) {
// @Param id path string true "id"
// @Success 200 {object} types.DeleteUserExampleByIDRespond{}
// @Router /api/v1/userExample/{id} [delete]
// @Security BearerAuth
func (h *userExampleHandler) DeleteByID(c *gin.Context) {
id := c.Param("id")
ctx := middleware.WrapCtx(c)
Expand All @@ -116,6 +118,7 @@ func (h *userExampleHandler) DeleteByID(c *gin.Context) {
// @Produce json
// @Success 200 {object} types.DeleteUserExamplesByIDsRespond{}
// @Router /api/v1/userExample/delete/ids [post]
// @Security BearerAuth
func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
form := &types.DeleteUserExamplesByIDsRequest{}
err := c.ShouldBindJSON(form)
Expand Down Expand Up @@ -146,6 +149,7 @@ func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
// @Param data body types.UpdateUserExampleByIDRequest true "userExample information"
// @Success 200 {object} types.UpdateUserExampleByIDRespond{}
// @Router /api/v1/userExample/{id} [put]
// @Security BearerAuth
func (h *userExampleHandler) UpdateByID(c *gin.Context) {
oid := model.ToObjectID(c.Param("id"))
if oid.IsZero() {
Expand Down Expand Up @@ -190,6 +194,7 @@ func (h *userExampleHandler) UpdateByID(c *gin.Context) {
// @Produce json
// @Success 200 {object} types.GetUserExampleByIDRespond{}
// @Router /api/v1/userExample/{id} [get]
// @Security BearerAuth
func (h *userExampleHandler) GetByID(c *gin.Context) {
id := c.Param("id")
ctx := middleware.WrapCtx(c)
Expand Down Expand Up @@ -226,6 +231,7 @@ func (h *userExampleHandler) GetByID(c *gin.Context) {
// @Produce json
// @Success 200 {object} types.GetUserExampleByConditionRespond{}
// @Router /api/v1/userExample/condition [post]
// @Security BearerAuth
func (h *userExampleHandler) GetByCondition(c *gin.Context) {
form := &types.GetUserExampleByConditionRequest{}
err := c.ShouldBindJSON(form)
Expand Down Expand Up @@ -275,6 +281,7 @@ func (h *userExampleHandler) GetByCondition(c *gin.Context) {
// @Produce json
// @Success 200 {object} types.ListUserExamplesByIDsRespond{}
// @Router /api/v1/userExample/list/ids [post]
// @Security BearerAuth
func (h *userExampleHandler) ListByIDs(c *gin.Context) {
form := &types.ListUserExamplesByIDsRequest{}
err := c.ShouldBindJSON(form)
Expand Down Expand Up @@ -320,6 +327,7 @@ func (h *userExampleHandler) ListByIDs(c *gin.Context) {
// @Param sort query string false "sort by column name of table, and the "-" sign before column name indicates reverse order" default(-id)
// @Success 200 {object} types.ListUserExamplesRespond{}
// @Router /api/v1/userExample/list [get]
// @Security BearerAuth
func (h *userExampleHandler) ListByLastID(c *gin.Context) {
lastID := c.Query("lastID")
if lastID == "" {
Expand Down Expand Up @@ -359,6 +367,7 @@ func (h *userExampleHandler) ListByLastID(c *gin.Context) {
// @Param data body types.Params true "query parameters"
// @Success 200 {object} types.ListUserExamplesRespond{}
// @Router /api/v1/userExample/list [post]
// @Security BearerAuth
func (h *userExampleHandler) List(c *gin.Context) {
form := &types.ListUserExamplesRequest{}
err := c.ShouldBindJSON(form)
Expand Down

0 comments on commit b746646

Please sign in to comment.