formatting and refactoring

REL-BRANCH-ClubhelperModel-0.0.1
Markus Kreth 5 years ago
parent b020eb3a62
commit 4cf2ac1d88
  1. 10
      src/main/java/de/kreth/clubhelper/model/controller/AttendanceController.java
  2. 8
      src/main/java/de/kreth/clubhelper/model/data/CompetitionType.java

@ -17,9 +17,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.kreth.clubhelper.model.dao.AttendanceDao; import de.kreth.clubhelper.model.dao.AttendanceDao;
import de.kreth.clubhelper.model.dao.PersonDao; import de.kreth.clubhelper.model.dao.PersonDao;
import de.kreth.clubhelper.model.data.Attendance; import de.kreth.clubhelper.model.data.Attendance;
@ -40,13 +37,6 @@ public class AttendanceController {
@ResponseBody @ResponseBody
public List<Attendance> getAttendencesOn(@PathVariable("date") @DateTimeFormat(iso = ISO.DATE) LocalDate date) { public List<Attendance> getAttendencesOn(@PathVariable("date") @DateTimeFormat(iso = ISO.DATE) LocalDate date) {
List<Attendance> findByOnDate = attendanceDao.findByOnDate(date); List<Attendance> findByOnDate = attendanceDao.findByOnDate(date);
ObjectMapper mapper = new ObjectMapper();
try {
String one = mapper.writeValueAsString(findByOnDate.get(0));
System.out.println(one);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return findByOnDate; return findByOnDate;
} }

@ -14,6 +14,8 @@ import javax.persistence.Table;
@Table(name = "clubevent_addon") @Table(name = "clubevent_addon")
public class CompetitionType implements Serializable { public class CompetitionType implements Serializable {
private static final long serialVersionUID = 1L;
@Id @Id
private String id; private String id;
@ -86,16 +88,14 @@ public class CompetitionType implements Serializable {
if (other.id != null) { if (other.id != null) {
return false; return false;
} }
} } else if (!id.equals(other.id)) {
else if (!id.equals(other.id)) {
return false; return false;
} }
if (type == null) { if (type == null) {
if (other.type != null) { if (other.type != null) {
return false; return false;
} }
} } else if (!type.equals(other.type)) {
else if (!type.equals(other.type)) {
return false; return false;
} }
return true; return true;

Loading…
Cancel
Save