'use strict';

var angular = require('angular');
require('../modules');

var module = angular.module('info.services');

module.factory('ModelRemoteService', function($http, $q) {
  var service = {};

  service.queryLatestInfos = function() {
    return $http.get('/info/v3/latestinfo', {
      timeout: 15000
    }).then(function(response) {
      return response.data;
    });
  };
  service.queryModel = function (md5) {
    return $http.get('/info/v3/configs/all/' + md5, {
      timeout: 15000
    }).then(function(response) {
      return response.data;
    });
  };
  service.queryImgPath = function(id) {
    return $http.get('/pic/latest/imageFilePath/' + id, {
      timeout: 15000
    }).then(function(response) {
      return response.data;
    });
  }
  return service;
});
