| | |
| | | package com.whyc.constant; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /**用户操作类型*/ |
| | | @JsonFormat(shape = JsonFormat.Shape.OBJECT) |
| | | public enum UserOperation { |
| | | /**操作类型*/ |
| | | TYPE_LOGIN(1,"登录系统"), |
| | |
| | | TYPE_DELETE(5,"删除"), |
| | | TYPE_CANCEL(7,"取消"), |
| | | TYPE_STOP(9,"终止"), |
| | | TYPE_GET(10,"读取"), |
| | | TYPE_DOWNLOAD(11,"下载"), |
| | | |
| | | TYPE_UNRECOGNIZED(-1,"无法识别的操作类型"), |
| | | |
| | |
| | | public void setTypeName(String typeName) { |
| | | this.typeName = typeName; |
| | | } |
| | | |
| | | public static String getNameByType(Integer type){ |
| | | UserOperation[] enums=values(); |
| | | for (UserOperation op:enums) { |
| | | if (op.getType()==type){ |
| | | return op.getTypeName(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |