##### Coverage Report - com.ctrip.apollo.adminservice.controller.ItemSetController

Classes in this File | Line Coverage | Branch Coverage | Complexity
ItemSetController |
100% | 3/3
N/A | N/A
| 1.0;1

1 |  |
     package com.ctrip.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.security.core.userdetails.UserDetails;
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.apollo.biz.service.ItemSetService;
13 |  |
     import com.ctrip.apollo.common.auth.ActiveUser;
14 |  |
     import com.ctrip.apollo.core.dto.ItemChangeSets;
15 |  |
16 |  |
     @RestController
17 | 1 |
     public class ItemSetController {
18 |  |
19 |  |
       @Autowired
20 |  |
       private ItemSetService itemSetService;
21 |  |
22 |  |
       @RequestMapping(path = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/itemset", method = RequestMethod.POST)
23 |  |
       public ResponseEntity<Void> create(@RequestBody ItemChangeSets changeSet, @ActiveUser UserDetails user) {
24 | 5 |
         itemSetService.updateSet(changeSet, user.getUsername());
25 | 5 |
         return ResponseEntity.status(HttpStatus.OK).build();
26 |  |
       }
27 |  |
     }