2
0
Эх сурвалжийг харах

♻️ refactor(stock): remove redundant getStockMemos method

- 删除获取股票备忘录数据的getStockMemos方法,该功能已由其他服务实现
- 清理股票数据服务中不再使用的代码,减少维护成本
yourname 5 сар өмнө
parent
commit
c7fc05eceb

+ 0 - 45
src/server/modules/stock/stock-data.service.ts

@@ -82,51 +82,6 @@ export class StockDataService extends GenericCrudService<StockData> {
     }
   }
 
-  /**
-   * 获取股票备忘录数据
-   * @param code 股票代码
-   * @returns 股票备忘录列表
-   */
-  async getStockMemos(code?: string): Promise<Array<{
-    date: string;
-    memo: string;
-    [key: string]: string;
-  }>> {
-    try {
-      if (!code) {
-        return [];
-      }
-
-      const notes = await this.repository.manager.query(`
-        SELECT 
-          note_date as date,
-          note as memo
-        FROM date_notes
-        WHERE code = ?
-        ORDER BY note_date ASC
-      `, [code]);
-
-      if (!notes || notes.length === 0) {
-        return [];
-      }
-
-      // 转换数据格式
-      const formattedNotes = notes.map((note: any) => ({
-        date: dayjs(note.date).format('YYYY-MM-DD'),
-        memo: note.memo,
-        日期: dayjs(note.date).format('YYYY-MM-DD'),
-        提示: note.memo
-      }));
-
-      log.db(`Retrieved ${formattedNotes.length} memos for ${code}`);
-      return formattedNotes;
-
-    } catch (error) {
-      log.db('Error fetching memo data:', error);
-      throw error;
-    }
-  }
-
   /**
    * 获取股票最新数据
    * @param code 股票代码