| 1 | |
package com.ctrip.framework.apollo.adminservice.controller; |
| 2 | |
|
| 3 | |
import org.springframework.beans.factory.annotation.Autowired; |
| 4 | |
import org.springframework.http.HttpStatus; |
| 5 | |
import org.springframework.http.ResponseEntity; |
| 6 | |
import org.springframework.web.bind.annotation.PathVariable; |
| 7 | |
import org.springframework.web.bind.annotation.RequestBody; |
| 8 | |
import org.springframework.web.bind.annotation.RequestMapping; |
| 9 | |
import org.springframework.web.bind.annotation.RequestMethod; |
| 10 | |
import org.springframework.web.bind.annotation.RestController; |
| 11 | |
|
| 12 | |
import com.ctrip.framework.apollo.adminservice.aop.PreAcquireNamespaceLock; |
| 13 | |
import com.ctrip.framework.apollo.biz.service.ItemSetService; |
| 14 | |
import com.ctrip.framework.apollo.core.dto.ItemChangeSets; |
| 15 | |
|
| 16 | |
@RestController |
| 17 | 1 | public class ItemSetController { |
| 18 | |
|
| 19 | |
@Autowired |
| 20 | |
private ItemSetService itemSetService; |
| 21 | |
|
| 22 | |
@PreAcquireNamespaceLock |
| 23 | |
@RequestMapping(path = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/itemset", method = RequestMethod.POST) |
| 24 | |
public ResponseEntity<Void> create(@PathVariable String appId, @PathVariable String clusterName, |
| 25 | |
@PathVariable String namespaceName, @RequestBody ItemChangeSets changeSet) { |
| 26 | |
|
| 27 | 5 | itemSetService.updateSet(appId, clusterName, namespaceName, changeSet); |
| 28 | |
|
| 29 | 5 | return ResponseEntity.status(HttpStatus.OK).build(); |
| 30 | |
} |
| 31 | |
|
| 32 | |
|
| 33 | |
} |