提交 | 用户 | 时间
|
1ac2bc
|
1 |
/** |
懒 |
2 |
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng) |
|
3 |
* <p> |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* <p> |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* <p> |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package cn.stylefeng.guns.sys.core.constant.state; |
|
17 |
|
|
18 |
/** |
|
19 |
* 菜单是否打开的状态 |
|
20 |
* |
|
21 |
* @author fengshuonan |
|
22 |
* @Date 2017年4月8日10:12:15 |
|
23 |
*/ |
|
24 |
public enum MenuOpenStatus { |
|
25 |
|
|
26 |
OPEN(1, "打开"), |
|
27 |
CLOSE(0, "关闭"); |
|
28 |
|
|
29 |
int code; |
|
30 |
String message; |
|
31 |
|
|
32 |
MenuOpenStatus(int code, String message) { |
|
33 |
this.code = code; |
|
34 |
this.message = message; |
|
35 |
} |
|
36 |
|
|
37 |
public int getCode() { |
|
38 |
return code; |
|
39 |
} |
|
40 |
|
|
41 |
public void setCode(int code) { |
|
42 |
this.code = code; |
|
43 |
} |
|
44 |
|
|
45 |
public String getMessage() { |
|
46 |
return message; |
|
47 |
} |
|
48 |
|
|
49 |
public void setMessage(String message) { |
|
50 |
this.message = message; |
|
51 |
} |
|
52 |
|
|
53 |
public static String valueOf(Integer status) { |
|
54 |
if (status == null) { |
|
55 |
return ""; |
|
56 |
} else { |
|
57 |
for (MenuOpenStatus s : MenuOpenStatus.values()) { |
|
58 |
if (s.getCode() == status) { |
|
59 |
return s.getMessage(); |
|
60 |
} |
|
61 |
} |
|
62 |
return ""; |
|
63 |
} |
|
64 |
} |
|
65 |
} |