{"size": 1876, "ext": "js", "max_stars_repo_path": "WeexOne/common/api.js", "max_stars_repo_name": "wutongke/weex-example", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "WeexOne/common/api.js", "max_issues_repo_name": "wutongke/weex-example", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "WeexOne/common/api.js", "max_forks_repo_name": "wutongke/weex-example", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.7777777778, "max_line_length": 68, "alphanum_fraction": 0.6785714286}
/**
 * Created by baidu on 16/6/8.
 */


// var stream = require('@weex-module/stream');//说是0.15已经支持,但是我没生效

var stream
__weex_define__('@weex-temp/api', function (__weex_require__) {
    stream = __weex_require__('@weex-module/stream')
});

var apiURL = {
    baseurl: 'http://v3.wufazhuce.com:8000/api',
    homePage: '/hp/bymonth/',
    readingCarousel: '/reading/carousel',
    readingIndex: '/reading/index/',
    essay: '/essay/',
    serialcontent: '/serialcontent/',
    question: '/question/',
    carouselList: '/reading/carousel/',
    movieList: '/movie/list/',
    movieDetail: '/movie/detail/'

};
function getData(url, callback) {
    stream.sendHttp({
        method: 'GET',
        url: url
    }, function (ret) {
        var retdata = JSON.parse(ret);
        callback(retdata);
    });
}
exports.getHome = function (dateStr, callback) {
    getData(apiURL.baseurl + apiURL.homePage + dateStr, callback);
};
exports.getReadingCarousel = function (callback) {
    getData(apiURL.baseurl + apiURL.readingCarousel, callback);
};
exports.getReadingIndex = function (index, callback) {
    getData(apiURL.baseurl + apiURL.readingIndex + index, callback);
};
exports.getEssay = function (id, callback) {
    getData(apiURL.baseurl + apiURL.essay + id, callback);
};
exports.getSerialContent = function (id, callback) {
    getData(apiURL.baseurl + apiURL.serialcontent + id, callback);
};
exports.getQuestionDetail = function (id, callback) {
    getData(apiURL.baseurl + apiURL.question + id, callback);

};
exports.getCarouseList = function (id, callback) {
    getData(apiURL.baseurl + apiURL.carouselList + id, callback);
};
exports.getMovieList = function (id, callback) {
    getData(apiURL.baseurl + apiURL.movieList + id, callback);
};
exports.getMovieDetail = function (id, callback) {
    getData(apiURL.baseurl + apiURL.movieDetail + id, callback);

};