Ejemplo n.º 1
0
        public async Task <ActionResult <CreateNewsResponse> > CreateNews(CreateNewsRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            return(await _newsServices.CreateNews(request));
        }
Ejemplo n.º 2
0
        public IActionResult Create()
        {
            var mockInput = new NewsDTO()
            {
                Title = "Davutoğlu, Özel Kuvvetler Komutanlığını ziyaret etti",
                Spot  =
                    "Başbakan Ahmet Davutoğlu, Ankara'nın Gölbaşı ilçesinde yer alan Özel Kuvvetler Komutanlığını ziyaret etti",
                PublishedTime = DateTime.Now.ToString(),
                CreatedTime   = DateTime.Now.ToString(),
                NewsKeywords  = new List <string>()
                {
                    "2", "3"
                },
                MainCategory = new MainCategoryDTO()
                {
                    Title = "Türkiye",
                    Slug  = "turkiye"
                },
                Story = new StoryDTO()
                {
                    Contents = new List <ContentDTO>()
                    {
                        new ContentDTO()
                        {
                            _t   = "MongoDbTextContent",
                            Text =
                                "Başbakan Davutoğlu, Çankaya Köşkü'nden Gölbaşı ilçesinde yer alan Özel Kuvvetler Komutanlığına geçti"
                        },
                        new ContentDTO()
                        {
                            _t       = "MongoDbImageContent",
                            ImageUrl =
                                "https://cdn1-test.ntv.com.tr/gorsel/ocacC2EjB0SRv07FOWRHpQ.jpg?width=710&height=533&mode=crop&scale=both&v=1575103859593&meta=rectangle"
                        },
                        new ContentDTO()
                        {
                            _t   = "MongoDbTextContent",
                            Text =
                                "Davutoğlu, burada anı defterini imzaladıktan sonra, Türk Silahlı Kuvvetlerinin her türlü arazi ve iklim şartlarında görev yapabilecek nitelikte üst " +
                                "düzey eğitime tabi tutularak yetiştirilen ve \"bordo bereliler\" olarak bilinen Özel Kuvvetler Komutanlığının eğitim tesislerini yerinde inceledi."
                        }
                    }
                },
                MainArtUrl =
                    "http://cdn1.ntv.com.tr/gorsel/turkiye,wNHAnBFNREy16NUvmO74Wg.jpg?mode=crop&scale=both&v=20150728190350847"
            };


            _newsServices.CreateNews(mockInput);
            return(View());
        }