Compare commits

..

No commits in common. "841514935c07c4014cdd9f2510b1ca0c45fd90eb" and "01560cd2852eafa8125fd646619965fa6c9a02e4" have entirely different histories.

2 changed files with 7 additions and 28 deletions

View File

@ -1,17 +0,0 @@
package test.kar.archidata.apiExtern.model;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Date;
public class DataTimes {
public Date time;
public Timestamp date;
public LocalDateTime dateTime;
@Override
public String toString() {
return "DataForJSR310 [time=" + this.time + ", date=" + this.date + ", dateTime=" + this.dateTime + "]";
}
}

View File

@ -35,7 +35,7 @@ public class TestResource {
@GET
@PermitAll
public List<SimpleArchiveTable> gets() throws Exception {
return TestResource.data;
return this.data;
}
@GET
@ -43,7 +43,7 @@ public class TestResource {
@PermitAll
public SimpleArchiveTable get(@PathParam("id") final Long id) throws Exception {
LOGGER.info("get({})", id);
for (final SimpleArchiveTable elem : TestResource.data) {
for (final SimpleArchiveTable elem : this.data) {
if (elem.id.equals(id)) {
return elem;
}
@ -56,9 +56,8 @@ public class TestResource {
@PermitAll
public SimpleArchiveTable archive(@PathParam("id") final Long id) throws Exception {
LOGGER.info("archive({})", id);
for (final SimpleArchiveTable elem : TestResource.data) {
for (final SimpleArchiveTable elem : this.data) {
if (elem.id.equals(id)) {
elem.updatedAt = new Date();
elem.archive = new Date();
return elem;
}
@ -71,9 +70,8 @@ public class TestResource {
@PermitAll
public SimpleArchiveTable restore(@PathParam("id") final Long id) throws Exception {
LOGGER.info("restore({})", id);
for (final SimpleArchiveTable elem : TestResource.data) {
for (final SimpleArchiveTable elem : this.data) {
if (elem.id.equals(id)) {
elem.updatedAt = new Date();
elem.archive = null;
return elem;
}
@ -86,10 +84,8 @@ public class TestResource {
@Consumes(MediaType.APPLICATION_JSON)
public SimpleArchiveTable post(final SimpleArchiveTable data) throws Exception {
LOGGER.info("post(...)");
data.id = TestResource.uniqueId;
TestResource.uniqueId += 5;
data.updatedAt = new Date();
data.createdAt = new Date();
data.id = this.uniqueId;
this.uniqueId += 5;
this.data.add(data);
return data;
}
@ -119,7 +115,7 @@ public class TestResource {
@PermitAll
public void remove(@PathParam("id") final Long id) throws Exception {
LOGGER.info("remove({})", id);
TestResource.data.removeIf(e -> e.id.equals(id));
this.data.removeIf(e -> e.id.equals(id));
}
}