Add NIC asset model and repository
Some checks failed
Deploy / build (push) Failing after 29s
Build / build (push) Successful in 1m33s

This commit is contained in:
2025-06-08 16:48:02 +02:00
parent 7f4954a98d
commit 5e902dd8b0
2 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@AssetInfo(
displayName = "Network Interface Controller",
pluralName = "Network Interface Controllers",
type = "nic"
)
@Table(name = "nic_assets")
public class NICAsset implements Asset
{
@Id
@GeneratedValue
private long id;
/// The generic asset associated with this RAM.
@OneToOne(orphanRemoval = true)
private GenericAsset asset;
@Description("The MAC address of the network interface controller.")
@Property("MAC Address")
@HideInOverview
private String macAddress;
@Description("The type of interface used by the drive. E.g.: SATA, IDE, etc.")
@Property("Interface Type")
@HideInOverview
@InputList
private String interfaceType;
}

View File

@@ -0,0 +1,12 @@
package be.seeseepuff.pcinv.repositories;
import be.seeseepuff.pcinv.models.NICAsset;
import org.springframework.data.jpa.repository.JpaRepository;
@SuppressWarnings("unused")
public interface NICRepository extends JpaRepository<NICAsset, Long>, AssetRepository<NICAsset> {
@Override
default Class<NICAsset> getAssetType() {
return NICAsset.class;
}
}