From feb301f9febdeed4cbb822955611cb31a5657c7b Mon Sep 17 00:00:00 2001 From: wang Date: Wed, 3 Jun 2026 15:48:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/dev/sa-base.yaml | 2 +- update_all_comments.py | 72 ------------------- 2 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 update_all_comments.py diff --git a/smart-flow-api/sa-base/src/main/resources/dev/sa-base.yaml b/smart-flow-api/sa-base/src/main/resources/dev/sa-base.yaml index bffea0c..ee4f1eb 100644 --- a/smart-flow-api/sa-base/src/main/resources/dev/sa-base.yaml +++ b/smart-flow-api/sa-base/src/main/resources/dev/sa-base.yaml @@ -1,7 +1,7 @@ spring: # 数据库连接信息 datasource: - url: jdbc:kingbase8://8.162.3.203:54321/economic_crime_dev?currentSchema=public&clientEncoding=utf8&socketTimeout=30000&loginTimeout=30 + url: jdbc:kingbase8://8.162.3.203:54321/opinion_center?currentSchema=public&clientEncoding=utf8&socketTimeout=30000&loginTimeout=30 username: dcms_dev password: sdy@2025#dc$ks driver-class-name: com.kingbase8.Driver diff --git a/update_all_comments.py b/update_all_comments.py deleted file mode 100644 index 8244141..0000000 --- a/update_all_comments.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -""" -批量更新Java文件注释格式 -将所有@Author 1024创新实验室相关的注释统一改为 @Author wzh -""" - -import os -import re -from pathlib import Path - -def update_java_comments(file_path): - """更新单个Java文件的注释""" - try: - with open(file_path, 'r', encoding='utf-8') as f: - content = f.read() - - # 匹配并替换注释块 - # 模式1: 多行注释包含 @Author 1024创新实验室... - pattern = r'/\*\*\s*\n(\s*\*.*?\n)*?\s*\*\s*@Author\s+1024创新实验室[^\n]*\n(\s*\*.*?\n)*?\s*\*/' - - def replace_comment(match): - comment_block = match.group(0) - - # 提取功能说明(第一行) - desc_match = re.search(r'/\*\*\s*\n\s*\*\s*(.+?)\s*\n', comment_block) - if not desc_match: - return comment_block - description = desc_match.group(1) - - # 提取@Date - date_match = re.search(r'\*\s*@Date\s+(.+?)\s*\n', comment_block) - if not date_match: - return comment_block - date_value = date_match.group(1) - - # 构建新的注释 - new_comment = f"/**\n * {description}\n *\n * @Date {date_value}\n * @Author wzh\n */" - return new_comment - - new_content = re.sub(pattern, replace_comment, content, flags=re.MULTILINE | re.DOTALL) - - if new_content != content: - with open(file_path, 'w', encoding='utf-8') as f: - f.write(new_content) - return True - return False - except Exception as e: - print(f"Error processing {file_path}: {e}") - return False - -def main(): - """主函数""" - base_dir = Path('/Users/wang/wang/space/frameworkSpace/smart-flow-master/smart-flow-api') - - # 查找所有Java文件 - java_files = list(base_dir.rglob('*.java')) - - updated_count = 0 - total_count = len(java_files) - - print(f"Found {total_count} Java files") - - for i, java_file in enumerate(java_files, 1): - if update_java_comments(java_file): - updated_count += 1 - print(f"[{i}/{total_count}] Updated: {java_file.relative_to(base_dir)}") - - print(f"\nCompleted! Updated {updated_count} files out of {total_count}") - -if __name__ == '__main__': - main()