- 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 {
|
||||
ext {
|
||||
springSecurityVersion = "5.4.5"
|
||||
springSecurityVersion = "5.4.6"
|
||||
}
|
||||
}
|
||||
|
||||
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 'java'
|
||||
}
|
||||
|
@ -31,14 +31,14 @@ dependencies {
|
|||
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 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: 'commons-io', name: 'commons-io', version: '2.8.0'
|
||||
|
||||
// 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 'org.springframework.boot:spring-boot-starter-test'
|
||||
|
|
|
@ -25,6 +25,8 @@ public class Assignment {
|
|||
@JsonProperty("date")
|
||||
private Date date;
|
||||
|
||||
public Assignment() {}
|
||||
|
||||
public Assignment(List<Task> tasks, String workerId, Date date) {
|
||||
this.tasks = tasks;
|
||||
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)
|
||||
@JsonPropertyOrder({
|
||||
"id",
|
||||
"url"
|
||||
"url",
|
||||
"datasource"
|
||||
})
|
||||
public class Task {
|
||||
|
||||
|
@ -18,6 +19,17 @@ public class Task {
|
|||
@JsonProperty("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() {
|
||||
return id;
|
||||
}
|
||||
|
@ -34,11 +46,20 @@ public class Task {
|
|||
this.url = url;
|
||||
}
|
||||
|
||||
public Datasource getDatasource() {
|
||||
return datasource;
|
||||
}
|
||||
|
||||
public void setDatasource(Datasource datasource) {
|
||||
this.datasource = datasource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Task{" +
|
||||
"id='" + id + '\'' +
|
||||
", url='" + url + '\'' +
|
||||
", datasource=" + datasource +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ public class AssignmentRequest {
|
|||
@JsonProperty("assignment")
|
||||
private Assignment assignment;
|
||||
|
||||
public AssignmentRequest() { }
|
||||
|
||||
public AssignmentRequest(Assignment assignment) {
|
||||
this.assignment = assignment;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue