home.js 1.61 KB
'use strict'

function getChannelCode(channel) {
    let config = {
        boy: 1,
        girl: 2,
        child: 3,
        lifestyle: 4,
    };

    return config[channel] ? config[channel] : config['boy'];
}


function getGenderCode(channel) {
    let config = {
        boy: '1,3',
        girl: '2,3',
        child: '',
        lifestyle: '',
    };

    return config[channel] ? config[channel] : config['boy'];
}


function getRecPosCode(channel) {
    let config = {
        boy: '100001',
        girl: '100002',
        child: '',
        lifestyle: '',
    };

    return config[channel] ? config[channel] : config['boy'];
}


function getRecommandContentCode(channel) {
    let config = {
        boy: '201504091403001',
        girl: '201504091403002',
        child: '201504091403002',
        lifestyle: '201504091403002',
    };

    return config[channel] ? config[channel] : config['boy'];
}

function getResourceCode(channel){
  let config = {
    boy: '9cb6138be8e60c96f48107da481816c2',
    girl: 'b1fa86320d3f9d9e89153129aeea1b3e',
    child: 'e9875682c1599a886bfbdb965b740022',
    lifestyle: '9aa25f5133f011ec96c2045eb15ae425',
  };
  return config[channel] ? config[channel] : config['boy'];
}

//获取首页的contentcode
function getHomeContentCode(channel){
  let config = {
    boy:'305e0a7a4aba32b08c6dd6dc5da47fa9',
    // boy: '9cb6138be8e60c96f48107da481816c2',
    girl:'5d9665e6a0a8ec5b2f0c126b36364d24'
  }
  return config[channel]?config[channel]:config['boy'];
}
module.exports = {
  getChannelCode,
  getGenderCode,
  getRecPosCode,
  getRecommandContentCode,
  getResourceCode,
  getHomeContentCode
}