<commit_before>package ru.technoserv.controller;

import ru.technoserv.services.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import ru.technoserv.dao.Department;
import ru.technoserv.services.DepartmentService;

import java.util.List;



@RestController
@RequestMapping(value = "/department")
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;

    @RequestMapping(value = "/{depId}/subdepts", method = RequestMethod.GET)
    public List<Department> getSubDepts(@PathVariable Integer depId) {
        List<Department> subDepts = departmentService.getSubDepts(depId);

        return subDepts;
    }

    @RequestMapping(value = "/{depId}", method = RequestMethod.GET)
    public Department getDept(@PathVariable Integer depId) {
        return departmentService.getDepartment(depId);
    }

    @RequestMapping(value = "/", method = RequestMethod.POST, produces = "application/json", consumes = "application/json")
    public Department createDepartment(@RequestBody Department department) {
        return departmentService.createDepartment(department);
    }

    @RequestMapping(value = "/{depId}", method = RequestMethod.DELETE)
    public Department closeDepartment(@PathVariable Integer depId) {
        return departmentService.deleteDepartment(depId);
    }

    @RequestMapping(value = "/{depId}", method = RequestMethod.PATCH)
    public Department changeParentDept(@RequestBody Department newParentDepartment,
                                 @PathVariable Integer depId) {
        return departmentService.reassignDepartment(depId, newParentDepartment.getId());
    }

}<commit_msg>все методы DepartmentController переделаны для возвращения ResponseEntity<commit_after>package ru.technoserv.controller;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import ru.technoserv.services.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import ru.technoserv.dao.Department;
import ru.technoserv.services.DepartmentService;

import java.util.List;



@RestController
@RequestMapping(value = "/department")
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;

    @RequestMapping(value = "/{depId}/subdepts", method = RequestMethod.GET)
    public ResponseEntity<List<Department>> getSubDepts(@PathVariable Integer depId) {
        List<Department> subDepts = departmentService.getSubDepts(depId);

        return new ResponseEntity<>(subDepts, HttpStatus.FOUND);
    }

    @RequestMapping(value = "/{depId}", method = RequestMethod.GET)
    public ResponseEntity<Department> getDept(@PathVariable Integer depId) {
        Department dep = departmentService.getDepartment(depId);
        return new ResponseEntity<>(dep, HttpStatus.FOUND);
    }

    @RequestMapping(value = "/", method = RequestMethod.POST, produces = "application/json", consumes = "application/json")
    public ResponseEntity<Department> createDepartment(@RequestBody Department department) {
        Department dep = departmentService.createDepartment(department);
        return new ResponseEntity<>(dep, HttpStatus.CREATED);
    }

    @RequestMapping(value = "/{depId}", method = RequestMethod.DELETE)
    public ResponseEntity<Department> closeDepartment(@PathVariable Integer depId) {
        Department dep = departmentService.deleteDepartment(depId);

        return new ResponseEntity<>(dep, HttpStatus.OK);
    }

    @RequestMapping(value = "/{depId}", method = RequestMethod.PATCH)
    public ResponseEntity<Department> changeParentDept(@RequestBody Department newParentDepartment,
                                                       @PathVariable Integer depId) {
        Department dep = departmentService.reassignDepartment(depId, newParentDepartment.getParentDeptId());

        return new ResponseEntity<>(dep, HttpStatus.OK);
    }

}
{'fraction_non_alphanumeric': 0.09930486593843098, 'fraction_numerical': 0.0, 'mean_word_length': 4.429919137466308, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1218145', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1016, 'n_words': 208}