Ejemplo n.º 1
0
        public ActionResult <ResponseJson> Post([FromBody] Models.jw_bj model)
        {
            ResponseJson json = new ResponseJson();

            //写不进报错
            if (!service.Insert(model))
            {
                json.Code = "500";
                json.Msg  = $"增加[角色:{model.bjname}]失败!";
            }
            return(json);
        }
Ejemplo n.º 2
0
        public ActionResult <ResponseJson> Put(long id, [FromBody] Models.jw_bj model)
        {
            ResponseJson json = new ResponseJson();
            bool         flag = false;

            if (service.Exists(id))
            {
                model.id = id;
                flag     = service.Update(model);
            }
            if (!flag)
            {
                json.Code = "500";
                json.Msg  = "修改失败!";
            }
            return(json);
        }