rework ui

This commit is contained in:
verboomp
2026-01-29 07:08:44 +01:00
parent ca514eea67
commit 38979c99e5
19 changed files with 457 additions and 293 deletions

View File

@@ -39,8 +39,11 @@ public class Picture extends AbstractDateEntity {
@Basic(fetch = FetchType.LAZY)
private String comment;
@Column(name = "evaluation")
private Integer evaluation;
@Column
private String category;
@Column(name = "image")
@@ -82,8 +85,14 @@ public class Picture extends AbstractDateEntity {
public void setComment(String comment) {
this.comment = comment;
}
public Integer getEvaluation() {
return evaluation;
}
public void setEvaluation(Integer evaluation) {
this.evaluation = evaluation;
}
public String getCategory() {
return category;
@@ -124,6 +133,10 @@ public class Picture extends AbstractDateEntity {
public static class Builder {
private Picture instance = new Picture();
public Builder(){
instance.evaluation = 0;
}
public Builder username(String username) {
instance.setUsername(username);
@@ -134,7 +147,7 @@ public class Picture extends AbstractDateEntity {
instance.setPictureDate(pictureDate);
return this;
}
public Builder comment(String comment) {
instance.setComment(comment);
return this;
@@ -149,7 +162,7 @@ public class Picture extends AbstractDateEntity {
instance.setImage(image);
return this;
}
public Builder customer(Customer customer) {
instance.setCustomer(customer);
return this;

View File

@@ -16,12 +16,12 @@ import marketing.heyday.hartmann.fotodocumentation.core.model.Picture;
*/
@Schema(name = "Picture")
public record PictureValue(Long id, String comment, String category, String image, Date pictureDate, String username) {
public record PictureValue(Long id, String comment, String category, String image, Date pictureDate, String username, Integer evaluation) {
public static PictureValue builder(Picture picture) {
if (picture == null) {
return null;
}
return new PictureValue(picture.getPictureId(), picture.getComment(), picture.getCategory(), picture.getImage(), picture.getPictureDate(), picture.getUsername());
return new PictureValue(picture.getPictureId(), picture.getComment(), picture.getCategory(), picture.getImage(), picture.getPictureDate(), picture.getUsername(), picture.getEvaluation());
}
}

View File

@@ -0,0 +1,8 @@
-- picture
alter table picture add column evaluation bigint;
update picture set evaluation = 0;
alter table picture alter column evaluation set not null;