<commit_before>package io.resourcepool.hvsz.controllers;

import io.resourcepool.hvsz.persistance.dao.DaoMapDb;
import io.resourcepool.hvsz.persistance.models.Game;
import io.resourcepool.hvsz.persistance.models.SafeZone;
import io.resourcepool.hvsz.persistance.models.SupplyZone;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class ResourceController {

    @Autowired
    private DaoMapDb dao;

    private static final int ID_SUPPLY_ZONE = 1;

    /**
     * Drop a resource.
     * @param safeZone SupplyZone id
     * @param model Model
     * @return String (human vue)
     */
    @GetMapping("/resource/drop")
    public String dropResource(@RequestParam(value = "safeZone", required = false) String safeZone, Model model) {
        if (safeZone != null) {
            Game g = dao.get(1L);
            SafeZone s = g.getSafeZones().get(Integer.parseInt(safeZone));
            model.addAttribute("nbResources", s.drop(1) + " resource has been dropped : supply zone n°" + ID_SUPPLY_ZONE + " contains :" + s.getResource() + "resources");
            dao.set(1L, g);
        }
        return "human";
    }
<commit_msg>[fix:resource] set get to post mapping on resourcecontroller<commit_after>package io.resourcepool.hvsz.controllers;

import io.resourcepool.hvsz.persistance.dao.DaoMapDb;
import io.resourcepool.hvsz.persistance.models.Game;
import io.resourcepool.hvsz.persistance.models.SafeZone;
import io.resourcepool.hvsz.persistance.models.SupplyZone;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class ResourceController {

    @Autowired
    private DaoMapDb dao;

    private static final int ID_SUPPLY_ZONE = 1;

    /**
     * Drop a resource.
     * @param safeZone SupplyZone id
     * @param model Model
     * @return String (human vue)
     */
    @PostMapping("/resource/drop")
    public String dropResource(@RequestParam(value = "safeZone", required = false) String safeZone, Model model) {
        if (safeZone != null) {
            Game g = dao.get(1L);
            SafeZone s = g.getSafeZones().get(Integer.parseInt(safeZone));
            model.addAttribute("nbResources", s.drop(1) + " resource has been dropped : supply zone n°" + ID_SUPPLY_ZONE + " contains :" + s.getResource() + "resources");
            dao.set(1L, g);
        }
        return "human";
    }

{'fraction_non_alphanumeric': 0.11208713984539705, 'fraction_numerical': 0.0028109627547434997, 'mean_word_length': 3.6595744680851063, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3525956', 'n_tokens_mistral': 848, 'n_tokens_neox': 858, 'n_words': 179}