|
|
|
@ -59,7 +59,7 @@ public class StrayAnimalServiceImpl extends ServiceImpl<MiniStrayAnimalMapper, M |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public String saveStrayAnimal(StrayAnimalForm formData, List<MultipartFile> images, List<MultipartFile> videos) { |
|
|
|
// 1. 参数校验
|
|
|
|
validateInput(formData, images, videos); |
|
|
|
validateInput(images, videos); |
|
|
|
|
|
|
|
// 2. 保存流浪动物基本信息
|
|
|
|
MiniStrayAnimal miniStrayAnimal = saveAnimalInfo(formData); |
|
|
|
@ -211,7 +211,7 @@ public class StrayAnimalServiceImpl extends ServiceImpl<MiniStrayAnimalMapper, M |
|
|
|
entity.setWgs84Geohash( GeoHash.withCharacterPrecision(wgs84[1], wgs84[0], CommonConstants.GEOHASH_LEVEL).toBase32()); |
|
|
|
} |
|
|
|
|
|
|
|
private void validateInput(StrayAnimalForm formData, List<MultipartFile> images, List<MultipartFile> videos) { |
|
|
|
private void validateInput(List<MultipartFile> images, List<MultipartFile> videos) { |
|
|
|
// 验证必填图片
|
|
|
|
Assert.notEmpty(images, "需要上传图片"); |
|
|
|
// 验证图片数量
|
|
|
|
|