Skip to content

Master#1379

Closed
YuGit599 wants to merge 5 commits into
AutoAccountingOrg:masterfrom
YuGit599:master
Closed

Master#1379
YuGit599 wants to merge 5 commits into
AutoAccountingOrg:masterfrom
YuGit599:master

Conversation

@YuGit599

@YuGit599 YuGit599 commented Jul 1, 2026

Copy link
Copy Markdown

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 locationInfo to BillInfoModel, parse it in BillService, and inject 【位置信息】 into remark templates via BillMerger.
  • 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()
}
@AnkioTomas

Copy link
Copy Markdown
Contributor
  1. 我觉得添加位置信息这个功能没什么必要
  2. 代码质量有待提高
  3. 未按照贡献指南合理的提交commit

@AnkioTomas AnkioTomas closed this Jul 1, 2026
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.

3 participants