class DatabaseSetEntryController {

    @RequestMapping(value = "/update", method = RequestMethod.PUT)
    public ServiceResult<String> update(@Validated(UpdateDbSetEntry.class) @RequestBody DatabaseSetEntry dbsetEntry, @CurrentUser LoginUser user, Errors errors) throws Exception {
        dbsetEntry.setUpdate_user_no(user.getUserNo());
        String oldName = dataBaseSetEntryDao.getDataBaseSetEntryById(dbsetEntry.getId()).getName();
        ValidateResult validateRes = databaseSetService.validatePermision(user, errors)
                .addAssert(() -> databaseSetEntryService.isNotExistByName(dbsetEntry), dbsetEntry.getName() + " 已存在！")
                .addAssert(() -> dataBaseSetEntryDao.updateDatabaseSetEntry(dbsetEntry) > 0, message.db_message_update_operation_failed).validate();
        if (!validateRes.isValid()) {
            return ServiceResult.fail(validateRes.getSummarize());
        }
        return databaseSetEntryService.updateDataCenter(user, dbsetEntry);
    }

}