Skip to content

feat: APKダウンロード機能を追加#15

Merged
Atsumi3 merged 5 commits intomainfrom
feat-apk-download
Sep 29, 2025
Merged

feat: APKダウンロード機能を追加#15
Atsumi3 merged 5 commits intomainfrom
feat-apk-download

Conversation

@Atsumi3
Copy link
Member

@Atsumi3 Atsumi3 commented Sep 26, 2025

概要

APKダウンロード機能の追加と、販売APIのエラーハンドリング改善、店舗管理画面の実装を行いました。

主な変更点

1. APKダウンロード機能

  • APKファイルのアップロード・管理機能を追加
  • バージョン管理とダウンロード機能を実装
  • Web UIとAPIエンドポイントの両方をサポート

2. 販売APIエラーハンドリングの改善

  • 包括的な日本語エラーメッセージの実装
  • staffBarcodeフィールドのnullable化
  • APIの堅牢性向上(デフォルト値の設定)
  • OpenAPI仕様書を実装に合わせて更新

3. 店舗管理画面の実装

  • 店舗作成画面(/stores/new)
  • 店舗編集画面(/stores/{id}/edit)
  • Bootstrap 5によるモダンなUI/UXデザイン
  • 削除機能に確認ダイアログを追加

4. OpenAPI仕様の更新

  • CreateSaleRequestスキーマの修正
  • SaleResponse/SaleItemResponseスキーマの追加
  • ErrorResponseスキーマの更新
  • レスポンスステータスコードの適切な設定

テスト方法

APK機能のテスト

# APK管理画面にアクセス
http://localhost:8080/apk

# APIでバージョン情報取得
curl http://localhost:8080/api/apk/version

店舗管理のテスト

# 店舗管理画面にアクセス
http://localhost:8080/stores

# 新規作成画面
http://localhost:8080/stores/new

# API経由で店舗一覧取得
curl http://localhost:8080/api/stores

販売APIのテスト

# 売上作成(エラーメッセージ確認)
curl -X POST http://localhost:8080/api/sales \
  -H "Content-Type: application/json" \
  -d '{"storeId": 1, "itemIds": "", "deposit": 1000}'

チェックリスト

  • APKアップロード/ダウンロード機能の実装
  • 販売APIのエラーハンドリング改善
  • 店舗管理画面の実装
  • OpenAPI仕様書の更新
  • ビルド確認済み
  • アプリケーション起動確認済み

関連Issue

  • APKダウンロード機能の追加要望
  • 販売APIのエラーメッセージ改善
  • 店舗管理画面の実装

備考

  • Java 21対応済み
  • Spring Boot 2.7.3
  • ktlintフォーマット適用済み

## 主な変更内容

### 新機能
- APKファイルのアップロード/ダウンロード機能を実装
- バージョン管理とアップデート確認機能
- Web UIによる管理画面
- REST API エンドポイント

### 実装詳細

#### バックエンド
- ApkVersionEntity: APKバージョン情報を管理するエンティティ
- ApkVersionRepository: データアクセス層
- ApkVersionService: ビジネスロジック層
- ApkApiController: REST APIコントローラー
- ApkController: Web UIコントローラー

#### フロントエンド
- APK管理画面(/apk)
- アップロードフォーム
- バージョン一覧表示

#### セキュリティ
- HTTPS対応(自己署名証明書)
- ファイルサイズ制限(100MB)
- APKファイル形式の検証

### API エンドポイント
- GET /api/apk/version/latest - 最新バージョン情報
- GET /api/apk/version/check - アップデート確認
- GET /api/apk/download/latest - 最新APKダウンロード
- POST /api/apk/upload - APKアップロード

### 設定
- SSL設定を application.yaml に追加
- APKアップロード設定を追加
- 自己署名証明書生成スクリプトを追加
@github-actions
Copy link
Contributor

🎨 Visual Regression Test Results

Visual regression tests failed

Some pages have visual differences. Please review the artifacts:

📋 Actions to take:

  1. Download test artifacts
  2. Review the diff images to understand the changes
  3. If changes are intentional, add update-snapshots label to this PR

📊 Test Coverage

  • Desktop (1280x720)
  • Tablet (iPad)
  • Mobile (iPhone 13)

@Atsumi3 Atsumi3 self-assigned this Sep 26, 2025
@Atsumi3 Atsumi3 added the update-snapshots update vrt label Sep 26, 2025
- @value アノテーションをコンストラクタパラメータに移動
- @PostConstruct を使用して初期化処理を実装
- Flyway マイグレーションファイル追加 (V003__add_apk_versions_table.sql)
- CI でのアプリケーション起動エラーを修正
@github-actions github-actions bot removed the update-snapshots update vrt label Sep 26, 2025
@github-actions
Copy link
Contributor

🎨 Visual Regression Test Results

All visual regression tests passed!

All page screenshots match the expected baselines.

📊 Test Coverage

  • Desktop (1280x720)
  • Tablet (iPad)
  • Mobile (iPhone 13)

## 変更内容

### テスト追加
- ApkVersionServiceTest: サービス層のユニットテスト
- ApkApiControllerTest: コントローラー層のユニットテスト
- mockito-kotlin依存関係を追加

### UI改善
- layout-modern.htmlにAPK管理へのナビゲーションリンクを追加
- サイドバーに「APK管理」メニュー項目を追加

### CI対応
- テストカバレッジの向上
- Visual Regression Testsへの対応準備

これによりCIが継続的に通るようになります。
@github-actions
Copy link
Contributor

🎨 Visual Regression Test Results

Visual regression tests failed

Some pages have visual differences. Please review the artifacts:

📋 Actions to take:

  1. Download test artifacts
  2. Review the diff images to understand the changes
  3. If changes are intentional, add update-snapshots label to this PR

📊 Test Coverage

  • Desktop (1280x720)
  • Tablet (iPad)
  • Mobile (iPhone 13)

- テストファイルのフォーマットを修正
- 不要なインポートを削除
- コードスタイルを統一
@github-actions
Copy link
Contributor

🎨 Visual Regression Test Results

All visual regression tests passed!

All page screenshots match the expected baselines.

📊 Test Coverage

  • Desktop (1280x720)
  • Tablet (iPad)
  • Mobile (iPhone 13)

## 変更内容

### 販売API関連
- staffBarcodeフィールドをnullable化し、実装から削除
- 包括的な日本語エラーメッセージの実装
- CreateSaleRequestにデフォルト値を設定してAPI耐性を向上
- OpenAPI仕様書を実装に合わせて更新

### 店舗管理画面
- 店舗作成画面の実装(/stores/new)
- 店舗編集画面の実装(/stores/{id}/edit)
- Bootstrap 5によるモダンなUI/UXデザイン
- 削除機能に確認ダイアログを追加

### OpenAPI仕様の修正
- CreateSaleRequestスキーマを実装に合致するよう更新
- SaleResponseとSaleItemResponseスキーマを追加
- ErrorResponseスキーマを実際のエラー構造に合わせて更新
- APIレスポンスステータスコードを適切に設定

## 技術的詳細
- Spring Bootのベストプラクティスに準拠
- JPAエンティティとリポジトリの適切な実装
- キャッシュ機能を含むサービス層の実装
- トランザクション管理の適用
@github-actions
Copy link
Contributor

🎨 Visual Regression Test Results

Visual regression tests failed

Some pages have visual differences. Please review the artifacts:

📋 Actions to take:

  1. Download test artifacts
  2. Review the diff images to understand the changes
  3. If changes are intentional, add update-snapshots label to this PR

📊 Test Coverage

  • Desktop (1280x720)
  • Tablet (iPad)
  • Mobile (iPhone 13)

@Atsumi3 Atsumi3 merged commit 37703c8 into main Sep 29, 2025
1 of 2 checks passed
@Atsumi3 Atsumi3 deleted the feat-apk-download branch September 29, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant