@ApiOperation("添加")
@PostMapping()
public ApiResult<?> save(@RequestBody FeePropertyRoomArea feePropertyRoomArea) {
User user=getLoginUser();
LocalDateTime localDateTime = LocalDateTime.now();
feePropertyRoomArea.setCreateTime(localDateTime);
feePropertyRoomArea.setCreUserId(Long.valueOf(user.getUserId()));
feePropertyRoomArea.setCreUserName(user.getUsername());
if (feePropertyRoomAreaService.save(feePropertyRoomArea)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改")
@PutMapping()
public ApiResult<?> update(@RequestBody FeePropertyRoomArea feePropertyRoomArea) {
User user=getLoginUser();
LocalDateTime localDateTime = LocalDateTime.now();
feePropertyRoomArea.setUpdateTime(localDateTime);
feePropertyRoomArea.setUpdUserId(Long.valueOf(user.getUserId()));
feePropertyRoomArea.setUpdUserName(user.getUsername());
if (feePropertyRoomAreaService.updateById(feePropertyRoomArea)) {
return success("修改成功");
}
return fail("修改失败");
}