Ignore:
Timestamp:
02/03/24 18:08:44 (9 months ago)
Author:
Blazho <aleksandar.blazhevski@…>
Branches:
master
Children:
cab1b7d
Parents:
aea04dd
Message:

Posetitelot komentira i dava ocena za recept(https://develop.finki.ukim.mk/projects/cbdb/wiki/useCase11)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/cookbook/service/impl/KomentariServiceImpl.java

    raea04dd rd4d8fb9  
    88
    99import java.sql.SQLException;
     10import java.time.LocalDateTime;
    1011import java.util.List;
    1112
     
    2324        return komentariRepository.findAllByRecId(recId);
    2425    }
     26
     27    @Override
     28    public void add(String telefon, Long id, Integer ocena, String komentar) throws SQLException {
     29        if (telefon.isBlank() || ocena == null){
     30            throw new IllegalArgumentException();
     31        }
     32        komentariRepository.save(new Komentar(LocalDateTime.now(), telefon, id, ocena, komentar));
     33    }
    2534}
Note: See TracChangeset for help on using the changeset viewer.