class AppGroupController {

    @RequestMapping(value = "/update", method = RequestMethod.PUT)
    public ServiceResult<String> update(@Validated(UpdateAppGroup.class) @RequestBody AppGroup appGroup, @CurrentUser LoginUser user, Errors errors) throws Exception {
        appGroup.setUpdate_user_no(user.getUserNo());
        ValidateResult validateRes = appGroupService.validatePermision(user, errors)
                .addAssert(() -> appGroupService.isNotExistByName(appGroup), appGroup.getName() + " 已存在！")
                .addAssert(() -> appGroupService.updateAppGroup(appGroup))
                .validate();
        if (!validateRes.isValid()) {
            return ServiceResult.fail(validateRes.getSummarize());
        }
        return ServiceResult.success();
        //TODO return apolloAppGroup.replace(user, appGroup);
    }

}