39 changed files with 354 additions and 121 deletions
@ -0,0 +1,44 @@ |
|||||
|
package com.epmet.commons.tools.enums; |
||||
|
|
||||
|
/** |
||||
|
* 系统环境变量枚举类 |
||||
|
* dev|test|prod |
||||
|
* |
||||
|
* @author jianjun liu |
||||
|
* @date 2020-07-03 11:14 |
||||
|
**/ |
||||
|
public enum EnvEnum { |
||||
|
DEV("dev", "开发环境"), |
||||
|
TEST("test", "体验环境"), |
||||
|
PROD("prod", "生产环境"), |
||||
|
UN_KNOWN("un_known", "未知"), |
||||
|
; |
||||
|
|
||||
|
private String code; |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
|
||||
|
EnvEnum(String code, String name) { |
||||
|
this.code = code; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public static EnvEnum getEnum(String code) { |
||||
|
EnvEnum[] values = EnvEnum.values(); |
||||
|
for (EnvEnum value : values) { |
||||
|
if (code != null && value.getCode().equals(code)) { |
||||
|
return value; |
||||
|
} |
||||
|
} |
||||
|
return EnvEnum.UN_KNOWN; |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import io.swagger.annotations.Api; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* 定时任务 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@RestController |
||||
|
@RequestMapping("demo") |
||||
|
@Api(tags="定时任务") |
||||
|
public class DemoController { |
||||
|
@GetMapping("testAlarm") |
||||
|
public void testAlarm() { |
||||
|
//for (int i = 0; i < 20; i++) {
|
||||
|
log.error("测试消息"); |
||||
|
//}
|
||||
|
} |
||||
|
} |
Loading…
Reference in new issue