<commit_before>/**
 * Created by chenjianjun on 16/2/25.
 */
import recordVideoSeason from '../cache/db/module/recordVideoSeason.js'
import _ from 'lodash'
import env from '../cache/db/config'
let r = env.Thinky.r

// 婚庆策划--婚礼跟拍分季路由r
const recordVideoSeasonApi = {

    'get+/followVideoSeason/all': function*(next) {
        this.model = recordVideoSeason
        this.APIKey = 'RecordVideoSeason'
        yield next
    },

    // 获取分季节
    'get+/followVideoSeason/:position': function*(next) {
        if (this.params.position === 'all') {
            this.model = recordVideoSeason.filter({})
        } else {
            this.model = recordVideoSeason.filter({
                position: this.params.position
            })
        }
        this.model = this.model.orderBy(r.desc('weight'))

        _.each(this.request.query, (v, k) => {
            if (k.indexOf('pageSize') !== -1) {
                let limit = 0
                limit = Number(this.request.query['pageIndex'] || '1') - 1
                if (limit < 0) {
                    limit = 0
                }
                this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
                this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
            }<commit_msg>修改bug<commit_after>/**
 * Created by chenjianjun on 16/2/25.
 */
import recordVideoSeason from '../cache/db/module/recordVideoSeason.js'
import _ from 'lodash'
import env from '../cache/db/config'
let r = env.Thinky.r

// 婚庆策划--婚礼跟拍分季路由r
const recordVideoSeasonApi = {

    'get+/recordVideoSeason/all': function*(next) {
        this.model = recordVideoSeason
        this.APIKey = 'RecordVideoSeason'
        yield next
    },

    // 获取分季节
    'get+/recordVideoSeason/:position': function*(next) {
        if (this.params.position === 'all') {
            this.model = recordVideoSeason.filter({})
        } else {
            this.model = recordVideoSeason.filter({
                position: this.params.position
            })
        }
        this.model = this.model.orderBy(r.desc('weight'))

        _.each(this.request.query, (v, k) => {
            if (k.indexOf('pageSize') !== -1) {
                let limit = 0
                limit = Number(this.request.query['pageIndex'] || '1') - 1
                if (limit < 0) {
                    limit = 0
                }
                this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
                this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
            }
{'fraction_non_alphanumeric': 0.15046296296296297, 'fraction_numerical': 0.011574074074074073, 'mean_word_length': 1.8843159065628476, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2878019', 'n_tokens_mistral': 847, 'n_tokens_neox': 802, 'n_words': 142}