Skip to content

Commit b746646

Browse files
committed
upade docs
1 parent a7fbe48 commit b746646

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

.github/RELEASE.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
## Change log
22

3-
- Add generate grpc+http service code
4-
- Add generate service+handler CRUD code
5-
- Fix known bugs
3+
- Fix bug in generating mongodb CRUD code.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
</div>
1717

18-
**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.
18+
**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.
1919

2020
<br>
2121

assets/install-en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

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

44
<br>
55

assets/readme-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<br>
44

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

77
<br>
88

internal/handler/userExample.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func NewUserExampleHandler() UserExampleHandler {
5757
// @Param data body types.CreateUserExampleRequest true "userExample information"
5858
// @Success 200 {object} types.CreateUserExampleRespond{}
5959
// @Router /api/v1/userExample [post]
60+
// @Security BearerAuth
6061
func (h *userExampleHandler) Create(c *gin.Context) {
6162
form := &types.CreateUserExampleRequest{}
6263
err := c.ShouldBindJSON(form)
@@ -93,6 +94,7 @@ func (h *userExampleHandler) Create(c *gin.Context) {
9394
// @Param id path string true "id"
9495
// @Success 200 {object} types.DeleteUserExampleByIDRespond{}
9596
// @Router /api/v1/userExample/{id} [delete]
97+
// @Security BearerAuth
9698
func (h *userExampleHandler) DeleteByID(c *gin.Context) {
9799
_, id, isAbort := getUserExampleIDFromPath(c)
98100
if isAbort {
@@ -120,6 +122,7 @@ func (h *userExampleHandler) DeleteByID(c *gin.Context) {
120122
// @Produce json
121123
// @Success 200 {object} types.DeleteUserExamplesByIDsRespond{}
122124
// @Router /api/v1/userExample/delete/ids [post]
125+
// @Security BearerAuth
123126
func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
124127
form := &types.DeleteUserExamplesByIDsRequest{}
125128
err := c.ShouldBindJSON(form)
@@ -150,6 +153,7 @@ func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
150153
// @Param data body types.UpdateUserExampleByIDRequest true "userExample information"
151154
// @Success 200 {object} types.UpdateUserExampleByIDRespond{}
152155
// @Router /api/v1/userExample/{id} [put]
156+
// @Security BearerAuth
153157
func (h *userExampleHandler) UpdateByID(c *gin.Context) {
154158
_, id, isAbort := getUserExampleIDFromPath(c)
155159
if isAbort {
@@ -193,6 +197,7 @@ func (h *userExampleHandler) UpdateByID(c *gin.Context) {
193197
// @Produce json
194198
// @Success 200 {object} types.GetUserExampleByIDRespond{}
195199
// @Router /api/v1/userExample/{id} [get]
200+
// @Security BearerAuth
196201
func (h *userExampleHandler) GetByID(c *gin.Context) {
197202
idStr, id, isAbort := getUserExampleIDFromPath(c)
198203
if isAbort {
@@ -233,6 +238,7 @@ func (h *userExampleHandler) GetByID(c *gin.Context) {
233238
// @Produce json
234239
// @Success 200 {object} types.GetUserExampleByConditionRespond{}
235240
// @Router /api/v1/userExample/condition [post]
241+
// @Security BearerAuth
236242
func (h *userExampleHandler) GetByCondition(c *gin.Context) {
237243
form := &types.GetUserExampleByConditionRequest{}
238244
err := c.ShouldBindJSON(form)
@@ -281,6 +287,7 @@ func (h *userExampleHandler) GetByCondition(c *gin.Context) {
281287
// @Produce json
282288
// @Success 200 {object} types.ListUserExamplesByIDsRespond{}
283289
// @Router /api/v1/userExample/list/ids [post]
290+
// @Security BearerAuth
284291
func (h *userExampleHandler) ListByIDs(c *gin.Context) {
285292
form := &types.ListUserExamplesByIDsRequest{}
286293
err := c.ShouldBindJSON(form)
@@ -326,6 +333,7 @@ func (h *userExampleHandler) ListByIDs(c *gin.Context) {
326333
// @Param sort query string false "sort by column name of table, and the "-" sign before column name indicates reverse order" default(-id)
327334
// @Success 200 {object} types.ListUserExamplesRespond{}
328335
// @Router /api/v1/userExample/list [get]
336+
// @Security BearerAuth
329337
func (h *userExampleHandler) ListByLastID(c *gin.Context) {
330338
lastID := utils.StrToUint64(c.Query("lastID"))
331339
if lastID == 0 {
@@ -365,6 +373,7 @@ func (h *userExampleHandler) ListByLastID(c *gin.Context) {
365373
// @Param data body types.Params true "query parameters"
366374
// @Success 200 {object} types.ListUserExamplesRespond{}
367375
// @Router /api/v1/userExample/list [post]
376+
// @Security BearerAuth
368377
func (h *userExampleHandler) List(c *gin.Context) {
369378
form := &types.ListUserExamplesRequest{}
370379
err := c.ShouldBindJSON(form)

internal/handler/userExample.go.mgo

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func NewUserExampleHandler() UserExampleHandler {
5757
// @Param data body types.CreateUserExampleRequest true "userExample information"
5858
// @Success 200 {object} types.CreateUserExampleRespond{}
5959
// @Router /api/v1/userExample [post]
60+
// @Security BearerAuth
6061
func (h *userExampleHandler) Create(c *gin.Context) {
6162
form := &types.CreateUserExampleRequest{}
6263
err := c.ShouldBindJSON(form)
@@ -94,6 +95,7 @@ func (h *userExampleHandler) Create(c *gin.Context) {
9495
// @Param id path string true "id"
9596
// @Success 200 {object} types.DeleteUserExampleByIDRespond{}
9697
// @Router /api/v1/userExample/{id} [delete]
98+
// @Security BearerAuth
9799
func (h *userExampleHandler) DeleteByID(c *gin.Context) {
98100
id := c.Param("id")
99101
ctx := middleware.WrapCtx(c)
@@ -116,6 +118,7 @@ func (h *userExampleHandler) DeleteByID(c *gin.Context) {
116118
// @Produce json
117119
// @Success 200 {object} types.DeleteUserExamplesByIDsRespond{}
118120
// @Router /api/v1/userExample/delete/ids [post]
121+
// @Security BearerAuth
119122
func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
120123
form := &types.DeleteUserExamplesByIDsRequest{}
121124
err := c.ShouldBindJSON(form)
@@ -146,6 +149,7 @@ func (h *userExampleHandler) DeleteByIDs(c *gin.Context) {
146149
// @Param data body types.UpdateUserExampleByIDRequest true "userExample information"
147150
// @Success 200 {object} types.UpdateUserExampleByIDRespond{}
148151
// @Router /api/v1/userExample/{id} [put]
152+
// @Security BearerAuth
149153
func (h *userExampleHandler) UpdateByID(c *gin.Context) {
150154
oid := model.ToObjectID(c.Param("id"))
151155
if oid.IsZero() {
@@ -190,6 +194,7 @@ func (h *userExampleHandler) UpdateByID(c *gin.Context) {
190194
// @Produce json
191195
// @Success 200 {object} types.GetUserExampleByIDRespond{}
192196
// @Router /api/v1/userExample/{id} [get]
197+
// @Security BearerAuth
193198
func (h *userExampleHandler) GetByID(c *gin.Context) {
194199
id := c.Param("id")
195200
ctx := middleware.WrapCtx(c)
@@ -226,6 +231,7 @@ func (h *userExampleHandler) GetByID(c *gin.Context) {
226231
// @Produce json
227232
// @Success 200 {object} types.GetUserExampleByConditionRespond{}
228233
// @Router /api/v1/userExample/condition [post]
234+
// @Security BearerAuth
229235
func (h *userExampleHandler) GetByCondition(c *gin.Context) {
230236
form := &types.GetUserExampleByConditionRequest{}
231237
err := c.ShouldBindJSON(form)
@@ -275,6 +281,7 @@ func (h *userExampleHandler) GetByCondition(c *gin.Context) {
275281
// @Produce json
276282
// @Success 200 {object} types.ListUserExamplesByIDsRespond{}
277283
// @Router /api/v1/userExample/list/ids [post]
284+
// @Security BearerAuth
278285
func (h *userExampleHandler) ListByIDs(c *gin.Context) {
279286
form := &types.ListUserExamplesByIDsRequest{}
280287
err := c.ShouldBindJSON(form)
@@ -320,6 +327,7 @@ func (h *userExampleHandler) ListByIDs(c *gin.Context) {
320327
// @Param sort query string false "sort by column name of table, and the "-" sign before column name indicates reverse order" default(-id)
321328
// @Success 200 {object} types.ListUserExamplesRespond{}
322329
// @Router /api/v1/userExample/list [get]
330+
// @Security BearerAuth
323331
func (h *userExampleHandler) ListByLastID(c *gin.Context) {
324332
lastID := c.Query("lastID")
325333
if lastID == "" {
@@ -359,6 +367,7 @@ func (h *userExampleHandler) ListByLastID(c *gin.Context) {
359367
// @Param data body types.Params true "query parameters"
360368
// @Success 200 {object} types.ListUserExamplesRespond{}
361369
// @Router /api/v1/userExample/list [post]
370+
// @Security BearerAuth
362371
func (h *userExampleHandler) List(c *gin.Context) {
363372
form := &types.ListUserExamplesRequest{}
364373
err := c.ShouldBindJSON(form)

0 commit comments

Comments
 (0)