@ -1,8 +0,0 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="django" name="Django">
|
||||
<configuration>
|
||||
<option name="rootFolder" value="$MODULE_DIR$" />
|
||||
<option name="settingsModule" value="DjangoProject/settings.py" />
|
||||
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
|
||||
<option name="environment" value="<map/>" />
|
||||
<option name="doNotUseTestRunner" value="false" />
|
||||
<option name="trackFilePattern" value="migrations" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.13 (DjangoProject) (2)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TemplatesService">
|
||||
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
||||
<option name="TEMPLATE_FOLDERS">
|
||||
<list>
|
||||
<option value="$MODULE_DIR$/../DjangoProject\templates" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</module>
|
||||
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="sw.sqlite" uuid="166e5de7-2427-48a7-b532-3707147a661a">
|
||||
<driver-ref>sqlite.xerial</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
|
||||
<jdbc-url>jdbc:sqlite:identifier.sqlite</jdbc-url>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
<data-source source="LOCAL" name="identifier" uuid="9e468e66-19e3-4806-802d-3f430c902f99">
|
||||
<driver-ref>sqlite.xerial</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
|
||||
<jdbc-url>jdbc:sqlite:E:\Python_study\DjangoProject\identifier.sqlite3</jdbc-url>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
<libraries>
|
||||
<library>
|
||||
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.45.1/org/xerial/sqlite-jdbc/3.45.1.0/sqlite-jdbc-3.45.1.0.jar</url>
|
||||
</library>
|
||||
<library>
|
||||
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.45.1/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar</url>
|
||||
</library>
|
||||
</libraries>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,16 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoredPackages">
|
||||
<value>
|
||||
<list size="3">
|
||||
<item index="0" class="java.lang.String" itemvalue="django" />
|
||||
<item index="1" class="java.lang.String" itemvalue="djangorestframework" />
|
||||
<item index="2" class="java.lang.String" itemvalue="django-cors-headers" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
@ -1,6 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.13 (DjangoProject) (2)" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/DjangoProject.iml" filepath="$PROJECT_DIR$/.idea/DjangoProject.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../../" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
projectKey=Notes-master2
|
||||
serverUrl=http://localhost:9000
|
||||
serverVersion=25.3.0.104237
|
||||
dashboardUrl=http://localhost:9000/dashboard?id=Notes-master2
|
||||
ceTaskId=a33d0039-99a1-489c-8e22-20146e609d81
|
||||
ceTaskUrl=http://localhost:9000/api/ce/task?id=a33d0039-99a1-489c-8e22-20146e609d81
|
||||
|
Before Width: | Height: | Size: 94 KiB |
@ -1,16 +0,0 @@
|
||||
"""
|
||||
ASGI config for DjangoProject project.
|
||||
|
||||
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DjangoProject.settings')
|
||||
|
||||
application = get_asgi_application()
|
||||
@ -1,95 +0,0 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
SECRET_KEY = 'django-insecure-your-secret-key-here'
|
||||
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
# 在INSTALLED_APPS中添加corsheaders
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'corsheaders', # 新增这一行
|
||||
'project',
|
||||
'django_crontab', # 定时任务应用
|
||||
]
|
||||
|
||||
# 在MIDDLEWARE最前面添加CorsMiddleware
|
||||
MIDDLEWARE = [
|
||||
'corsheaders.middleware.CorsMiddleware', # 新增,必须放在最前面
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'DjangoProject.urls'
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
'django.template.context_processors.debug',
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = 'DjangoProject.wsgi.application'
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'identifier.sqlite3',
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_CODE = 'zh-hans'
|
||||
TIME_ZONE = 'Asia/Shanghai'
|
||||
USE_I18N = True
|
||||
USE_TZ = True
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
# AI服务配置
|
||||
AI_API_KEY = "4agUQAXAv79GrBnxQy5Wh1sn"
|
||||
AI_SECRET_KEY = "OZ9hyVAQdKbmG08oq5iMFH5zx8AoNAdv"
|
||||
|
||||
# 静态文件配置
|
||||
STATIC_URL = '/static/'
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, 'static'),
|
||||
]
|
||||
|
||||
# 媒体文件配置
|
||||
MEDIA_URL = '/media/'
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||
|
||||
# ========== 新增CORS配置 ==========
|
||||
CORS_ALLOW_ALL_ORIGINS = True # 允许所有域名跨域
|
||||
CORS_ALLOW_CREDENTIALS = True # 允许携带cookie
|
||||
|
||||
|
||||
# 定时匹配功能
|
||||
CRONJOBS = [
|
||||
('0 6,12,18,0 * * *', 'project.management.commands.scheduled_match.Command'),
|
||||
]
|
||||
@ -1,14 +0,0 @@
|
||||
# DjangoProject/urls.py - 添加媒体文件服务
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('api/', include('project.urls')),
|
||||
]
|
||||
|
||||
# 开发环境下提供媒体文件服务
|
||||
if settings.DEBUG:
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
@ -1,16 +0,0 @@
|
||||
"""
|
||||
WSGI config for DjangoProject project.
|
||||
|
||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DjangoProject.settings')
|
||||
|
||||
application = get_wsgi_application()
|
||||
|
Before Width: | Height: | Size: 122 KiB |
@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
"""Django's command-line utility for administrative tasks."""
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
"""Run administrative tasks."""
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DjangoProject.settings')
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError as exc:
|
||||
raise ImportError(
|
||||
"Couldn't import Django. Are you sure it's installed and "
|
||||
"available on your PYTHONPATH environment variable? Did you "
|
||||
"forget to activate a virtual environment?"
|
||||
) from exc
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Before Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 173 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 173 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 173 KiB |
|
Before Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 94 KiB |
@ -1,26 +0,0 @@
|
||||
from django.contrib import admin
|
||||
from .models import T_User, T_Object_Info, T_Description
|
||||
|
||||
|
||||
# 注册 T_User 模型到管理员界面
|
||||
@admin.register(T_User)
|
||||
class T_UserAdmin(admin.ModelAdmin):
|
||||
list_display = ['user_id', 'wechat_id', 'nickname'] # 列表中显示的字段
|
||||
list_display_links = ['user_id', 'nickname'] # 可点击进入编辑页的字段
|
||||
search_fields = ['nickname', 'wechat_id'] # 可搜索的字段
|
||||
list_per_page = 20 # 每页显示的数量
|
||||
|
||||
# 或者使用简单注册方式:
|
||||
# admin.site.register(T_User)
|
||||
|
||||
@admin.register(T_Object_Info)
|
||||
class T_Object_InfoAdmin(admin.ModelAdmin):
|
||||
list_display = ['object', 'color', 'brand', 'feature','create_time', 'state', 'claim_phone'] # 添加状态和认领手机号
|
||||
search_fields = ['object', 'color', 'brand','feature']
|
||||
list_filter = ['state'] # 添加状态过滤器
|
||||
|
||||
@admin.register(T_Description)
|
||||
class T_DescriptionAdmin(admin.ModelAdmin):
|
||||
list_display = ['desc_id', 'wechat', 'description']
|
||||
search_fields = ['wechat__wechat_id', 'wechat__nickname', 'description']
|
||||
list_select_related = ['wechat']
|
||||
@ -1,5 +0,0 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
class ProjectConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'project'
|
||||
@ -1,56 +0,0 @@
|
||||
# project/crontab.py
|
||||
from django.utils import timezone
|
||||
from .models import T_Description, T_Object_Info
|
||||
from .utils import SearchService
|
||||
|
||||
|
||||
def auto_match_descriptions():
|
||||
"""
|
||||
自动匹配描述任务 - 改进版本
|
||||
"""
|
||||
print(f"开始执行自动匹配任务... {timezone.now()}")
|
||||
|
||||
# 获取所有需要匹配的描述
|
||||
descriptions = T_Description.objects.all()
|
||||
all_items = T_Object_Info.objects.all()
|
||||
|
||||
match_count = 0
|
||||
match_results = []
|
||||
|
||||
for desc in descriptions:
|
||||
# 使用搜索服务进行匹配
|
||||
search_service = SearchService()
|
||||
result = search_service.search_objects_by_description(desc.description, threshold=0.3)
|
||||
|
||||
if result['success']:
|
||||
for match in result['results']:
|
||||
item = match['object_info']
|
||||
match_count += 1
|
||||
match_result = {
|
||||
'desc_id': desc.desc_id,
|
||||
'wechat_id': desc.wechat.wechat_id,
|
||||
'nickname': desc.wechat.nickname,
|
||||
'user_description': desc.description,
|
||||
'object_id': item.object_id,
|
||||
'item_name': item.name,
|
||||
'item_color': item.color,
|
||||
'item_location': item.location,
|
||||
'contact_number': item.contact_number,
|
||||
'similarity': round(match['similarity'] * 100, 2), # 转换为百分比
|
||||
'match_time': timezone.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
}
|
||||
match_results.append(match_result)
|
||||
|
||||
print(f"匹配成功: {desc.wechat.nickname}的描述 '{desc.description}'")
|
||||
print(f" 与物品 '{item.name}({item.color})' 相似度 {match['similarity']:.2%}")
|
||||
|
||||
print(f"自动匹配完成,找到 {match_count} 个匹配结果")
|
||||
|
||||
# 保存匹配结果到数据库或发送通知
|
||||
if match_results:
|
||||
print("匹配结果汇总:")
|
||||
for result in match_results:
|
||||
print(
|
||||
f"- {result['nickname']}: {result['user_description']} -> {result['item_name']}({result['item_color']}) 相似度{result['similarity']}%")
|
||||
|
||||
return match_results
|
||||
@ -1,31 +0,0 @@
|
||||
# project/management/commands/scheduled_match.py
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils import timezone
|
||||
from project.utils import SearchService
|
||||
from project.models import T_Description
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = '定时匹配任务 - 每天6点、12点、18点、24点执行'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
current_hour = timezone.now().hour
|
||||
self.stdout.write(f'开始定时匹配任务,当前时间: {current_hour}点')
|
||||
|
||||
search_service = SearchService()
|
||||
# 获取所有描述
|
||||
descriptions = T_Description.objects.all().select_related('wechat')
|
||||
|
||||
match_count = 0
|
||||
for desc in descriptions:
|
||||
result = search_service.search_objects_by_description(desc.description)
|
||||
if result['success'] and result['count'] > 0:
|
||||
match_count += 1
|
||||
self.stdout.write(
|
||||
f"用户 {desc.wechat.nickname}({desc.wechat.wechat_id}) 匹配到 {result['count']} 个物品"
|
||||
)
|
||||
# 这里可以添加发送微信通知的逻辑
|
||||
|
||||
self.stdout.write(
|
||||
self.style.SUCCESS(f'定时匹配任务完成,共处理 {descriptions.count()} 个描述,匹配到 {match_count} 个用户')
|
||||
)
|
||||
@ -1,22 +0,0 @@
|
||||
from django.http import HttpResponse
|
||||
import json
|
||||
|
||||
class SimpleCorsMiddleware:
|
||||
def __init__(self, get_response):
|
||||
self.get_response = get_response
|
||||
|
||||
def __call__(self, request):
|
||||
# 处理预检请求
|
||||
if request.method == "OPTIONS":
|
||||
response = HttpResponse()
|
||||
response["Access-Control-Allow-Origin"] = "*"
|
||||
response["Access-Control-Allow-Methods"] = "POST, GET, OPTIONS, PUT, DELETE"
|
||||
response["Access-Control-Allow-Headers"] = "Content-Type, Authorization, X-Requested-With"
|
||||
response["Access-Control-Max-Age"] = "86400"
|
||||
return response
|
||||
|
||||
response = self.get_response(request)
|
||||
response["Access-Control-Allow-Origin"] = "*"
|
||||
response["Access-Control-Allow-Methods"] = "POST, GET, OPTIONS, PUT, DELETE"
|
||||
response["Access-Control-Allow-Headers"] = "Content-Type, Authorization, X-Requested-With"
|
||||
return response
|
||||
@ -1,34 +0,0 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-01 15:07
|
||||
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='T_Object_Info',
|
||||
fields=[
|
||||
('number', models.AutoField(primary_key=True, serialize=False, verbose_name='编号')),
|
||||
('object', models.CharField(max_length=100, verbose_name='物品名称')),
|
||||
('color', models.CharField(max_length=50, verbose_name='物品颜色')),
|
||||
('feature', models.TextField(verbose_name='物品特征')),
|
||||
('brand', models.CharField(max_length=100, verbose_name='物品品牌')),
|
||||
('telephone', models.CharField(max_length=11, verbose_name='联系电话')),
|
||||
('location', models.CharField(max_length=200, verbose_name='位置')),
|
||||
('image_path', models.CharField(blank=True, max_length=500, null=True, verbose_name='图片路径')),
|
||||
('create_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='创建时间')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '物品信息',
|
||||
'verbose_name_plural': '物品信息',
|
||||
'db_table': 'T_Object_Info',
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,26 +0,0 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-02 05:57
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('project', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='T_User',
|
||||
fields=[
|
||||
('user_id', models.AutoField(primary_key=True, serialize=False, verbose_name='用户序号')),
|
||||
('wechat_id', models.CharField(max_length=100, unique=True, verbose_name='微信号')),
|
||||
('nickname', models.CharField(max_length=100, verbose_name='微信昵称')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '用户信息',
|
||||
'verbose_name_plural': '用户信息',
|
||||
'db_table': 'T_User',
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,27 +0,0 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-02 07:41
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('project', '0002_t_user'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='T_Description',
|
||||
fields=[
|
||||
('desc_id', models.AutoField(primary_key=True, serialize=False, verbose_name='描述序号')),
|
||||
('description', models.TextField(verbose_name='用户描述')),
|
||||
('wechat', models.ForeignKey(db_column='wechat_id', on_delete=django.db.models.deletion.CASCADE, to='project.t_user', to_field='wechat_id', verbose_name='微信号')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '用户描述',
|
||||
'verbose_name_plural': '用户描述',
|
||||
'db_table': 'T_Description',
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,28 +0,0 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-02 12:09
|
||||
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('project', '0003_t_description'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='t_description',
|
||||
options={'verbose_name': '用户描述'},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='t_object_info',
|
||||
name='image_path',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='t_description',
|
||||
name='created_time',
|
||||
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now, verbose_name='创建时间'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@ -1,17 +0,0 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-04 13:53
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('project', '0004_alter_t_description_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='t_description',
|
||||
name='created_time',
|
||||
),
|
||||
]
|
||||
@ -1,23 +0,0 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-16 07:23
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('project', '0005_remove_t_description_created_time'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='t_object_info',
|
||||
name='claim_phone',
|
||||
field=models.CharField(blank=True, max_length=11, null=True, verbose_name='认领人手机号'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='t_object_info',
|
||||
name='state',
|
||||
field=models.CharField(choices=[('未领取', '未领取'), ('已领取', '已领取')], default='未领取', max_length=20, verbose_name='物品状态'),
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-16 10:56
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('project', '0006_t_object_info_claim_phone_t_object_info_state'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='t_object_info',
|
||||
name='photo',
|
||||
field=models.CharField(blank=True, default='', max_length=500, null=True, verbose_name='识别照片路径'),
|
||||
),
|
||||
]
|
||||
@ -1,3 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@ -1,23 +0,0 @@
|
||||
from django.urls import path
|
||||
from . import views
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.urls import path, include
|
||||
urlpatterns = [
|
||||
path('identify/', views.identify_item, name='identify_item'),
|
||||
path('submit/', views.submit_item, name='submit_item'),
|
||||
path('items/', views.get_items, name='get_items'),
|
||||
path('wechat/login/', views.wechat_login, name='wechat_login'),
|
||||
path('users/', views.get_user_list, name='get_user_list'),
|
||||
path('search/objects', views.search_objects, name='search_objects'),
|
||||
path('save-description/', views.save_description, name='save_description'),
|
||||
path('saved-descriptions/', views.saved_descriptions, name='saved_descriptions'),
|
||||
path('delete-description/', views.delete_description, name='delete_description'),
|
||||
path('check-auto-match/', views.check_auto_match, name='check_auto_match'),
|
||||
path('claim-item/', views.claim_item, name='claim_item'), # 新增认领接口
|
||||
path('items/<int:item_id>/', views.get_item_detail, name='get_item_detail'),
|
||||
path('upload-photo/', views.upload_photo, name='upload_photo'), #上传照片
|
||||
|
||||
# 兼容原有接口
|
||||
path('search/', views.search_objects, name='search'),
|
||||
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
@ -1,29 +0,0 @@
|
||||
@echo off
|
||||
echo ========================================
|
||||
echo 开始执行失物招领自动匹配任务
|
||||
echo 时间:%date% %time%
|
||||
echo ========================================
|
||||
|
||||
REM 切换到项目目录
|
||||
cd /d E:\Python_study\DjangoProject
|
||||
|
||||
REM 激活虚拟环境
|
||||
call .venv\Scripts\activate.bat
|
||||
|
||||
REM 执行匹配命令
|
||||
echo 正在执行匹配任务...
|
||||
python manage.py run_match
|
||||
|
||||
REM 检查执行结果
|
||||
if %errorlevel% == 0 (
|
||||
echo 匹配任务执行成功!
|
||||
) else (
|
||||
echo 匹配任务执行失败!
|
||||
)
|
||||
|
||||
echo ========================================
|
||||
echo 任务执行完成
|
||||
echo ========================================
|
||||
|
||||
REM 暂停以便查看结果(可选)
|
||||
REM pause
|
||||
@ -1,7 +0,0 @@
|
||||
sonar.projectKey=Notes-master2
|
||||
sonar.projectName=Notes-master2
|
||||
sonar.sources=.
|
||||
sonar.sourceEncoding=UTF-8
|
||||
sonar.python.version=3
|
||||
sonar.host.url=http://localhost:9000
|
||||
sonar.token=sqp_52f5140964a42f8b4068d07aba6382cd0489c512
|
||||
|
Before Width: | Height: | Size: 173 KiB |
|
Before Width: | Height: | Size: 111 KiB |
@ -1 +0,0 @@
|
||||
Subproject commit eee2e57e1eb685bca14b8b50817c562fba1303d5
|
||||