feat:完善项目
This commit is contained in:
@ -43,44 +43,52 @@ type (
|
||||
*
|
||||
* @apiParam {String} [parent_id="''"] 父集ID
|
||||
* @apiParam {String} [title="''"] 名称
|
||||
* @apiParam {Number} current 当前页
|
||||
* @apiParam {Number} page_size 页展示数
|
||||
*
|
||||
* @apiSuccess (200) {Object} data 数据信息
|
||||
* @apiSuccess (200) {Object} data.data 具体信息
|
||||
* @apiSuccess (200) {String} data.data.id ID
|
||||
* @apiSuccess (200) {String} data.data.code 装备编码
|
||||
* @apiSuccess (200) {String} data.data.title 装备名称
|
||||
* @apiSuccess (200) {String} data.data.image 装备图片
|
||||
* @apiSuccess (200) {String} data.data.created_at 创建时间
|
||||
* @apiSuccess (200) {Object} data.data.childrens 子集
|
||||
* @apiSuccess (200) {Number} data.count 总数
|
||||
* @apiSuccess (200) {Number} code 成功响应状态码!
|
||||
* @apiSuccess (200) {String} msg 成功提示
|
||||
* @apiSuccess (200) {Object} data 数据信息
|
||||
* @apiSuccess (200) {String} data.id ID
|
||||
* @apiSuccess (200) {String} data.code 装备编码
|
||||
* @apiSuccess (200) {String} data.title 装备名称
|
||||
* @apiSuccess (200) {String} data.image 装备图片
|
||||
* @apiSuccess (200) {String} data.created_at 创建时间
|
||||
* @apiSuccess (200) {Object} data.childrens 子集
|
||||
*
|
||||
* @apiSuccessExample {json} Success response:
|
||||
* HTTPS 200 OK
|
||||
* {
|
||||
* "code": 200
|
||||
* "msg": "ok"
|
||||
* "data": [
|
||||
* {
|
||||
* "id": "EgmJ4Ga7LQ",
|
||||
* "code": "S110",
|
||||
* "title": "装甲车-11",
|
||||
* "image": "http://192.168.31.195:8030/",
|
||||
* "created_at": "2021-11-09T13:39:19+08:00",
|
||||
* "children": []
|
||||
* }
|
||||
* ]
|
||||
* "data": {
|
||||
* "data": [
|
||||
* {
|
||||
* "id": "EgmJ4Ga7LQ",
|
||||
* "code": "S110",
|
||||
* "title": "装甲车-11",
|
||||
* "image": "http://192.168.31.195:8030/",
|
||||
* "created_at": "2021-11-09T13:39:19+08:00",
|
||||
* "children": []
|
||||
* }
|
||||
* ],
|
||||
* "count": 1
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
func (*Manage) Equipment(c *gin.Context) {
|
||||
form := &struct {
|
||||
ParentID uint64 `json:"parent_id" form:"parent_id"`
|
||||
Title string `json:"title" form:"title"`
|
||||
PageForm
|
||||
}{}
|
||||
if err := bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := manage.NewEquipment()(getSession()(c).(*service.Session)).List(form.ParentID, form.Title)
|
||||
data, err := manage.NewEquipment()(getSession()(c).(*service.Session)).List(form.ParentID, form.Title, form.Page, form.PageSize)
|
||||
APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
@ -94,8 +102,6 @@ func (*Manage) Equipment(c *gin.Context) {
|
||||
*
|
||||
* @apiParam {String} [id="''"] 区域标识
|
||||
*
|
||||
* @apiSuccess (200) {Number} code 成功响应状态码!
|
||||
* @apiSuccess (200) {String} msg 成功提示
|
||||
* @apiSuccess (200) {Object} data 数据信息
|
||||
* @apiSuccess (200) {String} data.id ID
|
||||
* @apiSuccess (200) {String} data.code 装备编码
|
||||
@ -108,6 +114,8 @@ func (*Manage) Equipment(c *gin.Context) {
|
||||
* @apiSuccess (200) {String} data.materials.title 器材名称
|
||||
* @apiSuccess (200) {Number} data.materials.unit 器材单位
|
||||
* @apiSuccess (200) {String} data.materials.manufacturer_name 器材制造商
|
||||
* @apiSuccess (200) {Number} code 成功响应状态码!
|
||||
* @apiSuccess (200) {String} msg 成功提示
|
||||
*
|
||||
* @apiSuccessExample {json} Success response:
|
||||
* HTTPS 200 OK
|
||||
|
Reference in New Issue
Block a user