提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.infra.enums.codegen; |
H |
2 |
|
|
3 |
import lombok.AllArgsConstructor; |
|
4 |
import lombok.Getter; |
|
5 |
|
|
6 |
import static cn.hutool.core.util.ArrayUtil.*; |
|
7 |
|
|
8 |
/** |
|
9 |
* 代码生成的场景枚举 |
|
10 |
* |
|
11 |
* @author iailab |
|
12 |
*/ |
|
13 |
@AllArgsConstructor |
|
14 |
@Getter |
|
15 |
public enum CodegenSceneEnum { |
|
16 |
|
|
17 |
ADMIN(1, "管理后台", "admin", ""), |
|
18 |
APP(2, "用户 APP", "app", "App"); |
|
19 |
|
|
20 |
/** |
|
21 |
* 场景 |
|
22 |
*/ |
|
23 |
private final Integer scene; |
|
24 |
/** |
|
25 |
* 场景名 |
|
26 |
*/ |
|
27 |
private final String name; |
|
28 |
/** |
|
29 |
* 基础包名 |
|
30 |
*/ |
|
31 |
private final String basePackage; |
|
32 |
/** |
|
33 |
* Controller 和 VO 类的前缀 |
|
34 |
*/ |
|
35 |
private final String prefixClass; |
|
36 |
|
|
37 |
public static CodegenSceneEnum valueOf(Integer scene) { |
|
38 |
return firstMatch(sceneEnum -> sceneEnum.getScene().equals(scene), values()); |
|
39 |
} |
|
40 |
|
|
41 |
} |