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