<commit_before>/**
 * Copyright (c) 2010-present Abixen Systems. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.abixen.platform.core.controller.admin;

import com.abixen.platform.core.model.impl.Resource;
import com.abixen.platform.core.service.ResourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping(value = "/api/control-panel/module-types")
public class AdminResourceController {

    private final ResourceService resourceService;

    @Autowired
    public AdminResourceController(ResourceService resourceService) {
        this.resourceService = resourceService;
    }

    @RequestMapping(value = "/{moduleId}/resources", method = RequestMethod.GET)
    public Page<Resource> getResources(@PathVariable("moduleId") Long moduleId, @PageableDefault(size = 1, page = 0) Pageable pageable) {
        log.debug("getResources({})", moduleId);
        return this.resourceService.findAllResources(moduleId, pageable);
    }
}<commit_msg>Changed the return type from Resource to ResourceDto in  AdminResourceController.<commit_after>/**
 * Copyright (c) 2010-present Abixen Systems. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.abixen.platform.core.controller.admin;

import com.abixen.platform.core.converter.ResourceToResourceDtoConverter;
import com.abixen.platform.core.dto.ResourceDto;
import com.abixen.platform.core.model.impl.Resource;
import com.abixen.platform.core.service.ResourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping(value = "/api/control-panel/module-types")
public class AdminResourceController {

    private final ResourceService resourceService;
    private final ResourceToResourceDtoConverter resourceToResourceDtoConverter;

    @Autowired
    public AdminResourceController(ResourceService resourceService,
                                   ResourceToResourceDtoConverter resourceToResourceDtoConverter) {
        this.resourceService = resourceService;
        this.resourceToResourceDtoConverter = resourceToResourceDtoConverter;
    }

    @RequestMapping(value = "/{moduleId}/resources", method = RequestMethod.GET)
    public Page<ResourceDto> getResources(@PathVariable("moduleId") Long moduleId, @PageableDefault(size = 1, page = 0) Pageable pageable) {
        log.debug("getResources({})", moduleId);
        Page<Resource> resourcePage = resourceService.findAllResources(moduleId, pageable);
        return resourceToResourceDtoConverter.convertToPage(resourcePage);
    }
}
{'fraction_non_alphanumeric': 0.08495255309534569, 'fraction_numerical': 0.004970628106642567, 'mean_word_length': 4.990527740189445, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1571720', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1138, 'n_words': 326}