2ая готова

This commit is contained in:
dex_moth 2024-05-17 23:18:56 +04:00
parent 66bfe560cd
commit 25fdddc6bc

View File

@ -4,8 +4,6 @@ import java.util.Arrays;
import java.util.List;
import org.modelmapper.ModelMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -37,7 +35,10 @@ public class NewController {
}
private NewDto toDto(NewEntity entity) {
return modelMapper.map(entity, NewDto.class);
var tages = entity.getTage().stream().map(TageEntity::getId).toList();
var newdto = modelMapper.map(entity, NewDto.class);
newdto.setTagesId(tages);
return newdto;
}
private NewEntity toEntity(NewDto dto) {