コード例 #1
0
        // 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);
            }
        }
コード例 #2
0
 public void DataBaseCommunication_FormatirajDatum_Ispravno()
 {
     Assert.AreEqual("2020/11/15/23/50/59", DataBaseCommunication.FormatirajDatum(ispravanDatum));
 }
コード例 #3
0
        public Boolean InsertShareBadge([FromBody] ShareModel shareModel)
        {
            DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING);

            return(dataBaseCommunication.InsertShareBadge(shareModel));
        }
コード例 #4
0
        public Boolean CheckLike([FromBody] ShareModel shareModel)
        {
            DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING);

            return(dataBaseCommunication.CheckLike(shareModel));
        }
コード例 #5
0
        public Boolean CheckUser([FromBody] User user)
        {
            DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING);

            return(dataBaseCommunication.CheckUser(user));
        }
コード例 #6
0
        // GET: api/Articles
        public List <Article> Get()
        {
            DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING);

            return(dataBaseCommunication.GetArticles());
        }
コード例 #7
0
        public List <int> GetLikedArticlesByUser(int id)
        {
            DataBaseCommunication dataBaseCommunication = new DataBaseCommunication(CONNECTION_STRING);

            return(dataBaseCommunication.GetLikedArticlesByUser(id));
        }