<commit_before>package com.aemreunal.controller.api;

import net.minidev.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.util.UriComponentsBuilder;
import com.aemreunal.config.GlobalSettings;
import com.aemreunal.domain.Scenario;
import com.aemreunal.service.ScenarioService;

/*
 ***************************
 * Copyright (c) 2014      *
 *                         *
 * This code belongs to:   *
 *                         *
 * @author <NAME> *
 * S001974                 *
 *                         *
 * <EMAIL>     *
 * <EMAIL>    *
 *                         *
 * aemreunal.com           *
 ***************************
 */

@Controller
@RequestMapping(GlobalSettings.API_PATH_MAPPING)
public class APIController {
    @Autowired
    private ScenarioService scenarioService;

    /*
     * Beacon query JSON example:
     * {
     *      uuid:   <beacon UUID>
     *      major:  <beacon Major>
     *      minor:  <beacon Minor>
     *      secret: <project Secret>
     * }
     */
    @RequestMapping(method = RequestMethod.POST, value = GlobalSettings.API_BEACON_QUERY_PATH_MAPPING, produces = "application/json; charset=UTF-8")
    public ResponseEntity<Scenario> queryForScenario(@RequestBody JSONObject beaconQueryJson,
                                                     UriComponentsBuilder builder) {
        // TODO verify request JSON
        String uuid = (String) beaconQueryJson.get("uuid");
        String major = (String) beaconQueryJson.get("major");
        String minor = (String) beaconQueryJson.get("minor");
        String secret = (String) beaconQueryJson.get("secret");
        Scenario scenario = scenarioService.queryForScenario(uuid, major, minor, secret);
        // TODO do something intelligent instead of just returning the scenario
        return new ResponseEntity<Scenario>(scenario, HttpStatus.OK);
    }
}<commit_msg>Temporary beacon query case fix<commit_after>package com.aemreunal.controller.api;

import net.minidev.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.util.UriComponentsBuilder;
import com.aemreunal.config.GlobalSettings;
import com.aemreunal.domain.Scenario;
import com.aemreunal.service.ScenarioService;

/*
 ***************************
 * Copyright (c) 2014      *
 *                         *
 * This code belongs to:   *
 *                         *
 * @author <NAME> *
 * S001974                 *
 *                         *
 * <EMAIL>     *
 * <EMAIL>    *
 *                         *
 * aemreunal.com           *
 ***************************
 */

@Controller
@RequestMapping(GlobalSettings.API_PATH_MAPPING)
public class APIController {
    @Autowired
    private ScenarioService scenarioService;

    /*
     * Beacon query JSON example:
     * {
     *      uuid:   <beacon UUID>
     *      major:  <beacon Major>
     *      minor:  <beacon Minor>
     *      secret: <project Secret>
     * }
     */
    @RequestMapping(method = RequestMethod.POST, value = GlobalSettings.API_BEACON_QUERY_PATH_MAPPING, produces = "application/json; charset=UTF-8")
    public ResponseEntity<Scenario> queryForScenario(@RequestBody JSONObject beaconQueryJson,
                                                     UriComponentsBuilder builder) {
        // TODO verify request JSON
        String uuid = beaconQueryJson.get("uuid").toString().toUpperCase();
        String major = beaconQueryJson.get("major").toString().toUpperCase();
        String minor = beaconQueryJson.get("minor").toString().toUpperCase();
        String secret = beaconQueryJson.get("secret").toString().toUpperCase();
        Scenario scenario = scenarioService.queryForScenario(uuid, major, minor, secret);
        // TODO do something intelligent instead of just returning the scenario
        return new ResponseEntity<Scenario>(scenario, HttpStatus.OK);
    }
}
{'fraction_non_alphanumeric': 0.12096069868995633, 'fraction_numerical': 0.00480349344978166, 'mean_word_length': 2.8143213988343048, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3434527', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1198, 'n_words': 236}