Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            //var tags = TagApi.Select();

            //foreach(var t in tags)
            //{
            //    var content = ContentApi.Search(1000000, 1, "question", t.Name, null, null);

            //    foreach(var c in content)
            //    {
            //        TagApi.Tag(c.Id, t.Id);
            //        Console.Write('.');
            //    }
            //}

            Random r = new Random();

            for (var i = 0; i < 10000; i++)
            {
                var contentId = r.Next(2106) + 1;
                var userid    = r.Next(4500) + 1;

                var direction = r.Next(10);

                if (direction == 9)
                {
                    direction = -1;
                }
                else
                {
                    direction = 1;
                }

                VoteApi.Vote(contentId, userid, direction);
            }


            //RelationAttacher ra = new RelationAttacher();
            //DateAdder da = new DateAdder();
            //try
            //{
            //}
            //catch (Exception e)
            //{
            //    Console.WriteLine(e);
            //}
            //Console.ReadLine();
        }
Exemplo n.º 2
0
 public int Vote([FromBody] VoteRequest req)
 {
     return(VoteApi.Vote(req.AnswerId, 1, req.Direction));
 }
Exemplo n.º 3
0
 public int Vote(VoteRequest req)
 {
     return(VoteApi.Vote(req.ContentId, 1, req.Direction));
 }