فهرست منبع

PersonImageFormControllerCapitalisation test

Andrew Grant 1 ماه پیش
والد
کامیت
4bd7dac806

+ 20 - 0
src/main/java/scot/carricksoftware/grants/combined/Combined.java

@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.combined;
+
+public interface Combined {
+    String getContentType();
+
+    void setContentType(String contentType);
+
+    String getOrder();
+
+    void setOrder(String order);
+
+    Long getContentId();
+
+    void setContentId(Long contentId);
+}

+ 26 - 0
src/main/java/scot/carricksoftware/grants/combined/CombinedContentList.java

@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.combined;
+
+import scot.carricksoftware.grants.domains.images.Image;
+
+import java.util.List;
+
+public interface CombinedContentList {
+    @SuppressWarnings("EmptyMethod")
+    void addPersonImage(Image image);
+
+    @SuppressWarnings("EmptyMethod")
+    void addPersonText(List<Image> images);
+
+    @SuppressWarnings("EmptyMethod")
+    void sort();
+
+    List<Combined> getList();
+
+    @SuppressWarnings("EmptyMethod")
+    void clear();
+}

+ 42 - 0
src/main/java/scot/carricksoftware/grants/combined/CombinedContentListImpl.java

@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.combined;
+
+import scot.carricksoftware.grants.domains.images.Image;
+
+import java.util.List;
+
+public class CombinedContentListImpl implements CombinedContentList {
+
+    private List<Combined> combinedList;
+
+    @Override
+    public void addPersonImage(Image image) {
+
+    }
+
+    @Override
+    public void addPersonText(List<Image> images) {
+
+    }
+
+    @Override
+    public void sort() {
+
+    }
+
+    @Override
+    public List<Combined> getList() {
+        return this.combinedList;
+    }
+
+    @Override
+    public void clear() {
+
+    }
+
+
+}

+ 18 - 0
src/main/java/scot/carricksoftware/grants/combined/CombinedContentType.java

@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.combined;
+
+public enum CombinedContentType {
+
+    TEXT("text"),
+    IMAGE("image");
+
+    public final String label;
+
+    CombinedContentType(String label) {
+        this.label = label;
+    }
+}

+ 43 - 0
src/main/java/scot/carricksoftware/grants/combined/CombinedImpl.java

@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.combined;
+
+public class CombinedImpl implements Combined {
+
+    private String contentType;
+    private String order;
+    private Long contentId;
+
+    @Override
+    public String getContentType() {
+        return contentType;
+    }
+
+    @Override
+    public void setContentType(String contentType) {
+        this.contentType = contentType;
+    }
+
+    @Override
+    public String getOrder() {
+        return order;
+    }
+
+    @Override
+    public void setOrder(String order) {
+        this.order = order;
+    }
+
+    @Override
+    public Long getContentId() {
+        return contentId;
+    }
+
+    @Override
+    public void setContentId(Long contentId) {
+        this.contentId = contentId;
+    }
+}

+ 3 - 1
src/main/java/scot/carricksoftware/grants/services/text/persontext/PersonTextServiceImpl.java

@@ -71,7 +71,9 @@ public class PersonTextServiceImpl implements PersonTextService {
     }
 
     private Sort getSort() {
-        return Sort.by(Sort.Direction.ASC, "id");
+        return Sort.by(Sort.Direction.ASC, "person")
+                .and(Sort.by(Sort.Direction.ASC, "order")
+                        .and(Sort.by(Sort.Direction.ASC, "level")));
     }
 
     @Override

+ 18 - 0
src/main/resources/db/changelog/2025/10/14-01-changelog.sql

@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+-- liquibase formatted sql
+
+-- changeset apg:1760427435610-1
+ALTER TABLE person_image
+    ADD caption  VARCHAR(255) NULL,
+    ADD height   VARCHAR(255) NULL,
+    ADD image_id BIGINT       NULL,
+    ADD level    VARCHAR(255) NULL,
+    ADD `order`  VARCHAR(255) NULL,
+    ADD width    VARCHAR(255) NULL;
+
+
+

+ 12 - 0
src/main/resources/db/changelog/2025/10/14-02-changelog.sql

@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+-- liquibase formatted sql
+
+
+-- changeset apg:1760427435610-7
+ALTER TABLE person_image
+    ADD CONSTRAINT FK_PERSONIMAGE_ON_IMAGE FOREIGN KEY (image_id) REFERENCES image (id);
+

+ 2 - 0
src/main/resources/db/changelog/master.xml

@@ -61,6 +61,8 @@
     <include file="/db/changelog/2025/10/02-01-changelog.sql"/>
     <include file="/db/changelog/2025/10/04-01-changelog.sql"/>
     <include file="/db/changelog/2025/10/04-02-changelog.sql"/>
+    <include file="/db/changelog/2025/10/14-01-changelog.sql"/>
+    <include file="/db/changelog/2025/10/14-02-changelog.sql"/>
 
 
 </databaseChangeLog>