feat: 完成 #38 营销图CRUD接口下载校验与测试
This commit is contained in:
@@ -29,6 +29,10 @@ func (h *DownloadHandler) Create(c *gin.Context) {
|
||||
|
||||
dl, err := h.svc.Create(user.ID, req)
|
||||
if err != nil {
|
||||
if service.IsNotFoundError(err) {
|
||||
c.JSON(http.StatusNotFound, model.Error(http.StatusNotFound, "模板不存在"))
|
||||
return
|
||||
}
|
||||
if service.IsBadRequestError(err) {
|
||||
c.JSON(http.StatusBadRequest, model.Error(http.StatusBadRequest, err.Error()))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user