Master#1379
Closed
YuGit599 wants to merge 5 commits into
Closed
Conversation
Fixed typos in workflow configuration and comments.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for including location details in bill remark templates (end-to-end: data model → remark generation → UI placeholder → Android permission onboarding), and hardens remark normalization against pathological long inputs.
Changes:
- Add
locationInfotoBillInfoModel, parse it inBillService, and inject【位置信息】into remark templates viaBillMerger. - Add address-part formatting helpers and tests, plus a length guard to keep
normalizeName()from heavy scanning on very large strings. - Add Android location permission strings, manifest permissions, and an onboarding permission card; add a GitHub Actions workflow to build APKs.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/test/java/org/ezbook/server/tools/BillMergerRemarkNormalizationTest.kt | Adds tests for long-input normalization behavior and location formatting. |
| server/src/main/java/org/ezbook/server/tools/BillService.kt | Parses locationInfo from incoming JSON into the bill model. |
| server/src/main/java/org/ezbook/server/tools/BillMerger.kt | Adds 【位置信息】 placeholder replacement and address normalization; caps remark normalization work. |
| server/src/main/java/org/ezbook/server/db/model/BillInfoModel.kt | Introduces persisted locationInfo field on the Room entity. |
| app/src/main/res/values/strings.xml | Adds English strings for location permission onboarding. |
| app/src/main/res/values-zh/strings.xml | Adds Chinese strings for location permission onboarding. |
| app/src/main/res/menu/bill_menu.xml | Adds the app: XML namespace (needed for app:* attributes). |
| app/src/main/java/net/ankio/auto/ui/fragment/settings/RemarkFormatFragment.kt | Exposes the new 【位置信息】 placeholder in the remark-format UI. |
| app/src/main/java/net/ankio/auto/ui/fragment/intro/IntroPagePermissionFragment.kt | Adds an optional location permission card and request flow. |
| app/src/main/AndroidManifest.xml | Declares coarse/fine location permissions. |
| .github/workflows/main.yml | Adds CI workflow to build and upload debug/release APK artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+258
to
+261
| val withoutCountry = normalized | ||
| .removePrefix("中国") | ||
| .removePrefix("中华人民共和国") | ||
| .trimStart() |
Comment on lines
+124
to
+129
| /** | ||
| * 当前 GPS 定位得到的地址信息,格式化后可用于备注模板。 | ||
| * 例如:嘉兴市南湖区xx路xx小区6号 | ||
| */ | ||
| var locationInfo: String = "", | ||
|
|
Comment on lines
+65
to
+72
| val executor = Executors.newSingleThreadExecutor() | ||
| try { | ||
| val future = executor.submit<String> { BillMerger.normalizeName(input) } | ||
| val result = future.get(2, TimeUnit.SECONDS) | ||
| assertEquals(input, result) | ||
| } finally { | ||
| executor.shutdownNow() | ||
| } |
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.