Example #1
0
        public async Task <object> Get(int id)
        {
            var blog = _blogArticleServices.QueryByID(id);

            return(Ok(new
            {
                success = true,
                data = blog
            }));
        }
Example #2
0
        public async Task <MessageModel <string> > Delete(int id)
        {
            var data = new MessageModel <string>();

            if (id > 0)
            {
                var blogArticle = await _blogArticleServices.QueryByID(id);

                blogArticle.IsDeleted = true;
                data.success          = await _blogArticleServices.Update(blogArticle);

                if (data.success)
                {
                    data.msg      = "删除成功";
                    data.response = blogArticle?.bID.ObjToString();
                }
            }

            return(data);
        }