| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using Muchinfo.MTPClient.Data.Model.News;
- using Muchinfo.MTPClient.IService;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- namespace Muchinfo.MTPClient.Service
- {
- public class NewsService : INewsService
- {
- /// <summary>
- /// 获取新闻分类信息
- /// </summary>
- /// <returns>List{NewsCategory}.</returns>
- /// <exception cref="System.NotImplementedException"></exception>
- public List<NewsCategory> GetNewsCategories()
- {
- return null;
- //try
- //{
- // var url = LinkerHelper.GetNewsUrl();
- // if (string.IsNullOrWhiteSpace(url)) return null;
- // var categroyAddress = ConfigurationManager.AppSettings["News_CategoryAddress"];
- // categroyAddress = categroyAddress.TrimStart('/');
- // url = url.TrimEnd('/');
- // url = url + @"/" + categroyAddress;
- // var result = HttpUtility.HttpGet(url);
- // var adapter = new NewsEntityAdapter();
- // return adapter.ToNewsCategories(result);
- //}
- //catch (Exception e)
- //{
- // return null;
- // //throw new MuchinfoException(ExceptionManager.UnknownServiceErrorCode, e);
- //}
- }
- /// <summary>
- /// 获取新闻标题(滚动信息)
- /// </summary>
- /// <param name="classCode"></param>
- /// <returns></returns>
- public ObservableCollection<NewsTitle> GetNewsTitle(string classCode)
- {
- return null;
- //ObservableCollection<NewsTitle> newsTitleList = new ObservableCollection<NewsTitle>();
- //var url = LinkerHelper.GetNewsUrl();
- //if (string.IsNullOrWhiteSpace(url)) return null;
- //var categroyAddress = ConfigurationManager.AppSettings["News_NewsTitle"];
- //categroyAddress = categroyAddress.TrimStart('/');
- //url = url.TrimEnd('/');
- //url = url + @"/" + categroyAddress + "?classcode=" + classCode + "&topnum=20";
- //var result = HttpUtility.HttpGet(url);
- //var adapter = new NewsEntityAdapter();
- //var list = adapter.ToNewsTitleCategories(result);
- //return newsTitleList = list.ToObservableCollection();
- }
- }
- }
|