<commit_before>package com.imcode.imcms.controller.api;

import com.imcode.imcms.domain.dto.TextDTO;
import com.imcode.imcms.domain.service.TextService;
import com.imcode.imcms.security.AccessType;
import com.imcode.imcms.security.CheckAccess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/texts")
public class TextController {

    private final TextService textService;

    @Autowired
    TextController(TextService textService) {
        this.textService = textService;
    }

    @PostMapping
    @CheckAccess(AccessType.TEXT)
    public void saveText(@ModelAttribute TextDTO textDTO) {
        textService.save(textDTO);
    }
}<commit_msg>Issue IMCMS-483: Improve the text-editor - Improve controller;<commit_after>package com.imcode.imcms.controller.api;

import com.imcode.imcms.domain.dto.TextDTO;
import com.imcode.imcms.domain.service.TextService;
import com.imcode.imcms.security.AccessType;
import com.imcode.imcms.security.CheckAccess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/texts")
public class TextController {

    private final TextService textService;

    @Autowired
    TextController(TextService textService) {
        this.textService = textService;
    }

    @PostMapping
    @CheckAccess(AccessType.TEXT)
    public TextDTO saveText(@ModelAttribute TextDTO textDTO) {
        return new TextDTO(textService.save(textDTO));
    }
}
{'fraction_non_alphanumeric': 0.09715157680569685, 'fraction_numerical': 0.001525940996948118, 'mean_word_length': 5.205047318611987, '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': '1088190', 'n_tokens_mistral': 569, 'n_tokens_neox': 563, 'n_words': 92}