feat: implement final Resume API
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package com.pablotj.portfolio.domain.home;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class Home {
|
||||
private final HomeId id;
|
||||
private final String title;
|
||||
private final String description;
|
||||
private final String url;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.pablotj.portfolio.domain.home;
|
||||
|
||||
public record HomeId(Long value) {
|
||||
public HomeId {
|
||||
if (value != null && value < 0) throw new IllegalArgumentException("HomeId must be positive");
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.pablotj.portfolio.domain.home.port;
|
||||
|
||||
import com.pablotj.portfolio.domain.home.Home;
|
||||
import com.pablotj.portfolio.domain.home.HomeId;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface HomeRepositoryPort {
|
||||
Home save(Home p);
|
||||
|
||||
Optional<Home> findById(HomeId id);
|
||||
|
||||
List<Home> findAll();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.pablotj.portfolio.domain.resume;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class Resume {
|
||||
private final ResumeId id;
|
||||
private final String name;
|
||||
private final String surnames;
|
||||
private final String title;
|
||||
private final String summary;
|
||||
private final String icon;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.pablotj.portfolio.domain.resume;
|
||||
|
||||
public record ResumeId(Long value) {
|
||||
public ResumeId {
|
||||
if (value != null && value < 0) throw new IllegalArgumentException("ResumeId must be positive");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.pablotj.portfolio.domain.resume.port;
|
||||
|
||||
import com.pablotj.portfolio.domain.resume.Resume;
|
||||
import com.pablotj.portfolio.domain.resume.ResumeId;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface ResumeRepositoryPort {
|
||||
Resume save(Resume p);
|
||||
|
||||
Optional<Resume> findById(ResumeId id);
|
||||
|
||||
List<Resume> findAll();
|
||||
}
|
||||
Reference in New Issue
Block a user