<commit_before>package net.okjsp

import com.memetix.random.RandomService
import grails.plugin.springsecurity.SpringSecurityService
import grails.plugin.springsecurity.SpringSecurityUtils
import grails.validation.ValidationException
import org.hibernate.FetchMode
import org.hibernate.type.StandardBasicTypes
import org.springframework.http.HttpStatus

import static org.springframework.http.HttpStatus.*
import grails.transaction.Transactional

@Transactional(readOnly = true)
class ArticleController {

    ArticleService articleService
    SpringSecurityService springSecurityService
    UserService userService
    RandomService randomService

    static responseFormats = ['html', 'json']

    static allowedMethods = [save: "POST", update: ["PUT","POST"], delete: ["DELETE","POST"], scrap: "POST",
                             addNote: "POST", assent: ["PUT","POST"], dissent: ["PUT","POST"]]
    
    def beforeInterceptor = {
        response.characterEncoding = 'UTF-8' //workaround for https://jira.grails.org/browse/GRAILS-11830
    }

    def index(String code, Integer max) {
        params.max = Math.min(max ?: 20, 100)
        params.sort = params.sort ?: 'id'
        params.order = params.order ?: 'desc'
        params.query = params.query?.trim()

        println code

        def category = Category.get(code)

        if(category == null) {
            notFound()
            return
        }

        def choiceJobs

        if(category.code == 'jobs' || category.parent?.code == 'jobs') {

            def diff = new Date() - 30

            choiceJobs = Article.withCriteria() {
                eq('choice', true)
                eq('enabled', true)
                'in'('category', [Category.get('recruit'), Category.get('resumes'), Category.get('evalcom')])
                gt('dateCreated', diff)
                order('id', 'desc')

                maxResults(3)<commit_msg>log 삭제<commit_after>package net.okjsp

import com.memetix.random.RandomService
import grails.plugin.springsecurity.SpringSecurityService
import grails.plugin.springsecurity.SpringSecurityUtils
import grails.validation.ValidationException
import org.hibernate.FetchMode
import org.hibernate.type.StandardBasicTypes
import org.springframework.http.HttpStatus

import static org.springframework.http.HttpStatus.*
import grails.transaction.Transactional

@Transactional(readOnly = true)
class ArticleController {

    ArticleService articleService
    SpringSecurityService springSecurityService
    UserService userService
    RandomService randomService

    static responseFormats = ['html', 'json']

    static allowedMethods = [save: "POST", update: ["PUT","POST"], delete: ["DELETE","POST"], scrap: "POST",
                             addNote: "POST", assent: ["PUT","POST"], dissent: ["PUT","POST"]]
    
    def beforeInterceptor = {
        response.characterEncoding = 'UTF-8' //workaround for https://jira.grails.org/browse/GRAILS-11830
    }

    def index(String code, Integer max) {
        params.max = Math.min(max ?: 20, 100)
        params.sort = params.sort ?: 'id'
        params.order = params.order ?: 'desc'
        params.query = params.query?.trim()

        def category = Category.get(code)

        if(category == null) {
            notFound()
            return
        }

        def choiceJobs

        if(category.code == 'jobs' || category.parent?.code == 'jobs') {

            def diff = new Date() - 30

            choiceJobs = Article.withCriteria() {
                eq('choice', true)
                eq('enabled', true)
                'in'('category', [Category.get('recruit'), Category.get('resumes'), Category.get('evalcom')])
                gt('dateCreated', diff)
                order('id', 'desc')

                maxResults(3)
{'fraction_non_alphanumeric': 0.12278380523948135, 'fraction_numerical': 0.0074093675575549085, 'mean_word_length': 2.731490621915104, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4438487', 'n_tokens_mistral': 1070, 'n_tokens_neox': 996, 'n_words': 222}