class DatabaseController {

    @RequestMapping(value = "/syncdb")
    public ServiceResult<String> syncdb(@Validated(AddDataBase.class) @RequestBody DataBaseInfo dataBaseInfo, @CurrentUser LoginUser user, Errors errors) throws Exception {
        DasGroup dasGroup = groupDao.getGroupByName(dataBaseInfo.getGroup_name());
        if (dasGroup == null) {
            return ServiceResult.fail("请先同步组！" + dataBaseInfo.getGroup_name());
        }
        dataBaseInfo.setDal_group_id(dasGroup.getId());
        return addDataBase(dataBaseInfo, user, errors);
    }

}