refactor: Used UUID for contest ID
Replaced int ID with UUID on contest galleries Closes FS-28
This commit is contained in:
parent
71a623b19b
commit
7ff594a7a4
@ -1,13 +1,14 @@
|
|||||||
package io.salmonllama.fashionscapeapi.model;
|
package io.salmonllama.fashionscapeapi.model;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "contest_gallery")
|
@Table(name = "contest_gallery")
|
||||||
public class ContestGallery {
|
public class ContestGallery {
|
||||||
private int id;
|
private UUID id;
|
||||||
private String contestName;
|
private String contestName;
|
||||||
private Timestamp created;
|
private Timestamp created;
|
||||||
private Timestamp contestClose;
|
private Timestamp contestClose;
|
||||||
@ -17,10 +18,10 @@ public class ContestGallery {
|
|||||||
public ContestGallery() {}
|
public ContestGallery() {}
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.UUID)
|
@GeneratedValue
|
||||||
@Column(name = "id")
|
@Column(name = "id")
|
||||||
public int getId() { return id; }
|
public UUID getId() { return id; }
|
||||||
public ContestGallery setId(int id) {
|
public ContestGallery setId(UUID id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,7 @@ package io.salmonllama.fashionscapeapi.repository;
|
|||||||
import io.salmonllama.fashionscapeapi.model.ContestGallery;
|
import io.salmonllama.fashionscapeapi.model.ContestGallery;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
public interface ContestGalleryRepository extends JpaRepository<ContestGallery, Integer> {
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public interface ContestGalleryRepository extends JpaRepository<ContestGallery, UUID> {
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user