123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- /*
- * *************************************************
- * Copyright (c) 2019 QMTH. All Rights Reserved.
- * Created by Deason on 2019-08-19 10:38:43.
- * *************************************************
- */
- package cn.com.qmth.examcloud.app.controller;
- import cn.com.qmth.examcloud.app.core.router.Router;
- import cn.com.qmth.examcloud.app.model.Result;
- import cn.com.qmth.examcloud.app.service.RouterService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_KEY;
- import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_TOKEN;
- /**
- * 路由相关接口
- *
- * @author: QMTH
- * @since: 2019/8/19
- */
- @RestController
- @RequestMapping("${$rmp}/")
- @Api(tags = "路由相关接口")
- public class RouterController {
- private static final Logger LOG = LoggerFactory.getLogger(RouterController.class);
- @Autowired
- private RouterService routerService;
- @ApiOperation(value = "路由接口")
- @PostMapping(value = "/router")
- public Result router(@RequestHeader(name = PARAM_APP_KEY) String key,
- @RequestHeader(name = PARAM_APP_TOKEN) String token,
- @RequestBody Router router) {
- router.setKey(key);
- router.setToken(token);
- return routerService.execute(router);
- }
- }
|