|
|
@@ -6,6 +6,7 @@ import cn.reghao.tnb.common.db.SelectOption;
|
|
|
import cn.reghao.tnb.content.api.dto.geo.MallReplyDto;
|
|
|
import cn.reghao.tnb.content.app.geo.db.mapper.CameraPhotoMapper;
|
|
|
import cn.reghao.tnb.content.app.geo.db.mapper.MallReplyMapper;
|
|
|
+import cn.reghao.tnb.content.app.geo.db.repository.MallReplyRepository;
|
|
|
import cn.reghao.tnb.content.app.geo.model.constant.GeoItem;
|
|
|
import cn.reghao.tnb.content.app.geo.model.po.CameraPhoto;
|
|
|
import cn.reghao.tnb.content.app.geo.model.po.MallReply;
|
|
|
@@ -33,10 +34,13 @@ public class PhotoMapService {
|
|
|
|
|
|
private final MallReplyMapper mallReplyMapper;
|
|
|
private final CameraPhotoMapper cameraPhotoMapper;
|
|
|
+ private MallReplyRepository mallReplyRepository;
|
|
|
|
|
|
- public PhotoMapService(MallReplyMapper mallReplyMapper, CameraPhotoMapper cameraPhotoMapper) {
|
|
|
+ public PhotoMapService(MallReplyMapper mallReplyMapper, CameraPhotoMapper cameraPhotoMapper,
|
|
|
+ MallReplyRepository mallReplyRepository) {
|
|
|
this.mallReplyMapper = mallReplyMapper;
|
|
|
this.cameraPhotoMapper = cameraPhotoMapper;
|
|
|
+ this.mallReplyRepository = mallReplyRepository;
|
|
|
}
|
|
|
|
|
|
public synchronized void addTmallReply(MallReplyDto mallReplyDto) {
|
|
|
@@ -66,16 +70,10 @@ public class PhotoMapService {
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
if (!list.isEmpty()) {
|
|
|
- saveTmallReply(mallReply, list);
|
|
|
+ mallReplyRepository.saveTmallReply(mallReply, list);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public void saveTmallReply(MallReply mallReply, List<CameraPhoto> list) {
|
|
|
- mallReplyMapper.save(mallReply);
|
|
|
- cameraPhotoMapper.saveAll(list);
|
|
|
- }
|
|
|
-
|
|
|
@Cacheable(cacheNames = "tnb:geo:mark", key = "#itemType", unless = "#result == null")
|
|
|
public List<MapMarker> getPhotoMarks(int itemType) {
|
|
|
int pageSize = 100;
|