add: person route
This commit is contained in:
parent
dfd2fd9392
commit
2480e99ac3
|
@ -34,7 +34,7 @@ var doc = `{
|
|||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"peple"
|
||||
"people"
|
||||
],
|
||||
"summary": "人员列表",
|
||||
"parameters": [
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"peple"
|
||||
"people"
|
||||
],
|
||||
"summary": "人员列表",
|
||||
"parameters": [
|
||||
|
|
|
@ -73,7 +73,7 @@ paths:
|
|||
$ref: '#/definitions/model.Person'
|
||||
summary: 人员列表
|
||||
tags:
|
||||
- peple
|
||||
- people
|
||||
post:
|
||||
consumes:
|
||||
- multipart/form-data
|
||||
|
|
|
@ -19,7 +19,7 @@ func NewPerson(base *Base) Person {
|
|||
}
|
||||
|
||||
// @Summary 人员列表
|
||||
// @Tags peple
|
||||
// @Tags people
|
||||
// @Description 此接口用来获取人员数据列表,支持名称模糊查询,以及自定义排序(name, created_at)
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
|
|
|
@ -52,6 +52,15 @@ func InitRouter() *gin.Engine {
|
|||
templates.PATCH("/:id", template.Update)
|
||||
templates.DELETE("/:id", template.Delete)
|
||||
}
|
||||
people := apiRouterGroup.Group("/people")
|
||||
person := api.NewPerson(&base)
|
||||
{
|
||||
people.GET("", person.List)
|
||||
people.POST("", person.Create)
|
||||
people.GET("/:id", person.Get)
|
||||
people.PATCH("/:id", person.Update)
|
||||
people.DELETE("/:id", person.Delete)
|
||||
}
|
||||
|
||||
return Engine
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue