// Path: src/main/java/com/github/vedenin/codingchallenge/mvc/model/ResponseChangeStatus.java
// public class ResponseChangeStatus {
//     private String status = "ok";
// 
//     public String getStatus() {
//         return status;
//     }
// 
//     public void setStatus(String status) {
//         this.status = status;
//     }
// }


import com.github.vedenin.codingchallenge.mvc.model.ResponseChangeStatus;
import com.github.vedenin.codingchallenge.persistence.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.google.common.collect.Lists;
import javax.inject.Inject;
import java.util.List;
    }

    @RequestMapping(value = "/rest/history",  method = RequestMethod.GET)
    public ResponseEntity<List<HistoryEntity>> getHistories(@RequestParam(value="access_key", defaultValue = "") String accessKey) {
        if(ACCESS_KEY.equals(accessKey)) {
            return ResponseEntity.ok(Lists.newArrayList(historyRepository.findAll()));
        } else {
            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null);
        }
    }

    @RequestMapping(value = "/rest/error",  method = RequestMethod.GET)
    public ResponseEntity<List<ErrorEntity>> getErrors(@RequestParam(value="access_key", defaultValue = "") String accessKey) {
        if(ACCESS_KEY.equals(accessKey)) {
            return ResponseEntity.ok(Lists.newArrayList(errorRepository.findAll()));
        } else {
            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null);
        }
    }

    @RequestMapping(value = "/rest/property",  method = RequestMethod.GET)
    public ResponseEntity<DefaultProperty> getProperty(@RequestParam(value="access_key", defaultValue = "") String accessKey) {
        if(ACCESS_KEY.equals(accessKey)) {
            return ResponseEntity.ok(propertyService.getDefaultProperties());
        } else {
            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null);
        }
    }

    @RequestMapping(value = "/rest/property",  method = RequestMethod.POST)
// Path: src/main/java/com/github/vedenin/codingchallenge/mvc/model/ResponseChangeStatus.java
// public class ResponseChangeStatus {
//     private String status = "ok";
// 
//     public String getStatus() {
//         return status;
//     }
// 
//     public void setStatus(String status) {
//         this.status = status;
//     }
// }


// Path: src/main/java/com/github/vedenin/codingchallenge/mvc/controler/MainRestController.java
import com.github.vedenin.codingchallenge.mvc.model.ResponseChangeStatus;
import com.github.vedenin.codingchallenge.persistence.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.google.common.collect.Lists;
import javax.inject.Inject;
import java.util.List;

    }

    @RequestMapping(value = "/rest/history",  method = RequestMethod.GET)
    public ResponseEntity<List<HistoryEntity>> getHistories(@RequestParam(value="access_key", defaultValue = "") String accessKey) {
        if(ACCESS_KEY.equals(accessKey)) {
            return ResponseEntity.ok(Lists.newArrayList(historyRepository.findAll()));
        } else {
            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null);
        }
    }

    @RequestMapping(value = "/rest/error",  method = RequestMethod.GET)
    public ResponseEntity<List<ErrorEntity>> getErrors(@RequestParam(value="access_key", defaultValue = "") String accessKey) {
        if(ACCESS_KEY.equals(accessKey)) {
            return ResponseEntity.ok(Lists.newArrayList(errorRepository.findAll()));
        } else {
            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null);
        }
    }

    @RequestMapping(value = "/rest/property",  method = RequestMethod.GET)
    public ResponseEntity<DefaultProperty> getProperty(@RequestParam(value="access_key", defaultValue = "") String accessKey) {
        if(ACCESS_KEY.equals(accessKey)) {
            return ResponseEntity.ok(propertyService.getDefaultProperties());
        } else {
            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null);
        }
    }

    @RequestMapping(value = "/rest/property",  method = RequestMethod.POST)
    public ResponseEntity<ResponseChangeStatus> setProperty(