|
|
@@ -0,0 +1,81 @@
|
|
|
+package seecoder.devcloud.web.service.impl.project;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import seecoder.devcloud.web.dao.project.BugListMapper;
|
|
|
+import seecoder.devcloud.web.model.enums.BugListStateEnum;
|
|
|
+import seecoder.devcloud.web.model.po.project.BugListPO;
|
|
|
+import seecoder.devcloud.web.model.vo.project.BugListCreateVO;
|
|
|
+import seecoder.devcloud.web.model.vo.project.BugListUpdateBasicVO;
|
|
|
+import seecoder.devcloud.web.model.vo.project.BugListVO;
|
|
|
+import seecoder.devcloud.web.service.project.BugListService;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author PuHong Weng
|
|
|
+ * @date 2021/3/21
|
|
|
+ * @description:
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class BugListServiceImpl implements BugListService {
|
|
|
+
|
|
|
+ private final BugListMapper bugListMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public BugListServiceImpl(BugListMapper bugListMapper) {
|
|
|
+ this.bugListMapper = bugListMapper;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void create(BugListCreateVO vo) {
|
|
|
+ BugListPO po = BugListPO.builder()
|
|
|
+ .title(vo.getTitle())
|
|
|
+ .description(vo.getDescription())
|
|
|
+ .expectedTimeCost(vo.getExpectedTimeCost())
|
|
|
+ .state(BugListStateEnum.PENDING)
|
|
|
+ .priority(vo.getPriority())
|
|
|
+ .startTime(null)
|
|
|
+ .endTime(null)
|
|
|
+ .projectId(vo.getProjectId())
|
|
|
+ .build();
|
|
|
+ bugListMapper.insert(po, "startTime");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void finish(Integer id) {
|
|
|
+ BugListPO bugListPO = new BugListPO();
|
|
|
+ bugListPO.setId(id);
|
|
|
+ bugListPO.setState(BugListStateEnum.FINISHED);
|
|
|
+ bugListMapper.update(bugListPO);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<BugListVO> list(Integer projectId) {
|
|
|
+ List<BugListPO> pos = bugListMapper.selectByProjectId(projectId);
|
|
|
+ List<BugListVO> vos = pos.stream().map(x->new BugListVO(x)).collect(Collectors.toList());
|
|
|
+ //todo 获取commit信息,填入
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updateBasicInfo(BugListUpdateBasicVO vo) {
|
|
|
+ BugListPO po = BugListPO.builder()
|
|
|
+ .priority(vo.getPriority())
|
|
|
+ .title(vo.getTitle())
|
|
|
+ .description(vo.getDescription())
|
|
|
+ .expectedTimeCost(vo.getExpectedTimeCost())
|
|
|
+ .build();
|
|
|
+ bugListMapper.update(po);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void handlerConfig(){
|
|
|
+ //todo 处理commit信息
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|