'use strict';

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

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

module.factory('NoticeRemoteService', NoticeRemoteService);

/**
 * @ngInject
 */
function NoticeRemoteService($http) {

  return {
    getNotice: getNotice
  };

  /**
   * 获取通知列表
   * @return {Promise}
   */
  function getNotice(version) {
    var url = version?'/notice?version=' + version : '/notice';
    return $http.get(url).then(function(response) {
      return response.data;
    });
  }
}
