Compare commits
No commits in common. "841514935c07c4014cdd9f2510b1ca0c45fd90eb" and "01560cd2852eafa8125fd646619965fa6c9a02e4" have entirely different histories.
841514935c
...
01560cd285
@ -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 + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -35,7 +35,7 @@ public class TestResource {
|
|||||||
@GET
|
@GET
|
||||||
@PermitAll
|
@PermitAll
|
||||||
public List<SimpleArchiveTable> gets() throws Exception {
|
public List<SimpleArchiveTable> gets() throws Exception {
|
||||||
return TestResource.data;
|
return this.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@ -43,7 +43,7 @@ public class TestResource {
|
|||||||
@PermitAll
|
@PermitAll
|
||||||
public SimpleArchiveTable get(@PathParam("id") final Long id) throws Exception {
|
public SimpleArchiveTable get(@PathParam("id") final Long id) throws Exception {
|
||||||
LOGGER.info("get({})", id);
|
LOGGER.info("get({})", id);
|
||||||
for (final SimpleArchiveTable elem : TestResource.data) {
|
for (final SimpleArchiveTable elem : this.data) {
|
||||||
if (elem.id.equals(id)) {
|
if (elem.id.equals(id)) {
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
@ -56,9 +56,8 @@ public class TestResource {
|
|||||||
@PermitAll
|
@PermitAll
|
||||||
public SimpleArchiveTable archive(@PathParam("id") final Long id) throws Exception {
|
public SimpleArchiveTable archive(@PathParam("id") final Long id) throws Exception {
|
||||||
LOGGER.info("archive({})", id);
|
LOGGER.info("archive({})", id);
|
||||||
for (final SimpleArchiveTable elem : TestResource.data) {
|
for (final SimpleArchiveTable elem : this.data) {
|
||||||
if (elem.id.equals(id)) {
|
if (elem.id.equals(id)) {
|
||||||
elem.updatedAt = new Date();
|
|
||||||
elem.archive = new Date();
|
elem.archive = new Date();
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
@ -71,9 +70,8 @@ public class TestResource {
|
|||||||
@PermitAll
|
@PermitAll
|
||||||
public SimpleArchiveTable restore(@PathParam("id") final Long id) throws Exception {
|
public SimpleArchiveTable restore(@PathParam("id") final Long id) throws Exception {
|
||||||
LOGGER.info("restore({})", id);
|
LOGGER.info("restore({})", id);
|
||||||
for (final SimpleArchiveTable elem : TestResource.data) {
|
for (final SimpleArchiveTable elem : this.data) {
|
||||||
if (elem.id.equals(id)) {
|
if (elem.id.equals(id)) {
|
||||||
elem.updatedAt = new Date();
|
|
||||||
elem.archive = null;
|
elem.archive = null;
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
@ -86,10 +84,8 @@ public class TestResource {
|
|||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public SimpleArchiveTable post(final SimpleArchiveTable data) throws Exception {
|
public SimpleArchiveTable post(final SimpleArchiveTable data) throws Exception {
|
||||||
LOGGER.info("post(...)");
|
LOGGER.info("post(...)");
|
||||||
data.id = TestResource.uniqueId;
|
data.id = this.uniqueId;
|
||||||
TestResource.uniqueId += 5;
|
this.uniqueId += 5;
|
||||||
data.updatedAt = new Date();
|
|
||||||
data.createdAt = new Date();
|
|
||||||
this.data.add(data);
|
this.data.add(data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -119,7 +115,7 @@ public class TestResource {
|
|||||||
@PermitAll
|
@PermitAll
|
||||||
public void remove(@PathParam("id") final Long id) throws Exception {
|
public void remove(@PathParam("id") final Long id) throws Exception {
|
||||||
LOGGER.info("remove({})", id);
|
LOGGER.info("remove({})", id);
|
||||||
TestResource.data.removeIf(e -> e.id.equals(id));
|
this.data.removeIf(e -> e.id.equals(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user