Got initial framework running
Some checks failed
Build / build (push) Failing after 9s

This commit is contained in:
2025-06-04 09:43:53 +02:00
parent ed68ead1fb
commit 20bd00f67b
14 changed files with 133 additions and 122 deletions

View File

@@ -27,6 +27,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
compileOnly("org.projectlombok:lombok")
developmentOnly("org.springframework.boot:spring-boot-devtools")
runtimeOnly("org.postgresql:postgresql")

View File

@@ -2,8 +2,8 @@ services:
database:
image: postgres:latest
environment:
POSTGRES_USER: pcinvj
POSTGRES_PASSWORD: pcinvj
POSTGRES_DB: pcinvj
POSTGRES_USER: pcinv
POSTGRES_PASSWORD: pcinv
POSTGRES_DB: pcinv
ports:
- "5432:5432"

10
pcinvj/pcinv/.idea/.gitignore generated vendored
View File

@@ -1,10 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Environment-dependent path to Maven home directory
/mavenHomeManager.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
</GradleProjectSettings>
</option>
</component>
</project>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/pcinv.iml" filepath="$PROJECT_DIR$/pcinv.iml" />
</modules>
</component>
</project>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="4b0dc0d8-58e0-4f36-b2cd-dd2f5eed7a7c" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitLabMergeRequestsSettings"><![CDATA[{
"editorReviewEnabled": false
}]]></component>
<component name="GitlabMajeraCodeReviewSettings">
<option name="popularEmojiShortcuts">
<list />
</option>
</component>
<component name="GoLibraries">
<option name="indexEntireGoPath" value="true" />
</component>
<component name="ProjectColorInfo"><![CDATA[{
"associatedIndex": 1
}]]></component>
<component name="ProjectId" id="2y1jDw3iOs0SbjysMi6qvadjqNS" />
<component name="ProjectViewState">
<option name="autoscrollToSource" value="true" />
<option name="flattenModules" value="true" />
<option name="flattenPackages" value="true" />
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"ModuleVcsDetector.initialDetectionPerformed": "true",
"RunOnceActivity.GoLinterPluginOnboarding": "true",
"RunOnceActivity.GoLinterPluginStorageMigration": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.go.migrated.go.modules.settings": "true",
"git-widget-placeholder": "master",
"go.import.settings.migrated": "true",
"nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "preferences.pluginManager"
}
}]]></component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-jdk-9823dce3aa75-fbdcb00ec9e3-intellij.indexing.shared.core-IU-251.25410.129" />
<option value="bundled-js-predefined-d6986cc7102b-6a121458b545-JavaScript-IU-251.25410.129" />
</set>
</attachedChunks>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4b0dc0d8-58e0-4f36-b2cd-dd2f5eed7a7c" name="Changes" comment="" />
<created>1739869040002</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1739869040002</updated>
<workItem from="1739869042627" duration="241000" />
<workItem from="1749008861428" duration="2000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="VgoProject">
<integration-enabled>false</integration-enabled>
<settings-migrated>true</settings-migrated>
</component>
</project>

View File

@@ -0,0 +1,37 @@
package be.seeseepuff.pcinv.models;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import lombok.Getter;
import lombok.Setter;
/**
* Represents a generic asset in the inventory system.
*/
@Getter
@Setter
@Entity
public class Asset
{
@Id @GeneratedValue
private Long id;
/// The QR code attached to the asset, used for identification.
private Long qr;
/// The brand of the asset.
private String brand;
/// The model of the asset
private String model;
/// The asset's serial number.
private String serialNumber;
/// A description of the asset, providing additional details.
private String description;
/// The state of the asset, indicating its condition.
private AssetCondition condition;
}

View File

@@ -0,0 +1,18 @@
package be.seeseepuff.pcinv.models;
/**
* Represents the condition of an asset in the inventory system.
*/
public enum AssetCondition
{
/// The asset is in perfect working order.
HEALTHY,
/// The condition of the asset is unknown. E.g.: it is untested.
UNKNOWN,
/// The asset generally works, but has some known issues.
PARTIAL,
/// The asset is in need of repair, but is not completely broken.
REPAIR,
/// The asset is completely broken and cannot be used.
BORKED,
}

View File

@@ -0,0 +1,32 @@
package be.seeseepuff.pcinv.models;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import lombok.Getter;
import lombok.Setter;
/**
* Represents a hard drive or similar device.
*/
@Getter
@Setter
@Entity
public class HddAsset
{
@Id
@GeneratedValue
private Long id;
/// The ID of the associated asset, linking it to the generic Asset model.
private Long assetId;
/// The capacity of the drive in bytes.
private Long capacity;
/// The drive's interface type, such as SATA, IDE, ISA-16, ...
private String interfaceType;
/// The drive's form factor, such as 2.5", 3.5", etc.
private String formFactor;
}

View File

@@ -0,0 +1,29 @@
package be.seeseepuff.pcinv.models;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import lombok.Getter;
import lombok.Setter;
/**
* Represents a RAM DIMM or similar memory asset in the inventory system.
*/
@Getter
@Setter
@Entity
public class RamAsset
{
@Id
@GeneratedValue
private Long id;
/// The ID of the associated asset, linking it to the generic Asset model.
private Long assetId;
/// The capacity of the RAM in bytes.
private Long capacity;
/// The type of memory. E.g.: DDR2, SDRAM, ISA-8, etc...
private String type;
}

View File

@@ -0,0 +1,8 @@
package be.seeseepuff.pcinv.repositories;
import be.seeseepuff.pcinv.models.Asset;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface AssetRepository extends CrudRepository<Asset, Long> {}

View File

@@ -1 +1,6 @@
spring.application.name=pcinv
server.port=8088
spring.datasource.url=jdbc:postgresql://localhost:5432/pcinv
spring.datasource.username=pcinv
spring.datasource.password=pcinv
a