@Path("/stats") @Component @Api(value = "/stats", description = "Resource to show stats for a box using sigar") public class StatsResource implements RestResource { @GET @Path("/ping") @Produces("application/json") @ApiOperation(value = "Make a ping call", response = List.class) public List<Integer> getMachineStats() { return ImmutableList.of(1); } }
@GET @Path("/ping") @Produces("application/json") @ApiOperation(value = "Make a ping call", response = List.class) public List<Integer> getMachineStats() { return ImmutableList.of(1); } }
@RequestMapping(method = RequestMethod.DELETE) @Authorization @ApiOperation(value = "退出登录") @ApiImplicitParams({ @ApiImplicitParam(name = "authorization", value = "authorization", required = true, dataType = "string", paramType = "header"), }) public ResponseEntity<ResultModel> logout(@CurrentUser User user) { tokenManager.deleteToken(user.getId()); return new ResponseEntity<>(ResultModel.ok(), HttpStatus.OK); }
@ApiModel public static class Source{ @ApiModelProperty public String name; @ApiModelProperty public List<Channel> channels; @ApiModelProperty public Double min_time = 0.0; @ApiModelProperty public Double max_time = 0.0; }
/** * @return the version */ @ApiModelProperty(value = "Versio", required = true) public int getVersion() { return version; }
@ApiProperty(value = "Expression to use for condition logic", allowableValues = "ALL, ANY") public String getConditionMode() { return conditionMode; }
@Override public Integer apply(ApiModelProperty annotation) { return annotation.position(); } };
@ApiModel public static class ViewsList{ @ApiModelProperty public LinkedList<ViewStub> views = new LinkedList<ViewStub>(); void populateViews(EntityManager em, Gson gson, long guestId){ List<GrapherView> viewList = JPAUtils.find(em, GrapherView.class,"grapherView",guestId); for (GrapherView view : viewList){ views.add(0,new ViewStub(view,gson)); } } }
@RequestMapping(method = RequestMethod.POST) @ApiOperation(value = "登录") public ResponseEntity<ResultModel> login(@RequestParam String username, @RequestParam String password) { Assert.notNull(username, "username can not be empty"); Assert.notNull(password, "password can not be empty"); User user = userRepository.findByUsername(username); if (user == null || //未注册 !user.getPassword().equals(password)) { //密码错误 //提示用户名或密码错误 return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.NOT_FOUND); } //生成一个token,保存用户登录状态 TokenModel model = tokenManager.createToken(user.getId()); return new ResponseEntity<>(ResultModel.ok(model), HttpStatus.OK); }
/** * @return the ryhmatyypit */ @ApiModelProperty(value = "Ryhmätyypit", required = true) public List<String> getRyhmatyypit() { return ryhmatyypit; }
@ApiProperty(value = "The type of the property", allowableValues = "STRING, LONG_STRING, PASSWORD, BOOLEAN, INTEGER, LONG, FLOAT, DOUBLE, FILE, DIRECTORY") public PropertySimpleType getType() { return type; }
/** * User: candide * Date: 08/07/14 * Time: 11:53 */ @ApiModel(value = "Generic data model for CalendarData Store operations") public class AvatarImageModel { @ApiModelProperty(value="The type of avatar", allowableValues = "facebook, gravatar", required=true) public String type; @ApiModelProperty(value="The gravatar image's URL", required=true) public String url; public AvatarImageModel() {} }
/** * @return the parentOidPath */ @ApiModelProperty(value = "Parent oid polkuna", required = true) public String getParentOidPath() { return parentOidPath; }
@ApiProperty(value = "The category. See POST /alert/defintion/{id}/condition for details.", allowableValues = "AVAILABILITY, THRESHOLD, BASELINE, CHANGE, TRAIT, CONTROL, ALERT, RESOURCE_CONFIG, EVENT, DRIFT, RANGE, AVAIL_DURATION") public String getCategory() { return category; }
/** * @return the status */ @ApiModelProperty(value = "Organisaation tila", required = true) public String getStatus() { return status; }
/** * Gets the value of the vainLakkautetut property. */ @ApiModelProperty(value = "Otetaanko vain lakkautetut organisaatiot mukaan hakutuloksiin", required = true) public boolean getVainLakkautetut() { return vainLakkautetut; }
/** * @return the alkuPvm */ @ApiModelProperty(value = "Ryhmän voimassaolon alkupäivämäärä", required = true) public Date getAlkuPvm() { return alkuPvm; }
/** * @return the parentOid */ @ApiModelProperty(value = "Parent oid", required = true) public String getParentOid() { return parentOid; }
/** * @return the oid */ @ApiModelProperty(value = "Organisaation oid", required = true) public String getOid() { return oid; }
/** * @return the _tyypit */ @ApiModelProperty(value = "Organisaation tyypit", required = true) public List<String> getTyypit() { return _tyypit; }