Exemplo n.º 1
0
        public async Task <ApiResult <string> > Add([FromBody] BlogArticleEditWebModel model)
        {
            var r = new ApiResult <string>();

            try
            {
                r.status = await _blogArticleServices.AddAsync(new BlogArticle()
                {
                }) > 0 ? 200 : 400;

                r.msg = r.status == 200 ? "添加成功" : "添加失败";
            }
            catch (Exception ex)
            {
                r.status = 500;
                r.msg    = ex.Message;
            }
            return(r);
        }