##### Coverage Report - com.ctrip.framework.apollo.biz.service.CommitService

Classes in this File | Line Coverage | Branch Coverage | Complexity
CommitService |
25% | 1/4
N/A | N/A
| 1.0;1

1 |  |
     package com.ctrip.framework.apollo.biz.service;
2 |  |
3 |  |
     import com.ctrip.framework.apollo.biz.entity.Commit;
4 |  |
     import com.ctrip.framework.apollo.biz.repository.CommitRepository;
5 |  |
6 |  |
     import org.springframework.beans.factory.annotation.Autowired;
7 |  |
     import org.springframework.data.domain.Pageable;
8 |  |
     import org.springframework.stereotype.Service;
9 |  |
     import org.springframework.transaction.annotation.Transactional;
10 |  |
11 |  |
     import java.util.List;
12 |  |
13 |  |
     @Service
14 | 1 |
     public class CommitService {
15 |  |
16 |  |
       @Autowired
17 |  |
       private CommitRepository commitRepository;
18 |  |
19 |  |
       @Transactional
20 |  |
       public Commit save(Commit commit){
21 | 0 |
         commit.setId(0);//protection
22 | 0 |
         return commitRepository.save(commit);
23 |  |
       }
24 |  |
25 |  |
       public List<Commit> find(String appId, String clusterName, String namespaceName, Pageable page){
26 | 0 |
         return commitRepository.findByAppIdAndClusterNameAndNamespaceNameOrderByIdDesc(appId, clusterName, namespaceName, page);
27 |  |
       }
28 |  |
29 |  |
     }