fix: demo

This commit is contained in:
2025-11-21 14:57:04 +08:00
parent c5b047a921
commit 98e0bbcaa6
6 changed files with 135 additions and 11 deletions

View File

@@ -0,0 +1,23 @@
package org.nl.setting.modular.controller;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: lyd
* @Date: 2025/11/21
*/
@RequestMapping("/api")
@RestController
public class TestController {
@GetMapping("/")
public ResponseEntity<Object> PressedMonitor() {
return new ResponseEntity<>("aaa", HttpStatus.OK);
}
}

View File

@@ -13,4 +13,16 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<description>基础通用模块</description> <description>基础通用模块</description>
<dependencies>
<!-- web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project> </project>

View File

@@ -42,6 +42,32 @@
<groupId>org.nl</groupId> <groupId>org.nl</groupId>
<artifactId>nl-business-map</artifactId> <artifactId>nl-business-map</artifactId>
</dependency> </dependency>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- dynamic-datasource -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
</dependency>
<!-- mysql -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
</dependencies> </dependencies>

View File

@@ -0,0 +1,74 @@
/*
* Copyright [2022] [https://www.xiaonuo.vip]
*
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
*
* 1.请不要删除和修改根目录下的LICENSE文件。
* 2.请不要删除和修改Snowy源码头部的版权声明。
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作。
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package org.nl;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* SpringBoot方式启动类
*
* @author xuyuxiang
* @date 2021/12/18 16:57
*/
@Slf4j
@RestController
@SpringBootApplication
public class Application {
/* 解决druid 日志报错discard long time none received connection:xxx */
static {
System.setProperty("druid.mysql.usePingMethod","false");
}
/**
* 主启动函数
*
* @author xuyuxiang
* @date 2022/7/30 21:42
*/
@SneakyThrows
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.setBannerMode(Banner.Mode.OFF);
ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
Environment env = configurableApplicationContext.getEnvironment();
log.info("""
----------------------------------------------------------
Application is running! Access URLs:
Local: http://localhost:{}
Doc: http://localhost:{}/doc.html
----------------------------------------------------------""",
env.getProperty("server.port"),
env.getProperty("server.port"));
}
/**
* 首页
*
* @author xuyuxiang
* @date 2022/7/8 14:22
**/
@GetMapping("/")
public String index() {
return "WELCOME";
}
}

View File

@@ -1,11 +0,0 @@
package org.nl;
/**
* @Author: lyd
* @Date: ${DATE}
*/
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}