feat: 添加启动日志和Swagger访问信息

This commit is contained in:
Jie Zheng 2024-12-27 17:58:48 +08:00
parent 232bcc1c38
commit 9ce4838a68

View File

@ -16,6 +16,7 @@
package me.zhengjie;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.rest.AnonymousGetMapping;
import me.zhengjie.utils.SpringContextHolder;
import org.springframework.boot.SpringApplication;
@ -30,6 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
* @author Zheng Jie
* @date 2018/11/15 9:20:19
*/
@Slf4j
@EnableAsync
@RestController
@Api(hidden = true)
@ -43,6 +45,11 @@ public class AppRun {
// 或者在 application.yml 添加文件路径方便 killkill `cat /home/eladmin/app.pid`
springApplication.addListeners(new ApplicationPidFileWriter());
springApplication.run(args);
log.info("---------------------------------------------");
log.info("Backend service started successfully");
log.info("Local: {}", "http://localhost:8000");
log.info("Swagger: {}", "http://localhost:8000/doc.html");
log.info("---------------------------------------------");
}
@Bean