Spring Boot程序接收命令行参数

输入一行,回车,触发一次。如果想要调用service层,也是可以,能调用service层,就可以做很多事,触发一次就好比调用了一次http接口一样

package com.aircas.satellitemanagement;

import com.aircas.satellitemanagement.station.service.PlanFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ApplicationContext; import java.util.Scanner; @SpringBootApplication
@ServletComponentScan
public class SatelliteManagementApplication implements CommandLineRunner { @Autowired
PlanFileService planFileService; public static void main(String[] args) {
SpringApplication.run(SatelliteManagementApplication.class, args); } @Override
public void run(String... args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNext()) {
String s = scanner.nextLine();
System.out.println("test::::::" + s);
planFileService.getAllPlanFile();
} }
}

Spring Boot程序接收命令行参数的更多相关文章

  1. C#_WinForm接收命令行参数

    C#_WinForm接收命令行参数 2014-08-03 10:17 534人阅读 评论(0) 收藏 举报 首先,我要仔细的声明下,本文讲的是接受命令行参数,让程序启动.而不是启动那个黑黑的框...我 ...

  2. (转)C#_WinForm接收命令行参数

    本文转载自:http://blog.csdn.net/lysc_forever/article/details/38356007 首先,我要仔细的声明下,本文讲的是接受命令行参数,让程序启动.而不是启 ...

  3. 自定义实现InputFormat、OutputFormat、输出到多个文件目录中去、hadoop1.x api写单词计数的例子、运行时接收命令行参数,代码例子

    一:自定义实现InputFormat *数据源来自于内存 *1.InputFormat是用于处理各种数据源的,下面是实现InputFormat,数据源是来自于内存. *1.1 在程序的job.setI ...

  4. 给go程序添加命令行参数

    操作系统: CentOS 6.9_x64 go语言版本: 1.8.3 问题描述 需要应用程序根据不同的配置文件访问不同的服务器,希望程序启动时可以指定配置文件. 解决方案 package main i ...

  5. 让browserify接收命令行参数,在打包时parse yml配置文件

    功能需求: 1用browserify把各种js打包成浏览器端的1个bundle.js,含有yml配置文件 约束: 1 yml配置文件不在当前工程里(现在还不知道放哪里,以后也会变),希望在打包时,用命 ...

  6. Win32程序支持命令行参数的做法(转载)

    转载:http://www.cnblogs.com/lanzhi/p/6470406.html 转载:http://blog.csdn.net/kelsel/article/details/52759 ...

  7. Win32程序支持命令行参数的做法

    作者:朱金灿 来源:http://blog.csdn.net/clever101 首先说说Win 32 API程序如何支持命令行参数.Win 32程序的入口函数为: int APIENTRY _tWi ...

  8. 在Xcode4中给程序提供命令行参数(转)

    网上xcode4的资料实在是不多,再加上xcode4相对3的改动还那么大,并且还只有英文版.我为了这个问题头痛了很久.后来终于找到了...方法如下 xcode菜单的Product->EditSc ...

  9. Spring Boot 配置文件和命令行配置

    Spring Boot 属于约定大于配置,就是说 Spring Boot 推荐不做配置,很多都是默认配置,但如果想要配置系统,使得软件符合业务定义,Spring Boot 可以通过多种方式进行配置. ...

随机推荐

  1. d3动态坐标轴

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. mysql 报 'Host ‘XXXXXX’ is blocked because of many connection errors'

    1. 问题:服务启动时,日志报错,导致启动失败: Caused by: com.mysql.cj.exceptions.CJException: null,  message from server: ...

  3. 【编程思想】【设计模式】【创建模式creational】Borg/Monostate

    Python版 https://github.com/faif/python-patterns/blob/master/creational/borg.py #!/usr/bin/env python ...

  4. oracle name

    1.db_name 数据库名 SQL> connect xys/manager as sysdba 已连接. SQL> show user USER 为 "SYS" S ...

  5. 创建线程的第二种方式------实现Runnable接口的方式

    package cn.itcast.demo16.Demo07.Runnable;/** * @author newcityman * @date 2019/7/22 - 23:17 */public ...

  6. ES6解构赋值的简单使用

    相较于常规的赋值方式,解构赋值最主要的是'解构'两个字,在赋值的过程中要清晰的知道等号右边的结构. 先简单地看一下原来的赋值方式. var a=[1,2] 分析一下这句代码的几个点: (1)变量申明和 ...

  7. [BUUCTF]PWN——others_babystack

    others_babystack 附件 步骤: 例行检查,64位程序,开了挺多保护 本地试运行一下程序 64位ida载入,看main函数 1是read函数,存在栈溢出:2是puts函数,3退出 利用思 ...

  8. [BUUCTF]REVERSE——不一样的flag

    不一样的flag 附件 步骤 例行查壳儿,32位程序,无壳儿 32位ida载入,shift+f12检索程序里的字符串,看到了如图标记的字符串,加上下面又上下左右的选项,估计是道迷宫类型的题目 将迷宫字 ...

  9. Visual SVN安装使用教程

    visual svn使用教程  SVN简介: 为什么要使用SVN? 程序员在编写程序的过程中,每个程序员都会生成很多不同的版本,这就需要程序员有效的管理代码,在需要的时候可以迅速,准确取出相应的版本. ...

  10. Windows服务(.net Core 3.1-Topshelf-log4net-quartz)

    https://github.com/yezei/Topshelf-log4net-quartz.git