- Add the "Datasource" class in the "Task" class and include it in the Assignment that the worker retrieves.
- Update dependencies.
This commit is contained in:
parent
137744a8ce
commit
a4c97dffbf
|
@ -1,11 +1,11 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
springSecurityVersion = "5.4.5"
|
springSecurityVersion = "5.4.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.springframework.boot' version '2.4.3'
|
id 'org.springframework.boot' version '2.4.5'
|
||||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||||
id 'java'
|
id 'java'
|
||||||
}
|
}
|
||||||
|
@ -31,14 +31,14 @@ dependencies {
|
||||||
implementation("io.jsonwebtoken:jjwt:0.9.1")
|
implementation("io.jsonwebtoken:jjwt:0.9.1")
|
||||||
|
|
||||||
|
|
||||||
implementation "org.projectlombok:lombok:1.18.18"
|
implementation "org.projectlombok:lombok:1.18.20"
|
||||||
implementation 'com.google.code.gson:gson:2.8.6'
|
implementation 'com.google.code.gson:gson:2.8.6'
|
||||||
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
|
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
|
||||||
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
|
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
|
||||||
implementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
|
implementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
|
||||||
|
|
||||||
// https://mvnrepository.com/artifact/com.google.guava/guava
|
// https://mvnrepository.com/artifact/com.google.guava/guava
|
||||||
// implementation group: 'com.google.guava', name: 'guava', version: '30.1-jre' // It will be usefull later..
|
// implementation group: 'com.google.guava', name: 'guava', version: '30.1.1-jre' // It will be usefull later..
|
||||||
|
|
||||||
testImplementation group: 'org.springframework.security', name: 'spring-security-test', version: springSecurityVersion
|
testImplementation group: 'org.springframework.security', name: 'spring-security-test', version: springSecurityVersion
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
|
|
|
@ -25,6 +25,8 @@ public class Assignment {
|
||||||
@JsonProperty("date")
|
@JsonProperty("date")
|
||||||
private Date date;
|
private Date date;
|
||||||
|
|
||||||
|
public Assignment() {}
|
||||||
|
|
||||||
public Assignment(List<Task> tasks, String workerId, Date date) {
|
public Assignment(List<Task> tasks, String workerId, Date date) {
|
||||||
this.tasks = tasks;
|
this.tasks = tasks;
|
||||||
this.workerId = workerId;
|
this.workerId = workerId;
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
package eu.openaire.urls_worker.models;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@JsonPropertyOrder({
|
||||||
|
"id",
|
||||||
|
"name"
|
||||||
|
})
|
||||||
|
public class Datasource {
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
String id;
|
||||||
|
|
||||||
|
@JsonProperty("name")
|
||||||
|
String name;
|
||||||
|
|
||||||
|
public Datasource() {}
|
||||||
|
|
||||||
|
public Datasource(String id, String name) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Datasource{" +
|
||||||
|
"id='" + id + '\'' +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -8,7 +8,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@JsonPropertyOrder({
|
@JsonPropertyOrder({
|
||||||
"id",
|
"id",
|
||||||
"url"
|
"url",
|
||||||
|
"datasource"
|
||||||
})
|
})
|
||||||
public class Task {
|
public class Task {
|
||||||
|
|
||||||
|
@ -18,6 +19,17 @@ public class Task {
|
||||||
@JsonProperty("url")
|
@JsonProperty("url")
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
|
@JsonProperty("datasource")
|
||||||
|
private Datasource datasource;
|
||||||
|
|
||||||
|
public Task() {}
|
||||||
|
|
||||||
|
public Task(String id, String url, Datasource datasource) {
|
||||||
|
this.id = id;
|
||||||
|
this.url = url;
|
||||||
|
this.datasource = datasource;
|
||||||
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -34,11 +46,20 @@ public class Task {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Datasource getDatasource() {
|
||||||
|
return datasource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatasource(Datasource datasource) {
|
||||||
|
this.datasource = datasource;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Task{" +
|
return "Task{" +
|
||||||
"id='" + id + '\'' +
|
"id='" + id + '\'' +
|
||||||
", url='" + url + '\'' +
|
", url='" + url + '\'' +
|
||||||
|
", datasource=" + datasource +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ public class AssignmentRequest {
|
||||||
@JsonProperty("assignment")
|
@JsonProperty("assignment")
|
||||||
private Assignment assignment;
|
private Assignment assignment;
|
||||||
|
|
||||||
|
public AssignmentRequest() { }
|
||||||
|
|
||||||
public AssignmentRequest(Assignment assignment) {
|
public AssignmentRequest(Assignment assignment) {
|
||||||
this.assignment = assignment;
|
this.assignment = assignment;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue