|
|
|
@ -38,8 +38,11 @@ import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestAttribute; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
@ -57,7 +60,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
*/ |
|
|
|
|
@Api(tags = "ALERT_PLUGIN_INSTANCE_TAG") |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping("alert-plugin-instance") |
|
|
|
|
@RequestMapping("alert-plugin-instances") |
|
|
|
|
public class AlertPluginInstanceController extends BaseController { |
|
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(AlertPluginInstanceController.class); |
|
|
|
@ -81,7 +84,7 @@ public class AlertPluginInstanceController extends BaseController {
|
|
|
|
|
@ApiImplicitParam(name = "instanceName", value = "ALERT_PLUGIN_INSTANCE_NAME", required = true, dataType = "String", example = "DING TALK"), |
|
|
|
|
@ApiImplicitParam(name = "pluginInstanceParams", value = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, dataType = "String", example = "ALERT_PLUGIN_INSTANCE_PARAMS") |
|
|
|
|
}) |
|
|
|
|
@PostMapping(value = "/create") |
|
|
|
|
@PostMapping() |
|
|
|
|
@ResponseStatus(HttpStatus.CREATED) |
|
|
|
|
@ApiException(CREATE_ALERT_PLUGIN_INSTANCE_ERROR) |
|
|
|
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
|
|
|
@ -97,7 +100,7 @@ public class AlertPluginInstanceController extends BaseController {
|
|
|
|
|
* updateAlertPluginInstance |
|
|
|
|
* |
|
|
|
|
* @param loginUser login user |
|
|
|
|
* @param alertPluginInstanceId alert plugin instance id |
|
|
|
|
* @param id alert plugin instance id |
|
|
|
|
* @param instanceName instance name |
|
|
|
|
* @param pluginInstanceParams instance params |
|
|
|
|
* @return result |
|
|
|
@ -108,15 +111,15 @@ public class AlertPluginInstanceController extends BaseController {
|
|
|
|
|
@ApiImplicitParam(name = "instanceName", value = "ALERT_PLUGIN_INSTANCE_NAME", required = true, dataType = "String", example = "DING TALK"), |
|
|
|
|
@ApiImplicitParam(name = "pluginInstanceParams", value = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, dataType = "String", example = "ALERT_PLUGIN_INSTANCE_PARAMS") |
|
|
|
|
}) |
|
|
|
|
@PostMapping(value = "/update") |
|
|
|
|
@PutMapping(value = "/{id}") |
|
|
|
|
@ResponseStatus(HttpStatus.OK) |
|
|
|
|
@ApiException(UPDATE_ALERT_PLUGIN_INSTANCE_ERROR) |
|
|
|
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
|
|
|
|
public Result updateAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
|
|
|
|
@RequestParam(value = "alertPluginInstanceId") int alertPluginInstanceId, |
|
|
|
|
@PathVariable(value = "id") int id, |
|
|
|
|
@RequestParam(value = "instanceName") String instanceName, |
|
|
|
|
@RequestParam(value = "pluginInstanceParams") String pluginInstanceParams) { |
|
|
|
|
Map<String, Object> result = alertPluginInstanceService.update(loginUser, alertPluginInstanceId, instanceName, pluginInstanceParams); |
|
|
|
|
Map<String, Object> result = alertPluginInstanceService.update(loginUser, id, instanceName, pluginInstanceParams); |
|
|
|
|
return returnDataList(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -131,12 +134,12 @@ public class AlertPluginInstanceController extends BaseController {
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "id", value = "ALERT_PLUGIN_ID", required = true, dataType = "Int", example = "100") |
|
|
|
|
}) |
|
|
|
|
@GetMapping(value = "/delete") |
|
|
|
|
@DeleteMapping(value = "/{id}") |
|
|
|
|
@ResponseStatus(HttpStatus.OK) |
|
|
|
|
@ApiException(DELETE_ALERT_PLUGIN_INSTANCE_ERROR) |
|
|
|
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
|
|
|
|
public Result deleteAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
|
|
|
|
@RequestParam(value = "id") int id) { |
|
|
|
|
@PathVariable(value = "id") int id) { |
|
|
|
|
|
|
|
|
|
Map<String, Object> result = alertPluginInstanceService.delete(loginUser, id); |
|
|
|
|
return returnDataList(result); |
|
|
|
@ -150,12 +153,12 @@ public class AlertPluginInstanceController extends BaseController {
|
|
|
|
|
* @return result |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "getAlertPluginInstance", notes = "GET_ALERT_PLUGIN_INSTANCE_NOTES") |
|
|
|
|
@PostMapping(value = "/get") |
|
|
|
|
@GetMapping(value = "/{id}") |
|
|
|
|
@ResponseStatus(HttpStatus.OK) |
|
|
|
|
@ApiException(GET_ALERT_PLUGIN_INSTANCE_ERROR) |
|
|
|
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
|
|
|
|
public Result getAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
|
|
|
|
@RequestParam(value = "id") int id) { |
|
|
|
|
@PathVariable(value = "id") int id) { |
|
|
|
|
Map<String, Object> result = alertPluginInstanceService.get(loginUser, id); |
|
|
|
|
return returnDataList(result); |
|
|
|
|
} |
|
|
|
@ -166,8 +169,8 @@ public class AlertPluginInstanceController extends BaseController {
|
|
|
|
|
* @param loginUser login user |
|
|
|
|
* @return result |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "queryAllAlertPluginInstance", notes = "QUERY_ALL_ALERT_PLUGIN_INSTANCE_NOTES") |
|
|
|
|
@PostMapping(value = "/queryAll") |
|
|
|
|
@ApiOperation(value = "queryAlertPluginInstanceList", notes = "QUERY_ALL_ALERT_PLUGIN_INSTANCE_NOTES") |
|
|
|
|
@GetMapping(value = "/list") |
|
|
|
|
@ResponseStatus(HttpStatus.OK) |
|
|
|
|
@ApiException(QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR) |
|
|
|
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
|
|
|
@ -187,7 +190,7 @@ public class AlertPluginInstanceController extends BaseController {
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "alertInstanceName", value = "ALERT_INSTANCE_NAME", required = true, dataType = "String"), |
|
|
|
|
}) |
|
|
|
|
@GetMapping(value = "/verify-alert-instance-name") |
|
|
|
|
@GetMapping(value = "/verify-name") |
|
|
|
|
@ResponseStatus(HttpStatus.OK) |
|
|
|
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
|
|
|
|
public Result verifyGroupName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
|
|
|
@ -219,7 +222,7 @@ public class AlertPluginInstanceController extends BaseController {
|
|
|
|
|
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"), |
|
|
|
|
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20") |
|
|
|
|
}) |
|
|
|
|
@GetMapping(value = "/list-paging") |
|
|
|
|
@GetMapping() |
|
|
|
|
@ResponseStatus(HttpStatus.OK) |
|
|
|
|
@ApiException(LIST_PAGING_ALERT_PLUGIN_INSTANCE_ERROR) |
|
|
|
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
|
|
|
|