func (invoiceheaderApi *InvoiceheaderApi) FindInvoiceheader(c *gin.Context) { var invoiceheader invoiceheader.InvoiceHeader _ = c.ShouldBindQuery(&invoiceheader) if rebanner, err := invoiceheaderService.GetInvoiceheader(invoiceheader.ID); err != nil { global.GVA_LOG.Error("查询失败!", zap.Error(err)) response.FailWithMessage("查询失败", c) } else { response.OkWithData(gin.H{"rebanner": rebanner}, c) } }是什么意思
时间: 2023-06-02 12:01:59 浏览: 101
bubble_gin+gorm学习项目_未分层.rar
&invoiceheader)
if err := invoiceheaderApi.invoiceheaderService.Validate(invoiceheader); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
invoiceheader, err := invoiceheaderApi.invoiceheaderService.FindInvoiceheader(invoiceheader.ID)
if err != nil {
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, invoiceheader)
}
阅读全文