| 1 | |
package com.ctrip.framework.apollo.adminservice.controller; |
| 2 | |
|
| 3 | |
import com.ctrip.framework.apollo.biz.entity.Commit; |
| 4 | |
import com.ctrip.framework.apollo.biz.service.CommitService; |
| 5 | |
import com.ctrip.framework.apollo.common.utils.BeanUtils; |
| 6 | |
import com.ctrip.framework.apollo.core.dto.CommitDTO; |
| 7 | |
|
| 8 | |
import org.springframework.beans.factory.annotation.Autowired; |
| 9 | |
import org.springframework.data.domain.Pageable; |
| 10 | |
import org.springframework.web.bind.annotation.PathVariable; |
| 11 | |
import org.springframework.web.bind.annotation.RequestMapping; |
| 12 | |
import org.springframework.web.bind.annotation.RestController; |
| 13 | |
|
| 14 | |
import java.util.List; |
| 15 | |
|
| 16 | |
|
| 17 | |
@RestController |
| 18 | 1 | public class CommitController { |
| 19 | |
|
| 20 | |
@Autowired |
| 21 | |
private CommitService commitService; |
| 22 | |
|
| 23 | |
@RequestMapping(value = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/commit") |
| 24 | |
public List<CommitDTO> find(@PathVariable String appId, @PathVariable String clusterName, |
| 25 | |
@PathVariable String namespaceName, Pageable pageable){ |
| 26 | |
|
| 27 | 0 | List<Commit> commits = commitService.find(appId, clusterName, namespaceName, pageable); |
| 28 | 0 | return BeanUtils.batchTransform(CommitDTO.class, commits); |
| 29 | |
} |
| 30 | |
|
| 31 | |
} |