package com.zswl.dataservice.controller; import com.zswl.dataservice.model.mqtt.SendMessageModel; import com.zswl.dataservice.service.artemis.OperationMessageService; import com.zswl.dataservice.service.other.ScanExecuteService; import com.zswl.dataservice.utils.result.ResultContent; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; /** * */ @RequestMapping("/test") @RestController @Validated @Tag(name = "测试接口") public class TestController { @Autowired OperationMessageService operationMessageService; @Autowired ScanExecuteService scanExecuteService; @Operation(summary = "发送指令") @RequestMapping(value = "free/sendMessage", method = {RequestMethod.POST}) public ResultContent sendMessage(@RequestBody SendMessageModel param) { return operationMessageService.sendMessage(param); } @Operation(summary = "ping") @RequestMapping(value = "free/ping", method = {RequestMethod.GET}) public ResultContent ping() { return ResultContent.buildSuccess(System.currentTimeMillis()); } @Operation(summary = "scanSystemExecuteMethod") @RequestMapping(value = "free/scanSystemExecuteMethod", method = {RequestMethod.GET}) public ResultContent scanSystemExecuteMethod() { scanExecuteService.scanSystemExecuteMethod(); return ResultContent.buildSuccess(); } }