Files
fastapi-best-architecture/backend/app/common/enums.py
T
Wu Clan 6c5e7a6881 Add department-related interfaces and others (#101)
* Add tool to build tree structure data

* Update to keyword parameter style

* Add department-related interfaces

* Update departmental section interface permissions

* Add TODO and minor fixes

* Fix department relationships

* Fix user foreign key relationship deletion setting

* Add path parameters to the operation log

* Complete todo items

* Update department deletion logic

* Update operation log entry records

* Add AES encryption algorithm

* Add operation log request entry to the secret

* Fix naming prefixes

* Add easy encryption tools

* FIX CASBIN_EXCLUDE typing

* Update user password reset interface

* Add confirm_password to the operation log encryption
2023-06-09 11:00:13 +08:00

73 lines
1.1 KiB
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from enum import Enum
class EnumBase(Enum):
@classmethod
def get_member_values(cls):
return [item.value for item in cls._member_map_.values()]
@classmethod
def get_member_names(cls):
return [name for name in cls._member_names_]
class IntEnum(int, EnumBase):
"""整型枚举"""
pass
class StrEnum(str, EnumBase):
"""字符串枚举"""
pass
class MenuType(IntEnum):
"""菜单类型"""
directory = 0
menu = 1
button = 2
class RoleDataScope(IntEnum):
"""数据范围"""
all = 1
custom = 2
class MethodType(StrEnum):
"""请求方法"""
GET = 'GET'
POST = 'POST'
PUT = 'PUT'
DELETE = 'DELETE'
PATCH = 'PATCH'
class LoginLogStatus(IntEnum):
"""登陆日志状态"""
fail = 0
success = 1
class BuildTreeType(StrEnum):
"""构建树形结构类型"""
traversal = 'traversal'
recursive = 'recursive'
class OperaLogCipherType(IntEnum):
"""操作日志加密类型"""
aes = 0
md5 = 1
plan = 2