class ProjectController {

    @RequestMapping(value = "/update", method = RequestMethod.PUT)
    public ServiceResult<String> update(@Validated(UpdateProject.class) @RequestBody Project project, @CurrentUser LoginUser user, Errors errors) throws Exception {
        project.setUpdate_user_no(user.getUserNo());
        Project oldProject = projectDao.getProjectByID(project.getId());
        ProjectView oldProjectView = projectDao.getProjectViewById(project.getId());
        ValidateResult validateRes = projectService.validatePermision(user, project, errors)
                .addAssert(() -> projectService.isNotExistByName(project), project.getName() + " 已存在！")
                .addAssert(() -> projectService.isNotExistByAppId(project), "APPID:" + project.getApp_id() + " 已存在！")
                .addAssert(() -> projectService.updateProject(project)).validate();
        if (!validateRes.isValid()) {
            return ServiceResult.fail(validateRes.getSummarize());
        }
        return projectService.updateDataCenter(user, oldProject, oldProjectView, project);
    }

}