【提交】项目提交
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package pc.exam.pp.server;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 项目的启动类
|
||||
*
|
||||
* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||
* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||
* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${exam.info.base-package}
|
||||
@SpringBootApplication(scanBasePackages = {"${exam.info.base-package}.server", "${exam.info.base-package}.module"})
|
||||
public class ExamServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||
|
||||
SpringApplication.run(ExamServerApplication.class, args);
|
||||
// new SpringApplicationBuilder(ExamServerApplication.class)
|
||||
// .applicationStartup(new BufferingApplicationStartup(20480))
|
||||
// .run(args);
|
||||
|
||||
// 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,94 @@
|
||||
package pc.exam.pp.server.controller;
|
||||
|
||||
import pc.exam.pp.framework.common.pojo.CommonResult;
|
||||
import pc.exam.pp.framework.common.util.servlet.ServletUtils;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static pc.exam.pp.framework.common.exception.enums.GlobalErrorCodeConstants.NOT_IMPLEMENTED;
|
||||
|
||||
/**
|
||||
* 默认 Controller,解决部分 module 未开启时的 404 提示。
|
||||
* 例如说,/bpm/** 路径,工作流
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class DefaultController {
|
||||
|
||||
@RequestMapping("/admin-api/bpm/**")
|
||||
public CommonResult<Boolean> bpm404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[工作流模块 exam-module-bpm - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]");
|
||||
}
|
||||
|
||||
@RequestMapping("/admin-api/mp/**")
|
||||
public CommonResult<Boolean> mp404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[微信公众号 exam-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]");
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/admin-api/product/**", // 商品中心
|
||||
"/admin-api/trade/**", // 交易中心
|
||||
"/admin-api/promotion/**" }) // 营销中心
|
||||
public CommonResult<Boolean> mall404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[商城系统 exam-module-mall - 已禁用][参考 https://doc.iocoder.cn/mall/build/ 开启]");
|
||||
}
|
||||
|
||||
@RequestMapping("/admin-api/erp/**")
|
||||
public CommonResult<Boolean> erp404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[ERP 模块 exam-module-erp - 已禁用][参考 https://doc.iocoder.cn/erp/build/ 开启]");
|
||||
}
|
||||
|
||||
@RequestMapping("/admin-api/crm/**")
|
||||
public CommonResult<Boolean> crm404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[CRM 模块 exam-module-crm - 已禁用][参考 https://doc.iocoder.cn/crm/build/ 开启]");
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/admin-api/report/**"})
|
||||
public CommonResult<Boolean> report404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[报表模块 exam-module-report - 已禁用][参考 https://doc.iocoder.cn/report/ 开启]");
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/admin-api/pay/**"})
|
||||
public CommonResult<Boolean> pay404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[支付模块 exam-module-pay - 已禁用][参考 https://doc.iocoder.cn/pay/build/ 开启]");
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/admin-api/ai/**"})
|
||||
public CommonResult<Boolean> ai404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[AI 大模型 exam-module-ai - 已禁用][参考 https://doc.iocoder.cn/ai/build/ 开启]");
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/admin-api/iot/**"})
|
||||
public CommonResult<Boolean> iot404() {
|
||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||
"[IoT 物联网 exam-module-iot - 已禁用][参考 https://doc.iocoder.cn/iot/build/ 开启]");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试接口:打印 query、header、body
|
||||
*/
|
||||
@RequestMapping(value = { "/test" })
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> test(HttpServletRequest request) {
|
||||
// 打印查询参数
|
||||
log.info("Query: {}", ServletUtils.getParamMap(request));
|
||||
// 打印请求头
|
||||
log.info("Header: {}", ServletUtils.getHeaderMap(request));
|
||||
// 打印请求体
|
||||
log.info("Body: {}", ServletUtils.getBody(request));
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user