feat: 完成 #38 营销图CRUD接口下载校验与测试

This commit is contained in:
root
2026-03-09 19:17:01 +08:00
parent e14255cf64
commit efff6eb7d4
4 changed files with 156 additions and 4 deletions
@@ -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