Skip to content

Commit

Permalink
2024年5月8日 少量优化
Browse files Browse the repository at this point in the history
  • Loading branch information
ss1917 committed May 8, 2024
1 parent 08dd1be commit dd4b281
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion biz/handlers/config_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import json
import difflib
from libs.base_handler import BaseHandler
from libs.etcd import Etcd3Client
# from libs.etcd import Etcd3Client
from models.kerrigan import KerriganProject, KerriganConfig, KerriganHistory, KerriganPublish, KerriganPermissions
from websdk2.model_utils import model_to_dict
from websdk2.db_context import DBContextV2 as DBContext
Expand Down
32 changes: 16 additions & 16 deletions models/kerrigan.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@
Desc : 数据库ORM
"""

from datetime import datetime
from sqlalchemy import Column, String, Integer, DateTime, Text, Boolean
from sqlalchemy.ext.declarative import declarative_base
from datetime import datetime

Base = declarative_base()


class KerriganProject(Base):
__tablename__ = 'kerrigan_project'

### 项目表
# 项目表
project_id = Column('project_id', Integer, primary_key=True, autoincrement=True)

project_code = Column('project_code', String(50), unique=True, nullable=False)
project_name = Column('project_name', String(150), index=True)
etcd_conf = Column('etcd_conf', String(255), default='') ###关联ETCD配置
etcd_conf = Column('etcd_conf', String(255), default='') # 关联ETCD配置

is_archive = Column('is_archive', Boolean(), default=False, index=True) ### 归档
create_user = Column('create_user', String(100))
is_archive = Column('is_archive', Boolean(), default=False, index=True) # 归档
create_user = Column('create_user', String(150))
create_time = Column('create_time', DateTime(), default=datetime.now, onupdate=datetime.now)


class KerriganConfig(Base):
__tablename__ = 'kerrigan_config'

###
# 配置表
id = Column('id', Integer, primary_key=True, autoincrement=True)

project_code = Column('project_code', String(50), index=True)
environment = Column('environment', String(18), index=True)
environment = Column('environment', String(25), index=True)
service = Column('service', String(50))
filename = Column('filename', String(50))
content = Column('content', Text())
Expand All @@ -51,30 +51,30 @@ class KerriganConfig(Base):
class KerriganHistory(Base):
__tablename__ = 'kerrigan_history'

### 历史
# 历史版本
id = Column('id', Integer, primary_key=True, autoincrement=True)
config = Column('config', String(255), nullable=False, index=True) ### 关联配置
config = Column('config', String(500), nullable=False, index=True) ### 关联配置
content = Column('content', Text(), nullable=False)
create_user = Column('create_user', String(100))
create_user = Column('create_user', String(150))
create_time = Column('create_time', DateTime(), default=datetime.now, onupdate=datetime.now)


class KerriganPublish(Base):
__tablename__ = 'kerrigan_publish'

id = Column('id', Integer, primary_key=True, autoincrement=True)
config = Column('config', String(255), nullable=False, index=True) ### 关联配置
config = Column('config', String(500), nullable=False, index=True) # 关联配置
content = Column('content', Text(), nullable=False)
create_user = Column('create_user', String(100))
create_user = Column('create_user', String(150))
create_time = Column('create_time', DateTime(), default=datetime.now, onupdate=datetime.now)


class KerriganPermissions(Base):
__tablename__ = 'kerrigan_permissions'

# 数据权限表
id = Column('id', Integer, primary_key=True, autoincrement=True)
project_code = Column('project_code', String(50), nullable=False) ###
environment = Column('environment', String(18), nullable=False)
nickname = Column('nickname', String(120))
project_code = Column('project_code', String(50), nullable=False)
environment = Column('environment', String(25), nullable=False)
nickname = Column('nickname', String(150))
is_admin = Column('is_admin', Boolean(), default=False)
create_time = Column('create_time', DateTime(), default=datetime.now, onupdate=datetime.now)
2 changes: 1 addition & 1 deletion startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


class MyProgram(MainProgram):
def __init__(self, progress_id='config'):
def __init__(self, progress_id=''):
self.__app = None
settings = app_settings
self.__app = configApi(**settings)
Expand Down

0 comments on commit dd4b281

Please sign in to comment.