public ActionResult <ResponseJson> Post([FromBody] Models.jw_kc model) { ResponseJson json = new ResponseJson(); //写不进报错 if (!service.Insert(model)) { json.Code = "500"; json.Msg = $"增加[角色:{model.kcname}]失败!"; } return(json); }
public ActionResult <ResponseJson> Put(long id, [FromBody] Models.jw_kc 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); }