fixes and clean up

This commit is contained in:
2025-12-08 13:04:16 -05:00
parent 70a2d61685
commit 3fbd89309b
8 changed files with 40 additions and 188 deletions

View File

@@ -1,4 +1,4 @@
package group.goforward.battlbuilder.web;
package group.goforward.battlbuilder.controllers;
import group.goforward.battlbuilder.services.GunbuilderProductService;
import group.goforward.battlbuilder.web.dto.GunbuilderProductDto;

View File

@@ -1,4 +1,4 @@
package group.goforward.battlbuilder.web;
package group.goforward.battlbuilder.controllers;
import group.goforward.battlbuilder.services.PartRoleMappingService;
import group.goforward.battlbuilder.web.dto.admin.PartRoleMappingDto;

View File

@@ -1,4 +1,4 @@
package group.goforward.battlbuilder.controllers;
package group.goforward.battlbuilder.controllers.utils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@@ -1,96 +0,0 @@
package group.goforward.battlbuilder.model;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import org.hibernate.annotations.ColumnDefault;
import java.time.Instant;
import java.util.UUID;
@Entity
@Table(name = "builds_components")
public class BuildsComponent {
@Id
@Column(name = "id", nullable = false)
private Integer id;
@Column(name = "build_id", nullable = false)
private Integer buildId;
@Column(name = "product_id", nullable = false)
private Integer productId;
@ColumnDefault("now()")
@Column(name = "updated_at", nullable = false)
private Instant updatedAt;
@ColumnDefault("now()")
@Column(name = "created_at", nullable = false)
private Instant createdAt;
@Column(name = "deleted_at")
private Instant deletedAt;
@ColumnDefault("gen_random_uuid()")
@Column(name = "uuid")
private UUID uuid;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getBuildId() {
return buildId;
}
public void setBuildId(Integer buildId) {
this.buildId = buildId;
}
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public Instant getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Instant updatedAt) {
this.updatedAt = updatedAt;
}
public Instant getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
}
public Instant getDeletedAt() {
return deletedAt;
}
public void setDeletedAt(Instant deletedAt) {
this.deletedAt = deletedAt;
}
public UUID getUuid() {
return uuid;
}
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
}

View File

@@ -1,85 +0,0 @@
package group.goforward.battlbuilder.model;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import org.hibernate.annotations.ColumnDefault;
import java.time.Instant;
import java.util.UUID;
@Entity
@Table(name = "component_type")
public class ComponentType {
@Id
@Column(name = "id", nullable = false)
private Integer id;
@Column(name = "name", nullable = false, length = 100)
private String name;
@ColumnDefault("now()")
@Column(name = "updated_at", nullable = false)
private Instant updatedAt;
@ColumnDefault("now()")
@Column(name = "created_at", nullable = false)
private Instant createdAt;
@Column(name = "deleted_at")
private Instant deletedAt;
@ColumnDefault("gen_random_uuid()")
@Column(name = "uuid")
private UUID uuid;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Instant getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Instant updatedAt) {
this.updatedAt = updatedAt;
}
public Instant getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
}
public Instant getDeletedAt() {
return deletedAt;
}
public void setDeletedAt(Instant deletedAt) {
this.deletedAt = deletedAt;
}
public UUID getUuid() {
return uuid;
}
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
}

View File

@@ -1,12 +1,12 @@
package group.goforward.battlbuilder.repos;
import group.goforward.battlbuilder.model.BuildsComponent;
import group.goforward.battlbuilder.model.BuildItem;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
public interface BuildItemRepository extends JpaRepository<BuildsComponent, Integer> {
List<BuildsComponent> findByBuildId(Integer buildId);
Optional<BuildsComponent> findByUuid(UUID uuid);
public interface BuildItemRepository extends JpaRepository<BuildItem, Integer> {
List<BuildItem> findByBuildId(Integer buildId);
Optional<BuildItem> findByUuid(UUID uuid);
}

View File

@@ -0,0 +1,13 @@
/**
* Provides the classes necessary for the Spring Services implementations for the ballistic -Builder application.
* This package includes Services implementations for Spring-Boot application
*
*
* <p>The main entry point for managing the inventory is the
* {@link group.goforward.battlbuilder.BattlBuilderApplication} class.</p>
*
* @since 1.0
* @author Don Strawsburg
* @version 1.1
*/
package group.goforward.battlbuilder.services.admin;

View File

@@ -0,0 +1,20 @@
package group.goforward.battlbuilder.utils;
import org.springframework.context.annotation.Bean;
public class Counter {
Integer count = 0;
public void addOne() {
count +=1;
}
public Integer getCount() {
return count;
}
private void setCount(Integer count) {
this.count = count;
}
}