class DatabaseSetEntryController {

    @RequestMapping(value = "/syncdb")
    public ServiceResult<String> syncdb(@Validated(AddDbSetEntry.class) @RequestBody DatabaseSetEntry dbsetEntry, @CurrentUser LoginUser user, Errors errors) throws Exception {
        DataBaseInfo dataBaseInfo = dataBaseDao.getDatabaseByName(dbsetEntry.getDbName());
        if (dataBaseInfo == null) {
            return ServiceResult.fail("请先同步物理库！" + dbsetEntry.getDbName());
        }
        DatabaseSet databaseSet = databaseSetDao.getDatabaseSetByName(dbsetEntry.getDbsetName());
        if (databaseSet == null) {
            return ServiceResult.fail("请先同步逻辑库！" + dbsetEntry.getDbsetName());
        }

        dbsetEntry.setDb_Id(dataBaseInfo.getId());
        dbsetEntry.setDbset_id(databaseSet.getId());
        return addDbSetEntry(dbsetEntry, user, errors);
    }

}