gpt4 book ai didi

com.sitewhere.rest.model.device.Zone.copy()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 07:31:31 26 4
gpt4 key购买 nike

本文整理了Java中com.sitewhere.rest.model.device.Zone.copy()方法的一些代码示例,展示了Zone.copy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zone.copy()方法的具体详情如下:
包路径:com.sitewhere.rest.model.device.Zone
类名称:Zone
方法名:copy

Zone.copy介绍

[英]Create a copy of an SPI object. Used by web services for marshaling.
[中]创建SPI对象的副本。由web服务用于封送。

代码示例

代码示例来源:origin: com.sitewhere/sitewhere-rest

@RequestMapping(value = "/{zoneToken}", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "Get zone by token")
@Secured({ SiteWhereRoles.REST })
@Documented(examples = {
  @Example(stage = Stage.Response, json = Sites.CreateZoneRequest.class, description = "getZoneResponse.md") })
public Zone getZone(
  @ApiParam(value = "Unique token that identifies zone", required = true) @PathVariable String zoneToken,
  HttpServletRequest servletRequest) throws SiteWhereException {
Tracer.start(TracerCategory.RestApiCall, "getZone", LOGGER);
try {
  IZone found = SiteWhere.getServer().getDeviceManagement(getTenant(servletRequest)).getZone(zoneToken);
  return Zone.copy(found);
} finally {
  Tracer.stop(LOGGER);
}
}

代码示例来源:origin: com.sitewhere/sitewhere-rest

/**
 * Update information for a zone.
 * 
 * @param input
 * @return
 * @throws SiteWhereException
 */
@RequestMapping(value = "/{zoneToken}", method = RequestMethod.PUT)
@ResponseBody
@ApiOperation(value = "Update an existing zone")
@Secured({ SiteWhereRoles.REST })
@Documented(examples = {
  @Example(stage = Stage.Request, json = Zones.UpdateZoneRequest.class, description = "updateZoneRequest.md"),
  @Example(stage = Stage.Response, json = Zones.UpdateZoneResponse.class, description = "updateZoneResponse.md") })
public Zone updateZone(
  @ApiParam(value = "Unique token that identifies zone", required = true) @PathVariable String zoneToken,
  @RequestBody ZoneCreateRequest request, HttpServletRequest servletRequest) throws SiteWhereException {
Tracer.start(TracerCategory.RestApiCall, "updateZone", LOGGER);
try {
  IZone zone = SiteWhere.getServer().getDeviceManagement(getTenant(servletRequest)).updateZone(zoneToken,
    request);
  return Zone.copy(zone);
} finally {
  Tracer.stop(LOGGER);
}
}

代码示例来源:origin: com.sitewhere/sitewhere-rest

/**
   * Delete an existing zone.
   * 
   * @param zoneToken
   * @return
   * @throws SiteWhereException
   */
  @RequestMapping(value = "/{zoneToken}", method = RequestMethod.DELETE)
  @ResponseBody
  @ApiOperation(value = "Delete zone by unique token")
  @Secured({ SiteWhereRoles.REST })
  @Documented(examples = {
    @Example(stage = Stage.Response, json = Sites.CreateZoneRequest.class, description = "deleteZoneResponse.md") })
  public Zone deleteZone(
    @ApiParam(value = "Unique token that identifies zone", required = true) @PathVariable String zoneToken,
    @ApiParam(value = "Delete permanently", required = false) @RequestParam(defaultValue = "false") boolean force,
    HttpServletRequest servletRequest) throws SiteWhereException {
  Tracer.start(TracerCategory.RestApiCall, "deleteZone", LOGGER);
  try {
    IZone deleted = SiteWhere.getServer().getDeviceManagement(getTenant(servletRequest)).deleteZone(zoneToken,
      force);
    return Zone.copy(deleted);
  } finally {
    Tracer.stop(LOGGER);
  }
  }
}

代码示例来源:origin: com.sitewhere/sitewhere-rest

/**
 * Create a new zone for a site.
 * 
 * @param input
 * @return
 * @throws SiteWhereException
 */
@RequestMapping(value = "/{siteToken}/zones", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "Create new zone for site")
@Secured({ SiteWhereRoles.REST })
@Documented(examples = {
  @Example(stage = Stage.Request, json = Sites.CreateZoneRequest.class, description = "createZoneRequest.md"),
  @Example(stage = Stage.Response, json = Sites.CreateZoneResponse.class, description = "createZoneResponse.md") })
public Zone createZone(@ApiParam(value = "Unique site token", required = true) @PathVariable String siteToken,
  @RequestBody ZoneCreateRequest request, HttpServletRequest servletRequest) throws SiteWhereException {
Tracer.start(TracerCategory.RestApiCall, "createZone", LOGGER);
try {
  ISite site = SiteWhere.getServer().getDeviceManagement(getTenant(servletRequest)).getSiteByToken(siteToken);
  if (site == null) {
  throw new SiteWhereSystemException(ErrorCode.InvalidSiteToken, ErrorLevel.ERROR);
  }
  IZone zone = SiteWhere.getServer().getDeviceManagement(getTenant(servletRequest)).createZone(site, request);
  return Zone.copy(zone);
} finally {
  Tracer.stop(LOGGER);
}
}

代码示例来源:origin: com.sitewhere/sitewhere-core

zones.add(Zone.copy(match));

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com