Ignore:
Timestamp:
07/07/23 12:14:58 (16 months ago)
Author:
HristijanMitic00 <hristijan.mitic.01@…>
Branches:
main
Parents:
1dd9226
Message:

First commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/project/fmo/app/projcetfmo/Service/impl/DostavaServiceImpl.java

    r1dd9226 rd14176d  
    1 package project.fmo.app.projcetfmo.Service.impl;public class DostavaServiceImpl {
     1package project.fmo.app.projcetfmo.Service.impl;
     2
     3import org.springframework.stereotype.Service;
     4import project.fmo.app.projcetfmo.Model.Dostava;
     5import project.fmo.app.projcetfmo.Model.Dostavuvac;
     6import project.fmo.app.projcetfmo.Repository.DostavaRepository;
     7import project.fmo.app.projcetfmo.Service.DostavaService;
     8
     9import java.util.List;
     10
     11@Service
     12public class DostavaServiceImpl implements DostavaService {
     13
     14    private final DostavaRepository dostavaRepository;
     15
     16    public DostavaServiceImpl(DostavaRepository dostavaRepository) {
     17        this.dostavaRepository = dostavaRepository;
     18    }
     19
     20    @Override
     21    public List<Dostava> findByIdKorisnikAndStatus(Dostavuvac dostavuvac, String status) {
     22        return dostavaRepository.findByDostavuvacAndStatus(dostavuvac,status);
     23    }
     24
     25    @Override
     26    public Dostava edit(Integer id) {
     27        Dostava d = dostavaRepository.findById(id).orElse(null);
     28        assert d != null;
     29        d.setStatus("dostavena");
     30        dostavaRepository.save(d);
     31        return d;
     32    }
    233}
Note: See TracChangeset for help on using the changeset viewer.