예제 #1
0
        public async Task <MessageModel <string> > Post([FromBody] d_video_base d_video_base)
        {
            var data = new MessageModel <string>();

            d_video_base.Guid = Guid.NewGuid().ToString();
            var id = (await _d_video_baseServices.Add(d_video_base));

            data.success = id > 0;
            if (data.success)
            {
                data.response = id.ObjToString();
                data.msg      = "添加成功";
            }

            return(data);
        }
예제 #2
0
        public async Task <MessageModel <string> > Update([FromBody] d_video_base d_video_base)
        {
            var data = new MessageModel <string>();

            if (d_video_base != null)
            {
                var id = (await _d_video_baseServices.Update(d_video_base));
                data.success = id;
                if (data.success)
                {
                    data.response = "id为" + d_video_base.Guid.ToString() + "的数据更新成功";
                    data.msg      = "更新成功";
                }
                else
                {
                    data.response = "id为" + d_video_base.Guid.ToString() + "的数据不存在";
                }
            }

            return(data);
        }