parent
fa352bbd32
commit
db5d1cb957
@ -1,33 +1,19 @@ |
||||
package de.kreth.clubhelper.model.controller; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.List; |
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import de.kreth.clubhelper.model.dao.AdressDao; |
||||
import de.kreth.clubhelper.model.data.Adress; |
||||
import de.kreth.clubhelper.model.data.Person; |
||||
|
||||
@RestController |
||||
@RequestMapping("/adress") |
||||
@PreAuthorize("isAuthenticated()") |
||||
public class AdressController |
||||
{ |
||||
@Autowired |
||||
private AdressDao adressDao; |
||||
public class AdressController extends AbstractController<Adress, AdressDao> { |
||||
|
||||
public List<Adress> getByParent(Person person) |
||||
{ |
||||
return adressDao.findByPerson(person); |
||||
} |
||||
public AdressController() { |
||||
super(Adress.class); |
||||
} |
||||
|
||||
public void delete(Adress a) |
||||
{ |
||||
a.setDeleted(LocalDateTime.now()); |
||||
adressDao.save(a); |
||||
} |
||||
} |
||||
|
||||
@ -1,33 +1,19 @@ |
||||
package de.kreth.clubhelper.model.controller; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.List; |
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import de.kreth.clubhelper.model.dao.ContactDao; |
||||
import de.kreth.clubhelper.model.data.Contact; |
||||
import de.kreth.clubhelper.model.data.Person; |
||||
|
||||
@RestController |
||||
@RequestMapping("/contact") |
||||
@PreAuthorize("isAuthenticated()") |
||||
public class ContactController |
||||
{ |
||||
@Autowired |
||||
private ContactDao contactDao; |
||||
public class ContactController extends AbstractController<Contact, ContactDao> { |
||||
|
||||
public List<Contact> getByParent(Person person) |
||||
{ |
||||
return contactDao.findByPerson(person); |
||||
} |
||||
public ContactController() { |
||||
super(Contact.class); |
||||
} |
||||
|
||||
public void delete(Contact c) |
||||
{ |
||||
c.setDeleted(LocalDateTime.now()); |
||||
contactDao.save(c); |
||||
} |
||||
} |
||||
|
||||
@ -1,9 +1,13 @@ |
||||
package de.kreth.clubhelper.model.dao; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.springframework.data.repository.CrudRepository; |
||||
|
||||
import de.kreth.clubhelper.model.data.Relative; |
||||
|
||||
public interface RelativeDao extends CrudRepository<Relative, Long> |
||||
{ |
||||
public interface RelativeDao extends CrudRepository<Relative, Long> { |
||||
|
||||
List<Relative> findByPerson1ORPerson2(long personId); |
||||
|
||||
} |
||||
|
||||
Loading…
Reference in new issue