Преглед на файлове

:fire: Remove every mention of mech in the back

Mech exist only in the front. There is no need to have a database, as
they are all encoded.
DricomDragon преди 2 месеца
родител
ревизия
9a6c55b7ed

+ 0 - 41
dev-back/src/main/java/eu/jovian_hersemeule/dev/squad/squad_composer/controllers/MechController.java

@@ -1,41 +0,0 @@
-package eu.jovian_hersemeule.dev.squad.squad_composer.controllers;
-
-import org.springframework.web.bind.annotation.RestController;
-import eu.jovian_hersemeule.dev.squad.squad_composer.data.MechRowMapper;
-import eu.jovian_hersemeule.dev.squad.squad_composer.data.model.Mech;
-import java.util.List;
-
-import javax.sql.DataSource;
-
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-@RestController
-@RequestMapping("/mech")
-public class MechController {
-
-    private final JdbcTemplate jdbcTemplate;
-
-    private final MechRowMapper mapper = new MechRowMapper();
-
-    MechController(final DataSource ds) {
-        jdbcTemplate = new JdbcTemplate(ds);
-    }
-
-    @GetMapping("/")
-    public List<Mech> list() {
-        return jdbcTemplate.query("SELECT * FROM MECH", mapper);
-    }
-
-    @GetMapping("/{id}")
-    public Mech get(@PathVariable final int id) {
-        final List<Mech> ans = jdbcTemplate.query("SELECT * FROM mech WHERE id = ?", mapper, id);
-        if (ans.isEmpty()) {
-            return null;
-        }
-        return ans.get(0);
-    }
-    
-}

+ 0 - 5
dev-back/src/main/java/eu/jovian_hersemeule/dev/squad/squad_composer/data/DataService.java

@@ -1,5 +0,0 @@
-package eu.jovian_hersemeule.dev.squad.squad_composer.data;
-
-public class DataService {
-    
-}

+ 0 - 24
dev-back/src/main/java/eu/jovian_hersemeule/dev/squad/squad_composer/data/MechRowMapper.java

@@ -1,24 +0,0 @@
-package eu.jovian_hersemeule.dev.squad.squad_composer.data;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.lang.NonNull;
-import org.springframework.lang.Nullable;
-
-import eu.jovian_hersemeule.dev.squad.squad_composer.data.model.Mech;
-
-public class MechRowMapper implements RowMapper<Mech> {
-
-    @Override
-    @Nullable
-    public Mech mapRow(final @NonNull ResultSet rs, int rowNum) throws SQLException {
-        return new Mech(
-            rs.getInt("id"),
-            rs.getString("name"),
-            rs.getString("class"),
-            rs.getInt("resistance"));
-    }
-
-}

+ 0 - 5
dev-back/src/main/java/eu/jovian_hersemeule/dev/squad/squad_composer/data/model/Mech.java

@@ -1,5 +0,0 @@
-package eu.jovian_hersemeule.dev.squad.squad_composer.data.model;
-
-public record Mech(int id, String name, String kind, Integer health) {
-    // Nothing
-}