class DatabaseController {

    @RequestMapping(value = "/addDbs", method = RequestMethod.POST)
    public ServiceResult<String> addDbs(@RequestBody List<DataBaseInfo> list, @CurrentUser LoginUser user, Errors errors) throws Exception {
        ValidateResult validateRes = databaseService.validatePermision(user, errors)
                .addAssert(() -> databaseService.encryptAndOptUser(user, list))
                .addAssert(() -> databaseService.addDataBaseList(list)).validate();
        if (!validateRes.isValid()) {
            return ServiceResult.fail(validateRes.getSummarize());
        }
        return databaseService.addDataCenter(user, list);
    }

}