|
|
@@ -21,6 +21,8 @@ import com.nju.edu.gitlab.SeecoderGitlabException;
|
|
|
import com.nju.edu.gitlab.dto.member.AccessLevelForm;
|
|
|
import com.nju.edu.gitlab.dto.project.VisibilityForm;
|
|
|
import org.apache.http.HttpStatus;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -42,6 +44,8 @@ public class ProjectServiceImpl implements ProjectService {
|
|
|
|
|
|
private final ApplicationProperties properties;
|
|
|
|
|
|
+ private final static Logger log = LoggerFactory.getLogger(ProjectServiceImpl.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
public ProjectServiceImpl(ProjectMapper projectMapper, ProjectRelatedMapper projectRelatedMapper, UserMapper userMapper, SeecoderGitlabApi seecoderGitlabApi, ApplicationProperties properties) {
|
|
|
this.projectMapper = projectMapper;
|
|
|
@@ -86,6 +90,7 @@ public class ProjectServiceImpl implements ProjectService {
|
|
|
BeanUtils.copyProperties(vo, po);
|
|
|
try {
|
|
|
com.nju.edu.gitlab.vo.ProjectVO project = seecoderGitlabApi.createPrivateProject(po.getName(), vo.isPublic()?VisibilityForm.PUBLIC:VisibilityForm.PRIVATE, UserService.loginUser().getId());
|
|
|
+ log.info("项目可见性为:{}", vo.isPublic());
|
|
|
po.setId(project.getProjectId());
|
|
|
po.setGitRemoteUrl(project.getWebUrl());
|
|
|
} catch (SeecoderGitlabException e) {
|
|
|
@@ -162,7 +167,9 @@ public class ProjectServiceImpl implements ProjectService {
|
|
|
public List<UserVO> getProjectMembers(Integer projectId) throws ServiceException {
|
|
|
List<Integer> userIds;
|
|
|
try {
|
|
|
+ log.info("project:{}准备获取项目成员", projectId);
|
|
|
userIds = seecoderGitlabApi.getJoinedUserByProject(projectId);
|
|
|
+ log.info("项目成员获取完毕");
|
|
|
} catch (SeecoderGitlabException e) {
|
|
|
throw new ServiceException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "获取项目成员失败", e);
|
|
|
}
|