| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | |
| | | /** |
| | |
| | | @SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked") |
| | | public class CommandCtrl { |
| | | |
| | | @GetMapping(path = "test") |
| | | public BaseResponse<String> test(){ |
| | | return BaseResponseUtils.buildSuccess("ok"); |
| | | } |
| | | |
| | | @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | public BaseResponse<Command> send(@RequestBody Command com) { |
| | | log.info("收到web系统发来的命令:\n" + com.toString()) ; |