<commit_before><?php

namespace DesignerBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class ArtworkController extends Controller
{
    /**
     * @Route("/artwork", name="designer_artwork_list_all", methods={"GET"})
     *
     * @param Request $request
     * @return Response
     */
    public function listAllAction(Request $request): Response
    {
        $artworkService = $this->get('jinya_gallery.services.artwork_service');
        $offset = $request->get('offset', 0);
        $count = $request->get('count', 12);
        $keyword = $request->get('keyword', '');
        $allData = $artworkService->getAll($offset, $count, $keyword);
        $allCount = $artworkService->countAll($keyword);

        return $this->json([
            'data' => $allData,
            'more' => $allCount > $count + $offset,
            'moreLink' => $this->generateUrl('designer_artwork_list_all', [
                'keyword' => $keyword,
                'count' => $count,
                'offset' => $offset + $count
            ])
        ]);
    }<commit_msg>Added additional route artifact to artwork controller<commit_after><?php

namespace DesignerBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class ArtworkController extends Controller
{
    /**
     * @Route("/artwork/api", name="designer_artwork_list_all", methods={"GET"})
     *
     * @param Request $request
     * @return Response
     */
    public function apiListAllAction(Request $request): Response
    {
        $artworkService = $this->get('jinya_gallery.services.artwork_service');
        $offset = $request->get('offset', 0);
        $count = $request->get('count', 12);
        $keyword = $request->get('keyword', '');
        $allData = $artworkService->getAll($offset, $count, $keyword);
        $allCount = $artworkService->countAll($keyword);

        return $this->json([
            'data' => $allData,
            'more' => $allCount > $count + $offset,
            'moreLink' => $this->generateUrl('designer_artwork_list_all', [
                'keyword' => $keyword,
                'count' => $count,
                'offset' => $offset + $count
            ])
        ]);
    }
{'fraction_non_alphanumeric': 0.14890219560878243, 'fraction_numerical': 0.0023952095808383233, 'mean_word_length': 2.855384615384615, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '7145012', 'n_tokens_mistral': 721, 'n_tokens_neox': 704, 'n_words': 128}