优化
This commit is contained in:
@@ -71,6 +71,12 @@ func (h *Export) Delete(c *gin.Context) {
|
||||
httpx.Fail(c, err.Error())
|
||||
return
|
||||
}
|
||||
// Deleting an empty model is rejected by GORM's global-update guard in the
|
||||
// reference endpoint. Preserve the same externally visible failure.
|
||||
if req.ID == 0 {
|
||||
httpx.Fail(c, "删除失败")
|
||||
return
|
||||
}
|
||||
if err := h.service.Delete(c.Request.Context(), []uint{req.ID}); err != nil {
|
||||
httpx.Fail(c, "删除失败")
|
||||
return
|
||||
@@ -103,7 +109,11 @@ func (h *Export) Find(c *gin.Context) {
|
||||
httpx.OKWithData(c, gin.H{"resysExportTemplate": item})
|
||||
}
|
||||
func (h *Export) List(c *gin.Context) {
|
||||
p, size := page(c)
|
||||
p, size, err := page(c)
|
||||
if err != nil {
|
||||
httpx.Fail(c, err.Error())
|
||||
return
|
||||
}
|
||||
start, startErr := parseTime(c.Query("startCreatedAt"))
|
||||
end, endErr := parseTime(c.Query("endCreatedAt"))
|
||||
if startErr != nil || endErr != nil {
|
||||
|
||||
Reference in New Issue
Block a user