方式一:
public void submit() {
RespBody respbody = new RespBody();
Contact contact = getModel(Contact.class ,"contact");
String contactName = contact.getStr("contactName");
logger.info("--------这样就可以获取参数啦----------"+contactName);
contact.save();
respbody.setResult(true);
respbody.setData(contact);
renderJson(respbody);
}
方式二:
public void delete() {
RespBody respbody = new RespBody();
int id = getParaToInt("id");
logger.info("--------这样就可以获取参数啦----------"+id);
if (Contact.dao.deleteById(id)) {
respbody.setResult(true);
}else {
respbody.setMsg("刪除失败,请检查是否存在该id ");
}
renderJson(respbody);
}