// POST: api/Articles public void Post([FromBody] Person person) { if (person.Login.Equals("CiPhantom") && person.Password.Equals("lksPMnze")) { OpmlHandler opmlHandler = new OpmlHandler("./rss.opml"); Dictionary <string, string> urls = new Dictionary <string, string>(); urls = opmlHandler.getListeJourneaux(); List <Article> articles = new List <Article>(); Feeder f = new Feeder(urls); articles = f.getArticles(); DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING); dataBaseCommunication.SaveArticles(articles); } }
public void DataBaseCommunication_FormatirajDatum_Ispravno() { Assert.AreEqual("2020/11/15/23/50/59", DataBaseCommunication.FormatirajDatum(ispravanDatum)); }
public Boolean InsertShareBadge([FromBody] ShareModel shareModel) { DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING); return(dataBaseCommunication.InsertShareBadge(shareModel)); }
public Boolean CheckLike([FromBody] ShareModel shareModel) { DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING); return(dataBaseCommunication.CheckLike(shareModel)); }
public Boolean CheckUser([FromBody] User user) { DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING); return(dataBaseCommunication.CheckUser(user)); }
// GET: api/Articles public List <Article> Get() { DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING); return(dataBaseCommunication.GetArticles()); }
public List <int> GetLikedArticlesByUser(int id) { DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING); return(dataBaseCommunication.GetLikedArticlesByUser(id)); }