feat:完善项目

This commit is contained in:
henry
2021-11-05 15:27:04 +08:00
parent 873ad8ea2c
commit d20ac3e09f
16 changed files with 465 additions and 13 deletions

View File

@ -50,3 +50,56 @@ func (*Config) Area(c *gin.Context) {
data := config.NewInstance()(getSession()(c).(*service.Session)).Area(form.Key)
APIResponse(nil, data)(c)
}
/**
* @api {post} /api/v1/config/breakdown 故障信息
* @apiVersion 1.0.0
* @apiName ConfigBreakdown
* @apiGroup Config
*
* @apiHeader {string} x-token token
* @apiHeader {string} Content-Type=application/json 传输方式
*
* @apiParam {String} [title="''"] 标题名称
* @apiParam {Number} current 当前页
* @apiParam {Number} page_size 页展示数
*
* @apiSuccess (200) {Number} code 成功响应状态码!
* @apiSuccess (200) {String} msg 成功提示
* @apiSuccess (200) {Array} data 数据信息
* @apiSuccess (200) {String} data.id ID
* @apiSuccess (200) {String} data.title 标题名称
* @apiSuccess (200) {String} data.remark 备注信息
* @apiSuccess (200) {Time} data.created_at 创建时间
*
* @apiSuccessExample {json} Success response:
* HTTPS 200 OK
* {
* "code": 200
* "msg": "ok"
* "data": [
* {
* "id": "m9Qa2ZaOvE",
* "title": "刹车盘",
* "remark": "",
* "created_at": "2021-11-05T14:24:07+08:00",
* }
* ]
* }
*/
func (*Config) Breakdown(c *gin.Context) {
form := &struct {
Title string `json:"title" form:"title"`
PageForm
}{}
if err := bind(form)(c); err != nil {
APIFailure(err.(error))(c)
return
}
data, err := config.NewBreakdown()(getSession()(c).(*service.Session)).List(form.Title, form.Page, form.PageSize)
APIResponse(err, data)(c)
}
func (*Config) BreakdownAdd() {
}