| | |
| | | |
| | | // GetPurchaseList |
| | | // @Tags Purchase |
| | | // @Summary 分页获取权限采购单列表 |
| | | // @Summary 分页获取采购单列表 |
| | | // @Security ApiKeyAuth |
| | | // @accept application/json |
| | | // @Produce application/json |
| | | // @Param data query request.PageInfo true "页码, 每页大小" |
| | | // @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取权限采购单列表,返回包括列表,总数,页码,每页数量" |
| | | // @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取采购单列表,返回包括列表,总数,页码,每页数量" |
| | | // @Router /purchase/purchaseList [get] |
| | | func (e *PurchaseApi) GetPurchaseList(c *gin.Context) { |
| | | var pageInfo request.PageInfo |
| | |
| | | PageSize: pageInfo.PageSize, |
| | | }, "获取成功", c) |
| | | } |
| | | |
| | | // Submit |
| | | // @Tags Purchase |
| | | // @Summary 提交采购单 |
| | | // @Security ApiKeyAuth |
| | | // @accept application/json |
| | | // @Produce application/json |
| | | // @Param id path int true "采购单ID" |
| | | // @Success 200 {object} response.Response{msg=string} "提交采购单" |
| | | // @Router /purchase/submit/{id} [post] |
| | | func (e *PurchaseApi) Submit(c *gin.Context) { |
| | | var params purchaserequest.AddPurchase |
| | | err := c.ShouldBindJSON(¶ms) |
| | | if err != nil { |
| | | response.FailWithMessage(err.Error(), c) |
| | | return |
| | | } |
| | | err = utils.Verify(params.Purchase.GVA_MODEL, utils.IdVerify) |
| | | if err != nil { |
| | | response.FailWithMessage(err.Error(), c) |
| | | return |
| | | } |
| | | err = service.NewPurchaseService().UpdatePurchase(¶ms) |
| | | if err != nil { |
| | | global.GVA_LOG.Error("更新失败!", zap.Error(err)) |
| | | response.FailWithMessage("更新失败", c) |
| | | return |
| | | } |
| | | response.OkWithMessage("更新成功", c) |
| | | } |