add: person route

This commit is contained in:
yystopf 2022-02-12 17:18:06 +08:00
parent dfd2fd9392
commit 2480e99ac3
5 changed files with 13 additions and 4 deletions

View File

@ -34,7 +34,7 @@ var doc = `{
"application/json"
],
"tags": [
"peple"
"people"
],
"summary": "人员列表",
"parameters": [

View File

@ -18,7 +18,7 @@
"application/json"
],
"tags": [
"peple"
"people"
],
"summary": "人员列表",
"parameters": [

View File

@ -73,7 +73,7 @@ paths:
$ref: '#/definitions/model.Person'
summary: 人员列表
tags:
- peple
- people
post:
consumes:
- multipart/form-data

View File

@ -19,7 +19,7 @@ func NewPerson(base *Base) Person {
}
// @Summary 人员列表
// @Tags peple
// @Tags people
// @Description 此接口用来获取人员数据列表,支持名称模糊查询,以及自定义排序(name, created_at)
// @Accept json
// @Produce json

View File

@ -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
}