Skip to content

Commit a125bde

Browse files
frankslinclaude
andcommitted
為 /codes 增加表格 CBDB_NAME_LIST 的支持
- 在 config/codes.php 中添加 CBDB_NAME_LIST 到允許的表列表 - 在 CodesController.php 中配置 CBDB_NAME_LIST 為只讀表 - 設定自定義列顯示配置:c_personid, name, source - 設定複合主鍵覆蓋:c_personid + name + source(用於行識別) 由於 CBDB_NAME_LIST 表沒有定義主鍵,將其設為只讀表以確保數據完整性。 所有測試通過(100 tests, 446 assertions)。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 489adea commit a125bde

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

app/Http/Controllers/CodesController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class CodesController extends Controller
3333
* @var array<int, string>
3434
*/
3535
protected $readOnlyTables = [
36+
'CBDB_NAME_LIST',
3637
'DYNASTIES',
3738
'GANZHI_CODES',
3839
];
@@ -44,6 +45,7 @@ class CodesController extends Controller
4445
protected $tableColumnOverrides = [
4546
'ADDR_BELONGS_DATA' => ['c_addr_id', 'c_belongs_to', 'c_firstyear', 'c_lastyear'],
4647
'ADDR_CODES' => ['c_addr_id', 'c_name_chn', 'c_name', 'c_firstyear', 'c_lastyear', 'c_admin_type'],
48+
'CBDB_NAME_LIST' => ['c_personid', 'name', 'source'],
4749
'ADDRESSES' => [
4850
'c_addr_id',
4951
'c_addr_cbd',
@@ -100,6 +102,7 @@ class CodesController extends Controller
100102
* @var array<string, array<int, string>>
101103
*/
102104
protected $tablePrimaryKeyOverrides = [
105+
'CBDB_NAME_LIST' => ['c_personid', 'name', 'source'],
103106
'TEXT_CODES' => ['c_textid'],
104107
];
105108
/**

config/codes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'ASSUME_OFFICE_CODES',
1515
'BIOG_ADDR_CODES',
1616
'BIOG_INST_CODES',
17+
'CBDB_NAME_LIST',
1718
'CHORONYM_CODES',
1819
'COUNTRY_CODES',
1920
'DYNASTIES',

0 commit comments

Comments
 (0)