use of com.topcom.cms.domain.Unit in project topcom-cloud by 545314690.
the class AbbreviationController method update.
/**
* 根据输入的实体对象信息,修改指定id的实体对象
*
* @param id
* @param model
* @return 实体对象
*/
@RequestMapping(value = "/getTree/{id}", method = RequestMethod.PUT, produces = "application/json", consumes = "application/json")
@ResponseBody
public Abbreviation update(@PathVariable int id, @RequestBody Abbreviation model) {
Abbreviation abb = this.manager.findById(Long.valueOf(id));
Unit unit = abb.getUnit();
abb.setShortName(model.getShortName());
unit.setUnitName(model.getUnit().getUnitName());
abb.setFlag(model.getFlag());
abb.setUnit(unit);
this.model = this.manager.save(abb);
return this.model;
}
Aggregations