Files
aurak/docs/1.0/DEVELOPMENT_STANDARDS.md
T
Developer 0a9588abb7 feat: implement QuestionBank CRUD with pagination and template query
- Add pagination support to findAll (page, limit query params)
- Add findByTemplateId method to service
- Add GET /by-template/:templateId endpoint to controller
- Service already includes CRUD for QuestionBank and QuestionBankItem
2026-04-23 17:19:11 +08:00

72 lines
2.4 KiB
Markdown

# 開発基準
## コードコメントの基準
### 1. コメントの言語
- **すべてのコードコメントは中国語を使用する必要があります**
- 以下を含みますが、これらに限定されません:
- 関数/メソッドのコメント
- 行内コメント
- コードブロックの説明
- TODO/FIXME コメント
### 2. ログ出力の基準
- **すべてのログ出力は中国語を使用する必要があります**
- 以下を含みますが、これらに限定されません:
- `logger.log()` 情報ログ
- `logger.warn()` 警告ログ
- `logger.error()` ラーログ
- `console.log()` デバッグ出力
### 3. エラーメッセージの基準
- **ユーザーに表示されるエラーメッセージは中国語を使用します**
- **開発デバッグ用のエラーメッセージは中国語を使用します**
- 例外スロー時のエラーメッセージには中国語を使用します
## 例
### 正しいコメントとログ
```typescript
// 正解:中国語のコメント
async getEmbeddings(texts: string[]): Promise<number[][]> {
this.logger.log(`正在为 ${texts.length} 个文本生成嵌入向量`); // 正解:中国語のログ
try {
// APIを呼び出して埋め込みベクトルを取得
const response = await this.callEmbeddingAPI(texts);
return response.data;
} catch (error) {
this.logger.error('获取嵌入向量失败', error); // 正解:中国語のログ
throw new Error('嵌入向量生成失败'); // 正解:中国語のエラーメッセージ
}
}
```
### 誤ったコメントとログ
```typescript
// 誤り:英語のコメントとログ
async getEmbeddings(texts: string[]): Promise<number[][]> {
this.logger.log(`Getting embeddings for ${texts.length} texts`);
try {
// Call API to get embeddings
const response = await this.callEmbeddingAPI(texts);
return response.data;
} catch (error) {
this.logger.error('Failed to get embeddings', error);
throw new Error('Embedding generation failed');
}
}
```
## 履行基準
1. **コードレビュー時には、必ずコメントとログの言語をチェックしてください**
2. **新規コードは、中国語のコメントとログの基準に従う必要があります**
3. **既存のコードをリファクタリングする際は、同時にコメントとログも中国語に更新してください**