# Generated by Django 5.2.11 on 2026-02-24 16:28

import django.contrib.auth.models
import django.db.models.deletion
import django.utils.timezone
import django_base_ai.system.ext_field.core_base_auth
import django_base_ai.system.ext_field.models_safe
import django_base_ai.system.models
import django_base_ai.utils.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
        ('django_celery_beat', '0019_alter_periodictasks_options'),
    ]

    operations = [
        migrations.CreateModel(
            name='ApiWhiteList',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('url', models.CharField(db_index=True, help_text='url地址', max_length=200, verbose_name='url')),
                ('method', models.IntegerField(blank=True, default=0, help_text='接口请求方法', null=True, verbose_name='接口请求方法')),
                ('enable_datasource', models.BooleanField(blank=True, default=True, help_text='激活数据权限', verbose_name='激活数据权限')),
            ],
            options={
                'verbose_name': '接口白名单',
                'verbose_name_plural': '接口白名单',
                'db_table': 'base_api_white_list',
                'ordering': ('-create_datetime',),
            },
        ),
        migrations.CreateModel(
            name='Collaborator',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('user_info', django_base_ai.system.ext_field.core_base_auth.CoreBaseAuthField(blank=True, default=dict, help_text='协作人', null=True, verbose_name='协作人')),
            ],
            options={
                'verbose_name': '协作人',
                'verbose_name_plural': '协作人',
                'db_table': 'base_collaborator',
                'ordering': ('-create_datetime',),
            },
        ),
        migrations.CreateModel(
            name='LoginLog',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('username', models.CharField(blank=True, db_index=True, help_text='登录用户名', max_length=150, null=True, verbose_name='登录用户名')),
                ('ip', models.CharField(blank=True, db_index=True, help_text='登录ip', max_length=32, null=True, verbose_name='登录ip')),
                ('agent', models.TextField(blank=True, help_text='agent信息', null=True, verbose_name='agent信息')),
                ('browser', models.CharField(blank=True, help_text='浏览器名', max_length=200, null=True, verbose_name='浏览器名')),
                ('os', models.CharField(blank=True, help_text='操作系统', max_length=200, null=True, verbose_name='操作系统')),
                ('continent', models.CharField(blank=True, help_text='州', max_length=50, null=True, verbose_name='州')),
                ('country', models.CharField(blank=True, help_text='国家', max_length=50, null=True, verbose_name='国家')),
                ('province', models.CharField(blank=True, help_text='省份', max_length=50, null=True, verbose_name='省份')),
                ('city', models.CharField(blank=True, help_text='城市', max_length=50, null=True, verbose_name='城市')),
                ('district', models.CharField(blank=True, help_text='县区', max_length=50, null=True, verbose_name='县区')),
                ('isp', models.CharField(blank=True, help_text='运营商', max_length=50, null=True, verbose_name='运营商')),
                ('area_code', models.CharField(blank=True, help_text='区域代码', max_length=50, null=True, verbose_name='区域代码')),
                ('country_english', models.CharField(blank=True, help_text='英文全称', max_length=50, null=True, verbose_name='英文全称')),
                ('country_code', models.CharField(blank=True, help_text='简称', max_length=50, null=True, verbose_name='简称')),
                ('longitude', models.CharField(blank=True, help_text='经度', max_length=50, null=True, verbose_name='经度')),
                ('latitude', models.CharField(blank=True, help_text='纬度', max_length=50, null=True, verbose_name='纬度')),
                ('login_type', models.IntegerField(choices=[(1, '默认登录'), (2, 'SSO登录'), (3, '移动端'), (4, '授群码登录'), (900, '自定义登录')], db_index=True, default=1, help_text='登录类型', verbose_name='登录类型')),
            ],
            options={
                'verbose_name': '登录日志',
                'verbose_name_plural': '登录日志',
                'db_table': 'base_system_login_log',
                'ordering': ('-create_datetime',),
            },
        ),
        migrations.CreateModel(
            name='OperationLog',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('appid', models.CharField(blank=True, db_index=True, help_text='应用id', max_length=255, null=True, verbose_name='应用id')),
                ('request_modular', models.CharField(blank=True, db_index=True, help_text='请求模块', max_length=64, null=True, verbose_name='请求模块')),
                ('request_path', models.CharField(blank=True, help_text='请求地址', max_length=400, null=True, verbose_name='请求地址')),
                ('request_body', models.TextField(blank=True, help_text='请求参数', null=True, verbose_name='请求参数')),
                ('request_method', models.CharField(blank=True, db_index=True, help_text='请求方式', max_length=8, null=True, verbose_name='请求方式')),
                ('request_msg', models.TextField(blank=True, help_text='操作说明', null=True, verbose_name='操作说明')),
                ('request_ip', models.CharField(blank=True, db_index=True, help_text='请求ip地址', max_length=32, null=True, verbose_name='请求ip地址')),
                ('request_browser', models.CharField(blank=True, help_text='请求浏览器', max_length=64, null=True, verbose_name='请求浏览器')),
                ('response_code', models.CharField(blank=True, db_index=True, help_text='响应状态码', max_length=32, null=True, verbose_name='响应状态码')),
                ('request_os', models.CharField(blank=True, help_text='操作系统', max_length=64, null=True, verbose_name='操作系统')),
                ('json_result', models.TextField(blank=True, help_text='返回信息', null=True, verbose_name='返回信息')),
                ('status', models.BooleanField(db_index=True, default=False, help_text='响应状态', verbose_name='响应状态')),
            ],
            options={
                'verbose_name': '操作日志',
                'verbose_name_plural': '操作日志',
                'db_table': 'base_system_operation_log',
                'ordering': ('-create_datetime',),
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(db_index=True, help_text='岗位名称', max_length=64, verbose_name='岗位名称')),
                ('code', models.CharField(db_index=True, help_text='岗位编码', max_length=32, verbose_name='岗位编码')),
                ('sort', models.IntegerField(default=1, help_text='岗位顺序', verbose_name='岗位顺序')),
                ('status', models.IntegerField(choices=[(0, '离职'), (1, '在职')], db_index=True, default=1, help_text='岗位状态', verbose_name='岗位状态')),
            ],
            options={
                'verbose_name': '岗位表',
                'verbose_name_plural': '岗位表',
                'db_table': 'base_system_post',
                'ordering': ('sort',),
            },
        ),
        migrations.CreateModel(
            name='SafetyCheckRecord',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('pkg_count', models.IntegerField(blank=True, default=0, help_text='扫描包数', null=True, verbose_name='扫描包数')),
                ('vulnerabilities_count', models.IntegerField(blank=True, default=0, help_text='漏洞包数量', null=True, verbose_name='漏洞包数量')),
                ('vulnerabilities', models.JSONField(blank=True, default=dict, help_text='漏洞详情', max_length=50000, null=True, verbose_name='漏洞详情')),
            ],
            options={
                'verbose_name': '安全漏洞检查记录',
                'verbose_name_plural': '安全漏洞检查记录',
                'db_table': 'base_safety_check_record',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='Users',
            fields=[
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('username', models.CharField(db_index=True, help_text='用户账号', max_length=255, unique=True, verbose_name='用户账号')),
                ('employee_no', models.CharField(blank=True, db_index=True, help_text='工号', max_length=255, null=True, unique=True, verbose_name='工号')),
                ('position', models.CharField(blank=True, help_text='职位', max_length=255, null=True, verbose_name='职位')),
                ('email', models.EmailField(blank=True, db_index=True, help_text='邮箱', max_length=255, null=True, verbose_name='邮箱')),
                ('mobile', django_base_ai.system.ext_field.models_safe.EncrypyField(blank=True, help_text='手机', max_length=255, null=True, verbose_name='手机')),
                ('landline', models.CharField(blank=True, help_text='固定电话', max_length=255, null=True, verbose_name='座机')),
                ('avatar', models.CharField(blank=True, help_text='头像', max_length=255, null=True, verbose_name='头像')),
                ('name', models.CharField(db_index=True, default='', help_text='姓名', max_length=255, verbose_name='姓名')),
                ('alias', models.CharField(blank=True, db_index=True, help_text='成员别名', max_length=255, null=True, verbose_name='成员别名')),
                ('main_department', models.CharField(blank=True, help_text='主部门', max_length=255, null=True, verbose_name='主部门')),
                ('sort', models.IntegerField(default=1, help_text='排序', verbose_name='排序')),
                ('pwd_defaulted', models.BooleanField(default=True, help_text='密码是否为默认', verbose_name='密码是否为默认')),
                ('gender', models.IntegerField(blank=True, choices=[(0, '保密'), (1, '男'), (2, '女')], default=0, help_text='性别', null=True, verbose_name='性别')),
                ('user_type', models.IntegerField(blank=True, choices=[(0, '正式'), (1, '借调'), (2, '外包')], db_index=True, default=1, help_text='用户类型', null=True, verbose_name='用户类型')),
                ('last_token', models.CharField(blank=True, help_text='最后一次登录Token', max_length=255, null=True, verbose_name='最后一次登录Token')),
                ('skin', models.TextField(blank=True, choices=[], null=True, verbose_name='皮肤')),
                ('node_type', models.IntegerField(db_index=True, default=4, help_text='用于处理组织架构标签4表示用户', verbose_name='节点类型')),
                ('user_config', models.JSONField(blank=True, default=dict, help_text='用户配置', max_length=50000, null=True, verbose_name='用户配置')),
                ('authorization_code', django_base_ai.system.ext_field.models_safe.EncrypyField(blank=True, help_text='授权码', max_length=255, null=True, verbose_name='授权码')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
                ('parent', models.ForeignKey(blank=True, db_constraint=False, default=None, help_text='上级领导', null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='上级领导')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': '用户表',
                'verbose_name_plural': '用户表',
                'db_table': 'base_system_users',
                'ordering': ('-create_datetime',),
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='AIChatSession',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('title', models.CharField(blank=True, db_index=True, default='', help_text='会话标题，用于列表展示', max_length=255, null=True, verbose_name='会话标题')),
                ('model_name', models.CharField(blank=True, db_index=True, default='', help_text='使用的 AI 模型名', max_length=128, null=True, verbose_name='模型名称')),
                ('system_prompt', models.TextField(blank=True, default='', help_text='系统提示词', null=True, verbose_name='系统提示')),
                ('user', models.ForeignKey(blank=True, db_constraint=False, help_text='发起用户', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ai_chat_sessions', to=settings.AUTH_USER_MODEL, verbose_name='发起用户')),
            ],
            options={
                'verbose_name': 'AI 会话表',
                'verbose_name_plural': 'AI 会话表',
                'db_table': 'base_ai_chat_session',
                'ordering': ('-create_datetime',),
            },
        ),
        migrations.CreateModel(
            name='AIChatMessage',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('role', models.CharField(choices=[('system', '系统'), ('user', '用户'), ('assistant', '助手')], db_index=True, help_text='system/user/assistant', max_length=32, verbose_name='角色')),
                ('content', models.TextField(default='', help_text='消息内容', verbose_name='内容')),
                ('model_name', models.CharField(blank=True, default='', help_text='回复时使用的模型', max_length=128, null=True, verbose_name='模型名称')),
                ('usage', models.JSONField(blank=True, default=dict, help_text='prompt_tokens、completion_tokens 等', null=True, verbose_name='Token 用量')),
                ('session', models.ForeignKey(db_constraint=False, help_text='所属会话', on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='system.aichatsession', verbose_name='所属会话')),
            ],
            options={
                'verbose_name': 'AI 会话消息表',
                'verbose_name_plural': 'AI 会话消息表',
                'db_table': 'base_ai_chat_message',
                'ordering': ('id',),
            },
        ),
        migrations.CreateModel(
            name='Apps',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('agent_id', models.CharField(default=django_base_ai.system.models.create_agent_id, help_text='应用编号', max_length=255, verbose_name='应用编号')),
                ('secret', django_base_ai.system.ext_field.models_safe.EncrypyField(default=django_base_ai.system.models.create_secret, help_text='应用密钥', max_length=255, verbose_name='应用密钥')),
                ('title', models.CharField(db_index=True, default='', help_text='应用名称', max_length=255, verbose_name='应用名称')),
                ('icon', models.CharField(default='', help_text='应用图标', max_length=255, verbose_name='应用图标')),
                ('old_title', models.CharField(blank=True, default='', help_text='曾用名', max_length=255, null=True, verbose_name='曾用名')),
                ('sort', models.IntegerField(blank=True, default=1, help_text='显示排序', null=True, verbose_name='显示排序')),
                ('apps_type', models.IntegerField(blank=True, choices=[(0, '公共'), (1, '办公'), (2, '科技'), (3, 'AI'), (4, 'RPA')], default=0, help_text='应用类型', null=True, verbose_name='应用类型')),
                ('open_type', models.IntegerField(blank=True, choices=[(0, '新打开浏览器页面'), (1, '弹框显示')], default=0, help_text='应用类型', null=True, verbose_name='应用类型')),
                ('visible_range', django_base_ai.system.ext_field.core_base_auth.CoreBaseAuthField(blank=True, default=dict, help_text='可见范围', null=True, verbose_name='可见范围')),
                ('server_ip', models.TextField(blank=True, default='', help_text='服务器IP白名单', null=True, verbose_name='服务器IP白名单')),
                ('healthy', models.CharField(blank=True, default='/healthy/', help_text='健康检查', max_length=255, null=True, verbose_name='健康检查')),
                ('readiness', models.CharField(blank=True, default='/readiness/', help_text='存活中间件', max_length=255, null=True, verbose_name='存活中间件')),
                ('apps_zip', models.CharField(blank=True, default='', help_text='项目文档', max_length=255, null=True, verbose_name='项目文档')),
                ('create_or_update_callback_url', models.TextField(blank=True, default='', help_text='新增/修改/回调地址', null=True, verbose_name='新增修改')),
                ('delete_callback_url', models.TextField(blank=True, default='', help_text='删除回调地址', null=True, verbose_name='删除用户')),
                ('desc', models.TextField(blank=True, default='', help_text='描述', null=True, verbose_name='描述')),
            ],
            options={
                'verbose_name': '应用管理',
                'verbose_name_plural': '应用管理',
                'db_table': 'base_apps',
                'ordering': ('-id',),
                'unique_together': {('title',)},
            },
        ),
        migrations.CreateModel(
            name='Area',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(help_text='名称', max_length=100, verbose_name='名称')),
                ('code', models.CharField(db_index=True, help_text='地区编码', max_length=20, unique=True, verbose_name='地区编码')),
                ('level', models.BigIntegerField(help_text='地区层级(1省份 2城市 3区县 4乡级)', verbose_name='地区层级(1省份 2城市 3区县 4乡级)')),
                ('pinyin', models.CharField(help_text='拼音', max_length=255, verbose_name='拼音')),
                ('initials', models.CharField(help_text='首字母', max_length=20, verbose_name='首字母')),
                ('enable', models.BooleanField(default=True, help_text='是否启用', verbose_name='是否启用')),
                ('pcode', models.ForeignKey(blank=True, db_constraint=False, help_text='父地区编码', null=True, on_delete=django.db.models.deletion.PROTECT, to='system.area', to_field='code', verbose_name='父地区编码')),
            ],
            options={
                'verbose_name': '地区表',
                'verbose_name_plural': '地区表',
                'db_table': 'base_system_area',
                'ordering': ('code',),
            },
        ),
        migrations.CreateModel(
            name='BaseTask',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('code', models.CharField(blank=True, db_index=True, default=django_base_ai.utils.models.newuuid, help_text='任务编号', max_length=255, null=True, verbose_name='任务编号')),
                ('task_name', models.CharField(db_index=True, default='', help_text='任务名称', max_length=255, verbose_name='任务名称')),
                ('task_type', models.IntegerField(choices=[(0, '定时任务'), (1, '周期性任务')], db_index=True, default=0, help_text='任务类型', verbose_name='任务类型')),
                ('task_status', models.BooleanField(db_index=True, default=False, help_text='任务状态', verbose_name='任务状态')),
                ('request_config', models.JSONField(blank=True, default=dict, help_text='请求配置', max_length=50000, null=True, verbose_name='请求配置')),
                ('last_run_time', models.DateTimeField(blank=True, help_text='最后一次运行时间', null=True, verbose_name='最后一次运行时间')),
                ('task_desc', models.TextField(blank=True, default='', help_text='任务描述', null=True, verbose_name='任务描述')),
                ('periodic_task', models.ManyToManyField(blank=True, help_text='周期性任务', related_name='base_task_periodic_task', to='django_celery_beat.periodictask', verbose_name='周期性任务')),
            ],
            options={
                'verbose_name': '任务管理',
                'verbose_name_plural': '任务管理',
                'db_table': 'base_base_task',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='Dept',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(db_index=True, help_text='部门名称', max_length=255, verbose_name='部门名称')),
                ('short_name', models.CharField(blank=True, default='', help_text='部门简称', max_length=255, null=True, verbose_name='部门简称')),
                ('dept_full_path', models.CharField(blank=True, default='', help_text='架构全路径', max_length=255, null=True, verbose_name='架构全路径')),
                ('key', models.CharField(blank=True, default=django_base_ai.utils.models.newuuid, help_text='关联字符', max_length=255, null=True, unique=True, verbose_name='关联字符')),
                ('sort', models.IntegerField(default=1, help_text='显示排序', verbose_name='显示排序')),
                ('phone', django_base_ai.system.ext_field.models_safe.EncrypyField(blank=True, help_text='座机', max_length=255, null=True, verbose_name='座机')),
                ('email', models.EmailField(blank=True, db_index=True, help_text='邮箱', max_length=255, null=True, verbose_name='邮箱')),
                ('status', models.BooleanField(blank=True, db_index=True, default=True, help_text='部门状态', null=True, verbose_name='部门状态')),
                ('node_type', models.IntegerField(default=1, help_text='用于处理组织架构菜单1表示部门', verbose_name='节点类型')),
                ('owner_user', models.ForeignKey(blank=True, db_constraint=False, default=None, help_text='关联用户', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='owner_user', to=settings.AUTH_USER_MODEL, verbose_name='关联用户')),
                ('parent', models.ForeignKey(blank=True, db_constraint=False, default=None, help_text='上级部门', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.dept', verbose_name='上级部门')),
            ],
            options={
                'verbose_name': '部门表',
                'verbose_name_plural': '部门表',
                'db_table': 'base_system_dept',
                'ordering': ('sort',),
            },
        ),
        migrations.CreateModel(
            name='AIDeskAppManage',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('agent_id', models.CharField(default=django_base_ai.system.models.create_agent_id, help_text='应用编号', max_length=255, verbose_name='应用编号')),
                ('secret', django_base_ai.system.ext_field.models_safe.EncrypyField(default=django_base_ai.system.models.create_secret, help_text='应用密钥', max_length=255, verbose_name='应用密钥')),
                ('avatar', models.CharField(blank=True, help_text='头像', max_length=255, null=True, verbose_name='头像')),
                ('name', models.CharField(db_index=True, default='', help_text='名称', max_length=255, verbose_name='名称')),
                ('alias', models.CharField(blank=True, help_text='别名', max_length=255, null=True, verbose_name='别名')),
                ('email', models.EmailField(blank=True, db_index=True, help_text='邮箱', max_length=255, null=True, verbose_name='邮箱')),
                ('mobile', django_base_ai.system.ext_field.models_safe.EncrypyField(blank=True, help_text='手机', max_length=255, null=True, verbose_name='手机')),
                ('landline', models.CharField(blank=True, help_text='固定电话', max_length=255, null=True, verbose_name='座机')),
                ('welcome_message', models.TextField(blank=True, default='', help_text='欢迎语', null=True, verbose_name='欢迎语')),
                ('sort', models.IntegerField(blank=True, default=1, help_text='显示排序', null=True, verbose_name='显示排序')),
                ('allocation_type', models.IntegerField(blank=True, choices=[], default=0, help_text='分配方式', null=True, verbose_name='分配方式')),
                ('is_release', models.BooleanField(blank=True, db_index=True, default=False, help_text='是否发布', null=True, verbose_name='是否发布')),
                ('visibility', django_base_ai.system.ext_field.core_base_auth.CoreBaseAuthField(blank=True, default=dict, help_text='可见范围', null=True, verbose_name='可见范围')),
                ('manager', django_base_ai.system.ext_field.core_base_auth.CoreBaseAuthField(blank=True, default=dict, help_text='管理者', null=True, verbose_name='管理者')),
                ('seats', django_base_ai.system.ext_field.core_base_auth.CoreBaseAuthField(blank=True, default=dict, help_text='坐席', null=True, verbose_name='坐席')),
                ('ai_switch', models.BooleanField(blank=True, default=False, help_text='开启AI 默认False 不开启', null=True, verbose_name='开启AI')),
                ('recommended_questions', models.BooleanField(blank=True, default=False, help_text='动态推荐用户可能会问的相似问题', null=True, verbose_name='推荐问题')),
                ('dissatisfied_switch', models.BooleanField(blank=True, default=True, help_text='开启满意度调查 默认True 开启', null=True, verbose_name='询问不满意原因')),
                ('dissatisfied', models.JSONField(blank=True, default=dict, help_text='不满意Json', null=True, verbose_name='不满意Json')),
                ('ai_settings_json', models.JSONField(blank=True, default=dict, help_text='API请求Json', null=True, verbose_name='API请求Json')),
                ('human_services', models.BooleanField(blank=True, default=False, help_text='客户咨询时将先根据录入的知识库自动回复客户，无法回复时再转到人工服务', null=True, verbose_name='人工服务')),
                ('desc', models.TextField(blank=True, default='', help_text='描述', null=True, verbose_name='描述')),
                ('dept', models.ForeignKey(blank=True, db_constraint=False, help_text='所属部门', null=True, on_delete=django.db.models.deletion.PROTECT, to='system.dept', verbose_name='所属部门')),
            ],
            options={
                'verbose_name': '员工服务',
                'verbose_name_plural': '员工服务',
                'db_table': 'base_ai_desk_app_manage',
                'ordering': ('-id',),
                'unique_together': {('name',)},
            },
        ),
        migrations.AddField(
            model_name='users',
            name='dept',
            field=models.ForeignKey(blank=True, db_constraint=False, help_text='关联部门', null=True, on_delete=django.db.models.deletion.PROTECT, to='system.dept', verbose_name='所属部门'),
        ),
        migrations.CreateModel(
            name='Dictionary',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('label', models.CharField(blank=True, db_index=True, help_text='字典名称', max_length=100, null=True, verbose_name='字典名称')),
                ('value', models.CharField(blank=True, db_index=True, help_text='字典编号/实际值', max_length=200, null=True, verbose_name='字典编号')),
                ('type', models.IntegerField(choices=[(0, 'text'), (1, 'number'), (2, 'date'), (3, 'datetime'), (4, 'time'), (5, 'files'), (6, 'boolean'), (7, 'images'), (8, 'datetimerange'), (9, 'tree')], default=0, help_text='数据值类型', verbose_name='数据值类型')),
                ('color', models.CharField(blank=True, help_text='颜色', max_length=225, null=True, verbose_name='颜色')),
                ('icon', models.CharField(blank=True, help_text='图标', max_length=225, null=True, verbose_name='图标')),
                ('is_value', models.BooleanField(default=False, help_text='是否为value值,用来做具体值存放', verbose_name='是否为value值')),
                ('status', models.BooleanField(db_index=True, default=True, help_text='状态', verbose_name='状态')),
                ('sort', models.IntegerField(blank=True, default=1, help_text='显示排序', null=True, verbose_name='显示排序')),
                ('remark', models.CharField(blank=True, help_text='备注', max_length=2000, null=True, verbose_name='备注')),
                ('parent', models.ForeignKey(blank=True, db_constraint=False, help_text='父级', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='sublist', to='system.dictionary', verbose_name='父级')),
            ],
            options={
                'verbose_name': '字典表',
                'verbose_name_plural': '字典表',
                'db_table': 'base_system_dictionary',
                'ordering': ('sort',),
            },
        ),
        migrations.CreateModel(
            name='ExternalRely',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('title', models.CharField(blank=True, default='', help_text='应用名称', max_length=255, null=True, verbose_name='应用名称')),
                ('ip', models.CharField(default='', help_text='服务域名', max_length=255, verbose_name='服务域名')),
                ('port', models.IntegerField(default=80, help_text='端口', verbose_name='端口')),
                ('url', models.TextField(default='', help_text='url地址', max_length=50000, verbose_name='url地址')),
                ('apps', models.ForeignKey(blank=True, db_constraint=False, help_text='开放应用', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.apps', verbose_name='开放应用')),
            ],
            options={
                'verbose_name': '第三方服务依赖',
                'verbose_name_plural': '第三方服务依赖',
                'db_table': 'base_external_rely',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='FolderList',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(blank=True, db_index=True, help_text='文件夹名称', max_length=200, null=True, verbose_name='文件夹名称')),
                ('size', models.BigIntegerField(blank=True, default=0, help_text='文件夹大小', verbose_name='文件夹大小')),
            ],
            options={
                'verbose_name': '文件夹管理',
                'verbose_name_plural': '文件夹管理',
                'db_table': 'base_system_folder_list',
                'ordering': ('-create_datetime',),
                'unique_together': {('name',)},
            },
        ),
        migrations.CreateModel(
            name='FileList',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(blank=True, db_index=True, help_text='名称', max_length=200, null=True, verbose_name='名称')),
                ('url', models.FileField(blank=True, help_text='文件http地址', null=True, upload_to=django_base_ai.system.models.media_file_name, verbose_name='文件http地址')),
                ('file_url', models.CharField(blank=True, help_text='文件地址', max_length=255, verbose_name='文件地址')),
                ('engine', models.CharField(blank=True, default='local', help_text='引擎', max_length=100, verbose_name='引擎')),
                ('mime_type', models.CharField(blank=True, help_text='Mime类型', max_length=100, verbose_name='Mime类型')),
                ('size', models.BigIntegerField(blank=True, default=0, help_text='文件大小', verbose_name='文件大小')),
                ('md5sum', models.CharField(blank=True, db_index=True, help_text='文件md5', max_length=36, verbose_name='文件md5')),
                ('folder', models.ForeignKey(blank=True, db_constraint=False, help_text='所属文件夹', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.folderlist', verbose_name='所属文件夹')),
            ],
            options={
                'verbose_name': '文件管理',
                'verbose_name_plural': '文件管理',
                'db_table': 'base_system_file_list',
                'ordering': ('-create_datetime',),
            },
        ),
        migrations.CreateModel(
            name='FrequentlyUsedContacts',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('user', models.ForeignKey(blank=True, db_constraint=False, default=None, help_text='常用联系人', null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='常用联系人')),
            ],
            options={
                'verbose_name': '常用联系人',
                'verbose_name_plural': '常用联系人',
                'db_table': 'base_frequently_used_contacts',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='IMChatQA',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('question', models.TextField(default='', help_text='答案内容', verbose_name='答案内容')),
                ('answer', models.TextField(default='', help_text='答案内容', verbose_name='答案内容')),
                ('q_type', models.IntegerField(blank=True, choices=[(0, '热门问题'), (1, 'AI'), (2, '未知')], db_index=True, default=0, help_text='类型', null=True, verbose_name='类型')),
                ('is_it_solved', models.IntegerField(blank=True, choices=[(0, '解决'), (1, '未解决'), (2, '未选择')], db_index=True, default=2, help_text='是否解决', null=True, verbose_name='是否解决')),
                ('ai_desk_app_manage', models.ForeignKey(db_constraint=False, help_text='员工服务', on_delete=django.db.models.deletion.CASCADE, to='system.aideskappmanage', verbose_name='员工服务')),
            ],
            options={
                'verbose_name': 'QA问答记录',
                'verbose_name_plural': 'QA问答记录',
                'db_table': 'base_im_chat_qa',
            },
        ),
        migrations.CreateModel(
            name='IMChatQuestionGroup',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('title', models.CharField(db_index=True, default='', help_text='分组名称', max_length=255, verbose_name='分组名称')),
                ('sort', models.IntegerField(default=1, help_text='排序', verbose_name='排序')),
                ('ai_desk_app_manage', models.ForeignKey(db_constraint=False, help_text='员工服务', on_delete=django.db.models.deletion.CASCADE, to='system.aideskappmanage', verbose_name='员工服务')),
                ('parent', models.ForeignKey(blank=True, db_constraint=False, help_text='上级', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.imchatquestiongroup', verbose_name='上级')),
            ],
            options={
                'verbose_name': '员工服务热门问题分组',
                'verbose_name_plural': '员工服务热门问题分组',
                'db_table': 'base_im_chat_question_group',
            },
        ),
        migrations.CreateModel(
            name='IMChatQuestion',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('title', models.CharField(db_index=True, default='', help_text='问题标题', max_length=255, verbose_name='问题标题')),
                ('content', models.TextField(default='', help_text='答案内容', verbose_name='答案内容')),
                ('is_enable', models.BooleanField(blank=True, db_index=True, default=True, help_text='是否启用', null=True, verbose_name='是否启用')),
                ('hit', models.IntegerField(blank=True, default=0, help_text='点击量', null=True, verbose_name='点击量')),
                ('parent', models.ForeignKey(blank=True, db_constraint=False, help_text='上级', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.imchatquestion', verbose_name='上级')),
                ('im_chat_question_group', models.ForeignKey(db_constraint=False, help_text='热门问题分组', on_delete=django.db.models.deletion.CASCADE, to='system.imchatquestiongroup', verbose_name='热门问题分组')),
            ],
            options={
                'verbose_name': '员工服务热门问题',
                'verbose_name_plural': '员工服务热门问题',
                'db_table': 'base_im_chat_question',
                'ordering': ('-hit', 'id'),
            },
        ),
        migrations.CreateModel(
            name='IMChatToGroup',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(blank=True, db_index=True, help_text='群聊名称', max_length=255, null=True, verbose_name='群聊名称')),
                ('group_chat_avatar', models.CharField(blank=True, default='', help_text='群聊头像', max_length=255, null=True, verbose_name='群聊头像')),
                ('group_ext_info', models.JSONField(blank=True, default=dict, help_text='扩展字段', null=True, verbose_name='扩展字段')),
                ('from_many_to_user', models.ManyToManyField(db_constraint=False, help_text='接收用户', related_name='ManyGroupMembers', to=settings.AUTH_USER_MODEL, verbose_name='接收用户')),
                ('group_admins', models.ManyToManyField(db_constraint=False, help_text='群管理员', related_name='ImGroupAdmins', to=settings.AUTH_USER_MODEL, verbose_name='群管理员')),
            ],
            options={
                'verbose_name': '群聊天',
                'verbose_name_plural': '群聊天',
                'db_table': 'base_im_chat_to_group',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='IMChatToGroupMessage',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('content', models.JSONField(blank=True, default=dict, help_text='内容', null=True, verbose_name='内容')),
                ('msg_stype', models.IntegerField(blank=True, choices=[(0, '聊天'), (1, 'AI'), (4, '系统')], db_index=True, default=0, help_text='消息类型', null=True, verbose_name='消息类型')),
                ('is_read', models.BooleanField(blank=True, db_index=True, default=True, help_text='是否已读', null=True, verbose_name='是否已读')),
                ('from_to_user', models.ForeignKey(db_constraint=False, help_text='接收用户', on_delete=django.db.models.deletion.PROTECT, related_name='GroupFromToUser', to=settings.AUTH_USER_MODEL, verbose_name='接收用户')),
                ('from_user', models.ForeignKey(db_constraint=False, help_text='发送用户', on_delete=django.db.models.deletion.CASCADE, related_name='GroupFromUser', to=settings.AUTH_USER_MODEL, verbose_name='发送用户')),
                ('im_chat_to_group', models.ForeignKey(db_constraint=False, help_text='群聊天', on_delete=django.db.models.deletion.CASCADE, to='system.imchattogroup', verbose_name='群聊天')),
            ],
            options={
                'verbose_name': '群聊天内容',
                'verbose_name_plural': '群聊天内容',
                'db_table': 'base_im_chat_to_group_message',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='IMSession',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('session_id', models.CharField(blank=True, default=django_base_ai.utils.models.newuuid, help_text='会话id', max_length=255, null=True, unique=True, verbose_name='会话id')),
                ('session_type', models.BooleanField(db_index=True, default=False, help_text='会话类型，0 点对点 1群聊', verbose_name='会话类型')),
                ('is_it_pinned', models.BooleanField(db_index=True, default=False, help_text='是否置顶，True置顶 False不置顶', verbose_name='是否置顶')),
                ('is_claim', models.IntegerField(blank=True, choices=[(0, '未认领'), (1, '已认领'), (2, '消息免打扰')], db_index=True, default=0, help_text='是否认领', null=True, verbose_name='是否认领')),
                ('is_colse', models.BooleanField(blank=True, db_index=True, default=False, help_text='是否关闭', null=True, verbose_name='是否关闭')),
                ('ai_desk_app_manage', models.ForeignKey(db_constraint=False, help_text='员工服务', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.aideskappmanage', verbose_name='员工服务')),
                ('from_user', models.ForeignKey(db_constraint=False, help_text='会话用户', null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='会话用户')),
                ('parent', models.ForeignKey(blank=True, db_constraint=False, default=None, help_text='父级会话ID', null=True, on_delete=django.db.models.deletion.SET_NULL, to='system.imsession', verbose_name='父级会话ID')),
            ],
            options={
                'verbose_name': '会话表',
                'verbose_name_plural': '会话表',
                'db_table': 'base_im_session',
                'ordering': ('-id', '-is_it_pinned'),
            },
        ),
        migrations.CreateModel(
            name='IMChatToUser',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('msg_stype', models.IntegerField(blank=True, choices=[(0, '聊天'), (1, 'AI'), (4, '系统')], db_index=True, default=0, help_text='消息类型', null=True, verbose_name='消息类型')),
                ('content', models.JSONField(blank=True, default=dict, help_text='内容', null=True, verbose_name='内容')),
                ('from_to_user', models.ForeignKey(db_constraint=False, help_text='接收用户', on_delete=django.db.models.deletion.PROTECT, related_name='FromToUser', to=settings.AUTH_USER_MODEL, verbose_name='接收用户')),
                ('from_user', models.ForeignKey(db_constraint=False, help_text='发送用户', on_delete=django.db.models.deletion.CASCADE, related_name='FromUser', to=settings.AUTH_USER_MODEL, verbose_name='发送用户')),
                ('im_session', models.ForeignKey(db_constraint=False, help_text='会话', on_delete=django.db.models.deletion.CASCADE, related_name='SessionFromUser', to='system.imsession', verbose_name='会话')),
            ],
            options={
                'verbose_name': '点对点聊天',
                'verbose_name_plural': '点对点聊天',
                'db_table': 'base_im_chat_to_user',
                'ordering': ('id',),
            },
        ),
        migrations.AddField(
            model_name='imchattogroup',
            name='im_session',
            field=models.ForeignKey(db_constraint=False, help_text='会话', on_delete=django.db.models.deletion.CASCADE, to='system.imsession', verbose_name='会话'),
        ),
        migrations.CreateModel(
            name='IMChatRecordForm',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('first_reply_time', models.DateTimeField(blank=True, help_text='首次回复时间', null=True, verbose_name='首次回复时间')),
                ('reply_interval', models.IntegerField(blank=True, default=0, help_text='回复间隔', null=True, verbose_name='回复间隔')),
                ('satisfaction_type', models.IntegerField(blank=True, choices=[(1, '满意'), (2, '一般'), (3, '不满意')], default=5, help_text='满意度', null=True, verbose_name='满意度')),
                ('satisfaction_info', models.TextField(default='', help_text='反馈内容', verbose_name='反馈内容')),
                ('im_session', models.OneToOneField(db_constraint=False, help_text='会话', on_delete=django.db.models.deletion.CASCADE, to='system.imsession', verbose_name='会话')),
            ],
            options={
                'verbose_name': '满意度',
                'verbose_name_plural': '满意度',
                'db_table': 'base_im_chat_record_form',
                'ordering': ('id',),
            },
        ),
        migrations.CreateModel(
            name='Menu',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(db_index=True, help_text='菜单名称', max_length=64, verbose_name='菜单名称')),
                ('path', models.CharField(blank=True, db_index=True, help_text='路由地址', max_length=128, null=True, verbose_name='路由地址')),
                ('component', models.CharField(blank=True, help_text='组件地址', max_length=128, null=True, verbose_name='组件地址')),
                ('component_name', models.CharField(blank=True, help_text='组件名称', max_length=50, null=True, verbose_name='组件名称')),
                ('redirect', models.CharField(blank=True, help_text='重定向到子路由', max_length=128, null=True, verbose_name='重定向到子路由')),
                ('sort', models.IntegerField(blank=True, default=1, help_text='显示排序', null=True, verbose_name='显示排序')),
                ('status', models.BooleanField(blank=True, db_index=True, default=True, help_text='菜单状态', verbose_name='菜单状态')),
                ('meta', models.JSONField(blank=True, help_text='meta', max_length=5000, null=True, verbose_name='meta')),
                ('parent', models.ForeignKey(blank=True, db_constraint=False, help_text='上级菜单', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.menu', verbose_name='上级菜单')),
            ],
            options={
                'verbose_name': '菜单表',
                'verbose_name_plural': '菜单表',
                'db_table': 'base_system_menu',
                'ordering': ('sort',),
            },
        ),
        migrations.CreateModel(
            name='MenuButton',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(help_text='名称', max_length=64, verbose_name='名称')),
                ('value', models.CharField(db_index=True, help_text='权限值', max_length=64, verbose_name='权限值')),
                ('api', models.CharField(db_index=True, help_text='接口地址', max_length=200, verbose_name='接口地址')),
                ('method', models.IntegerField(blank=True, default=0, help_text='接口请求方法', null=True, verbose_name='接口请求方法')),
                ('menu', models.ForeignKey(db_constraint=False, help_text='关联菜单', on_delete=django.db.models.deletion.PROTECT, related_name='menuPermission', to='system.menu', verbose_name='关联菜单')),
            ],
            options={
                'verbose_name': '菜单权限表',
                'verbose_name_plural': '菜单权限表',
                'db_table': 'base_system_menu_button',
                'ordering': ('-name',),
            },
        ),
        migrations.CreateModel(
            name='MessageCenter',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('title', models.CharField(help_text='标题', max_length=100, verbose_name='标题')),
                ('short_content', models.TextField(default='', help_text='简要描述', verbose_name='简要描述')),
                ('thumbnail', models.TextField(blank=True, default='', help_text='缩略图', null=True, verbose_name='缩略图')),
                ('message_type', models.IntegerField(choices=[(0, '系统通知'), (1, '第三方通知'), (2, '待办通知')], db_index=True, default=0)),
                ('file_list', models.JSONField(blank=True, default=dict, help_text='邮件附件', null=True, verbose_name='邮件附件')),
                ('content', models.TextField(blank=True, default='', help_text='内容', null=True, verbose_name='内容')),
                ('url', models.TextField(blank=True, default='', help_text='跳转地址', null=True, verbose_name='跳转地址')),
                ('target_type', models.IntegerField(choices=[(0, '用户'), (1, '部门'), (2, '角色'), (3, '标签')], db_index=True, default=0, help_text='目标类型', verbose_name='目标类型')),
                ('is_withdraw', models.BooleanField(blank=True, db_index=True, default=False, help_text='是否撤回', null=True, verbose_name='是否撤回')),
                ('task_id', models.CharField(blank=True, default='', help_text='任务id', max_length=255, null=True, verbose_name='任务id')),
                ('send_user_info', django_base_ai.system.ext_field.core_base_auth.CoreBaseAuthField(blank=True, default=dict, help_text='发送范围', null=True, verbose_name='发送范围')),
                ('expires', models.DateTimeField(blank=True, help_text='过期时间', null=True, verbose_name='过期时间')),
                ('ext_kwargs', models.JSONField(default=dict, help_text='发送消息扩展参数', verbose_name='发送消息扩展参数')),
                ('periodic_task', models.ManyToManyField(blank=True, db_constraint=False, help_text='定时发送', related_name='many_periodic_send_task', to='django_celery_beat.periodictask', verbose_name='定时发送')),
            ],
            options={
                'verbose_name': '消息中心',
                'verbose_name_plural': '消息中心',
                'db_table': 'base_message_center',
                'ordering': ('-create_datetime',),
            },
        ),
        migrations.CreateModel(
            name='MessageCenterTargetUser',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('is_send', models.BooleanField(blank=True, db_index=True, default=False, help_text='是否推送', null=True, verbose_name='是否推送')),
                ('is_read', models.BooleanField(blank=True, db_index=True, default=False, help_text='是否已读', null=True, verbose_name='是否已读')),
                ('send_mails_result', models.CharField(blank=True, default='', help_text='发送结果仅用于异步通知', max_length=255, null=True, verbose_name='发送结果')),
                ('messagecenter', models.ForeignKey(db_constraint=False, help_text='关联消息中心表', on_delete=django.db.models.deletion.CASCADE, to='system.messagecenter', verbose_name='关联消息中心表')),
                ('users', models.ForeignKey(db_constraint=False, help_text='关联用户表', on_delete=django.db.models.deletion.CASCADE, related_name='target_user', to=settings.AUTH_USER_MODEL, verbose_name='关联用户表')),
            ],
            options={
                'verbose_name': '消息中心目标用户表',
                'verbose_name_plural': '消息中心目标用户表',
                'db_table': 'base_message_center_target_user',
            },
        ),
        migrations.CreateModel(
            name='MySuperiors',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('user_info', models.ForeignKey(db_constraint=False, help_text='协作人', on_delete=django.db.models.deletion.PROTECT, related_name='userSuperiors', to=settings.AUTH_USER_MODEL, verbose_name='协作人')),
            ],
            options={
                'verbose_name': '协作人',
                'verbose_name_plural': '协作人',
                'db_table': 'base_my_superiors',
                'ordering': ('-create_datetime',),
            },
        ),
        migrations.AddField(
            model_name='users',
            name='post',
            field=models.ManyToManyField(blank=True, db_constraint=False, help_text='关联岗位', to='system.post', verbose_name='关联岗位'),
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(db_index=True, help_text='角色名称', max_length=64, verbose_name='角色名称')),
                ('key', models.CharField(help_text='权限字符', max_length=64, unique=True, verbose_name='权限字符')),
                ('sort', models.IntegerField(default=1, help_text='角色顺序', verbose_name='角色顺序')),
                ('status', models.BooleanField(db_index=True, default=True, help_text='角色状态', verbose_name='角色状态')),
                ('admin', models.BooleanField(db_index=True, default=False, help_text='是否为admin', verbose_name='是否为admin')),
                ('data_range', models.IntegerField(choices=[(0, '仅本人数据权限'), (1, '本部门及以下数据权限'), (2, '本部门数据权限'), (3, '全部数据权限'), (4, '自定数据权限')], default=0, help_text='数据权限范围', verbose_name='数据权限范围')),
                ('node_type', models.IntegerField(default=2, help_text='用于处理组织架构菜单2表示角色', verbose_name='节点类型')),
                ('remark', models.TextField(blank=True, help_text='备注', null=True, verbose_name='备注')),
                ('dept', models.ManyToManyField(db_constraint=False, help_text='数据权限-关联部门', to='system.dept', verbose_name='数据权限-关联部门')),
                ('menu', models.ManyToManyField(db_constraint=False, help_text='关联菜单', to='system.menu', verbose_name='关联菜单')),
                ('permission', models.ManyToManyField(db_constraint=False, help_text='关联菜单的接口按钮', to='system.menubutton', verbose_name='关联菜单的接口按钮')),
            ],
            options={
                'verbose_name': '角色表',
                'verbose_name_plural': '角色表',
                'db_table': 'base_system_role',
                'ordering': ('sort',),
            },
        ),
        migrations.AddField(
            model_name='users',
            name='role',
            field=models.ManyToManyField(blank=True, db_constraint=False, help_text='关联角色', to='system.role', verbose_name='关联角色'),
        ),
        migrations.CreateModel(
            name='SendMessageTask',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('send_type', models.IntegerField(blank=True, choices=[(0, '邮件'), (1, '客户端通知')], default=0, help_text='发送类型', null=True, verbose_name='发送类型')),
                ('task_name', models.CharField(blank=True, default='', help_text='任务名称', max_length=255, null=True, verbose_name='任务名称')),
                ('task_id', models.CharField(blank=True, default='', help_text='任务id', max_length=255, null=True, verbose_name='任务id')),
                ('apps', models.ForeignKey(blank=True, help_text='开放应用', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.apps', verbose_name='开放应用')),
            ],
            options={
                'verbose_name': '发送任务',
                'verbose_name_plural': '发送任务',
                'db_table': 'base_send_message_task',
                'ordering': ('-id',),
            },
        ),
        migrations.AddField(
            model_name='messagecenter',
            name='send_message_task',
            field=models.ForeignKey(blank=True, help_text='开放应用', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.sendmessagetask', verbose_name='开放应用'),
        ),
        migrations.CreateModel(
            name='SystemUsage',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('use_count', models.IntegerField(default=0, help_text='使用总数', verbose_name='使用总数')),
                ('usage_type', models.IntegerField(db_index=True, default=0, help_text='类型', verbose_name='类型')),
                ('title', models.TextField(default='', help_text='模块名称', verbose_name='模块名称')),
                ('path', models.TextField(default='', help_text='路径', verbose_name='路径')),
                ('apps', models.ForeignKey(blank=True, db_constraint=False, help_text='开放应用', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.apps', verbose_name='开放应用')),
            ],
            options={
                'verbose_name': '统计量',
                'verbose_name_plural': '统计量',
                'db_table': 'base_system_usage',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='Tags',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('name', models.CharField(db_index=True, help_text='标签名称', max_length=255, verbose_name='标签名称')),
                ('sort', models.IntegerField(default=1, help_text='标签顺序', verbose_name='标签顺序')),
                ('status', models.BooleanField(db_index=True, default=True, help_text='标签状态', verbose_name='标签状态')),
                ('node_type', models.IntegerField(default=3, help_text='用于处理组织架构标签3表示标签', verbose_name='节点类型')),
                ('remark', models.TextField(blank=True, help_text='备注', null=True, verbose_name='备注')),
                ('dept', models.ManyToManyField(blank=True, db_constraint=False, help_text='关联部门', to='system.dept', verbose_name='关联部门')),
                ('edit_user_info', models.ManyToManyField(blank=True, db_constraint=False, help_text='读写', related_name='tags_edit_user_info', to=settings.AUTH_USER_MODEL, verbose_name='读写')),
                ('read_user_info', models.ManyToManyField(blank=True, db_constraint=False, help_text='仅使用', related_name='tags_read_user_info', to=settings.AUTH_USER_MODEL, verbose_name='仅使用')),
                ('user_info', models.ManyToManyField(blank=True, db_constraint=False, help_text='关联用户', related_name='tags_user_info', to=settings.AUTH_USER_MODEL, verbose_name='关联用户')),
            ],
            options={
                'verbose_name': '自定义标签',
                'verbose_name_plural': '自定义标签',
                'db_table': 'base_tags',
                'ordering': ('-create_datetime',),
            },
        ),
        migrations.CreateModel(
            name='CoreBaseAuth',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('target_data', models.JSONField(blank=True, default=dict, help_text='上送json', max_length=50000, null=True, verbose_name='上送json')),
                ('target_users', models.ManyToManyField(blank=True, db_constraint=False, help_text='用户', related_name='target_users', to=settings.AUTH_USER_MODEL, verbose_name='用户')),
                ('target_dept', models.ManyToManyField(blank=True, db_constraint=False, help_text='部门', related_name='target_dept', to='system.dept', verbose_name='部门')),
                ('target_role', models.ManyToManyField(blank=True, db_constraint=False, help_text='角色', related_name='target_role', to='system.role', verbose_name='角色')),
                ('target_tags', models.ManyToManyField(blank=True, db_constraint=False, help_text='标签', related_name='target_tags', to='system.tags', verbose_name='标签')),
            ],
            options={
                'verbose_name': '基础授权表',
                'verbose_name_plural': '基础授权表',
                'db_table': 'base_auth',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='TaskRunHistory',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('url_name', models.CharField(default='', help_text='url命名', max_length=255, verbose_name='url命名')),
                ('start_time', models.DateTimeField(blank=True, db_index=True, help_text='请求开始时间', null=True, verbose_name='任务请求开始时间')),
                ('end_time', models.DateTimeField(blank=True, help_text='请求结束时间', null=True, verbose_name='任务请求结束时间')),
                ('status_code', models.IntegerField(db_index=True, default=0, help_text='请求状态响应码', verbose_name='请求状态响应码')),
                ('request_config', models.JSONField(blank=True, default=dict, help_text='请求配置', max_length=50000, null=True, verbose_name='请求配置')),
                ('run_result', models.TextField(blank=True, default=dict, help_text='运行返回结果', null=True, verbose_name='运行返回结果')),
                ('base_task', models.ForeignKey(blank=True, db_constraint=False, help_text='触发任务', null=True, on_delete=django.db.models.deletion.CASCADE, to='system.basetask', verbose_name='触发任务')),
                ('periodic_task', models.ForeignKey(blank=True, db_constraint=False, help_text='执行任务定时器', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='periodic', to='django_celery_beat.periodictask', verbose_name='执行任务定时器')),
            ],
            options={
                'verbose_name': '任务运行历史',
                'verbose_name_plural': '任务运行历史',
                'db_table': 'base_task_run_history',
                'ordering': ('-id',),
            },
        ),
        migrations.CreateModel(
            name='SystemConfig',
            fields=[
                ('id', models.BigAutoField(help_text='主键', primary_key=True, serialize=False, verbose_name='Id')),
                ('creator', models.CharField(blank=True, db_index=True, help_text='创建人', max_length=255, null=True, verbose_name='创建人')),
                ('modifier', models.CharField(blank=True, db_index=True, help_text='修改人', max_length=255, null=True, verbose_name='修改人')),
                ('dept_belong_id', models.CharField(blank=True, db_index=True, help_text='数据归属部门', max_length=255, null=True, verbose_name='数据归属部门')),
                ('update_datetime', models.DateTimeField(auto_now=True, db_index=True, help_text='修改时间', null=True, verbose_name='修改时间')),
                ('create_datetime', models.DateTimeField(auto_now_add=True, db_index=True, help_text='创建时间', null=True, verbose_name='创建时间')),
                ('description', models.TextField(blank=True, help_text='描述', null=True, verbose_name='描述')),
                ('title', models.CharField(db_index=True, help_text='标题', max_length=50, verbose_name='标题')),
                ('key', models.CharField(db_index=True, help_text='键', max_length=200, verbose_name='键')),
                ('value', models.JSONField(blank=True, help_text='值', max_length=500, null=True, verbose_name='值')),
                ('sort', models.IntegerField(blank=True, default=0, help_text='排序', verbose_name='排序')),
                ('status', models.BooleanField(db_index=True, default=True, help_text='启用状态', verbose_name='启用状态')),
                ('data_options', models.JSONField(blank=True, help_text='数据options', null=True, verbose_name='数据options')),
                ('form_item_type', models.IntegerField(blank=True, choices=[(0, 'text'), (1, 'datetime'), (2, 'date'), (3, 'textarea'), (4, 'select'), (5, 'checkbox'), (6, 'radio'), (7, 'img'), (8, 'file'), (9, 'switch'), (10, 'number'), (11, 'array'), (12, 'imgs'), (13, 'foreignkey'), (14, 'manytomany'), (15, 'time'), (16, 'code'), (17, 'role'), (18, 'request'), (19, 'response')], default=0, help_text='字段类型', verbose_name='字段类型')),
                ('rule', models.JSONField(blank=True, help_text='校验规则', null=True, verbose_name='校验规则')),
                ('placeholder', models.CharField(blank=True, help_text='提示信息', max_length=100, null=True, verbose_name='提示信息')),
                ('setting', models.JSONField(blank=True, help_text='配置', null=True, verbose_name='配置')),
                ('parent', models.ForeignKey(blank=True, db_constraint=False, help_text='父级', null=True, on_delete=django.db.models.deletion.PROTECT, to='system.systemconfig', verbose_name='父级')),
            ],
            options={
                'verbose_name': '系统配置表',
                'verbose_name_plural': '系统配置表',
                'db_table': 'base_system_config',
                'ordering': ('sort',),
                'unique_together': {('key', 'parent_id')},
            },
        ),
    ]
