Skip to content

Instantly share code, notes, and snippets.

@wanyutang
wanyutang / winnygist.labs.Spring Data JPA find 回傳指定欄位.md
Last active January 8, 2026 08:58
winnygist.labs.Spring Data JPA find 回傳指定欄位.md

目標

在 Spring Data JPA 中,我們經常需要查詢資料:

  • 整個 Entity(例如 findById)
  • 單個欄位(使用 Projection Interface,不需整個 entity)

以下示範如何使用 projection interface 取單欄位,並與原生 findById 返回整個 entity 做對比。

Table of Contents

@wanyutang
wanyutang / winnygist.labs.Spring Boot AOP TraceId Demo 實作指南.md
Created January 8, 2026 07:11
winnygist.labs.Spring Boot AOP TraceId Demo 實作指南.md

Spring Boot AOP TraceId Demo 實作指南

目標與前提

  • 示範 Web Request 層級的 TraceId 初始化與清理
  • 使用 MDC + AOP + Controller 範例驗證效果

Table of Contents

                                                                                  # 交付日前安排 Code Review 與 Demo 計劃

回顧過往 Sprint 經驗,部分任務在 Due Date 前缺乏正式 Review,導致問題與風險集中在交付前才被發現,影響交付品質與時程可預期性。

Table of Contents

註解小文件 Comment-Driven Development (CDD) 撰寫規範

  • 先寫註解再寫程式,註解即設計說明(Design in Comments)
  • 設計決策直接存在程式碼中,而非依賴外部、易過期的文件
  • 程式碼與文件高度貼近,降低維護成本
  • 透過 JavaDoc、marker interface、annotation 表達設計意圖與限制
  • 文件即程式碼(Docs as Code)
  • 技術文件與實作共存,避免文件與程式脫鉤

Table of Contents

Method 回傳值 Null 標註原則-Spring Boot

本文件說明在 Spring Boot 專案中,如何使用 @NotNull@Nullable 來明確定義 method 回傳值的 null 行為,以降低 NullPointerException 發生風險,並提升程式碼可讀性與 IDE 輔助效果。


摘要重點:
看到 @Nullable → 呼叫端一定要處理 null

Table of Contents

AI 浪潮-從提升效率到創造超額收益的巨大變革

根據花旗集團 (Citi) 最新報告《AI in Investment Management》的研究,人工智慧 (AI) 在投資管理領域的應用正在經歷一場巨大的變革 (a seismic shift)。AI 的焦點已從最初的提高營運效率和生產力 迅速轉變為主動貢獻超額收益(Alpha)的生成。

這份報告的重點,是理解如何將 AI 整合到投資流程中,以確保透明度、風險可控性,並帶來切實的投資回報(ROI)。


轉型的核心驅動力:生成式 AI 結合代理式 AI