新增菜品
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.sky.controller.admin;
|
package com.sky.controller.admin;
|
||||||
|
|
||||||
|
import com.sky.constant.MessageConstant;
|
||||||
import com.sky.result.Result;
|
import com.sky.result.Result;
|
||||||
import com.sky.utils.AliOssUtil;
|
import com.sky.utils.AliOssUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -43,7 +44,7 @@ public class CommonController {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("文件上传失败: " + e);
|
log.error("文件上传失败: " + e);
|
||||||
}
|
}
|
||||||
return null;
|
return Result.error(MessageConstant.UPLOAD_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.sky.mapper;
|
package com.sky.mapper;
|
||||||
|
|
||||||
|
import com.sky.annotation.AutoFill;
|
||||||
|
import com.sky.entity.Dish;
|
||||||
|
import com.sky.enumeration.OperationType;
|
||||||
|
import org.apache.ibatis.annotations.Insert;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
@@ -14,4 +18,10 @@ public interface DishMapper {
|
|||||||
@Select("select count(id) from dish where category_id = #{categoryId}")
|
@Select("select count(id) from dish where category_id = #{categoryId}")
|
||||||
Integer countByCategoryId(Long categoryId);
|
Integer countByCategoryId(Long categoryId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入菜品数据
|
||||||
|
* @param dish
|
||||||
|
*/
|
||||||
|
@AutoFill(OperationType.INSERT)
|
||||||
|
void insert(Dish dish);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user