class GroupDatabaseController {

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public ServiceResult<String> add(@Validated(AddGroupDB.class) @RequestBody DataBaseInfo dataBaseInfo, @CurrentUser LoginUser user, Errors errors) throws Exception {
        dataBaseInfo.setUpdateUserNo(user.getUserNo());
        ValidateResult validateRes = groupDatabaseService.validatePermision(user, errors)
                .addAssert(() -> !groupDatabaseService.isGroupHadDB(dataBaseInfo), "已存在此DB!!!")
                .addAssert(() -> dataBaseDao.updateDataBaseInfo(dataBaseInfo.getId(), dataBaseInfo.getDal_group_id(), dataBaseInfo.getComment()) > 0, message.db_message_add_operation_failed).validate();
        if (!validateRes.isValid()) {
            return ServiceResult.fail(validateRes.getSummarize());
        }

        return databaseService.genDefaultDbsetAndEntry(dataBaseInfo);
    }

}