Files
store-scraper-bot/internal/api/apple/request/apple_app_request.go
T
tiennm99 e695d9b223 feat: port logic from Java original to align with current Java behavior
- Switch Telegram parse mode to HTML to match Java client.
- Rename command identifiers to Java's: delgroup/delapple/delgoogle/
  checkappscore/rawappleapp/rawgoogleapp.
- Move admin singleton to "common" collection at _id="admin".
- Store group _id as string-of-int64 to match Java AbstractModel schema.
- Add `class` discriminator field on persisted models.
- Expand AppleAppResponse (42 fields) and GoogleAppResponse (63 fields,
  with nested Category/Feature) to match Java records.
- Add AppleAppRequest (track id or bundle id) / GoogleAppRequest types.
- Implement Raw* commands as Telegram document attachments instead of
  truncated text.
- Group-authorization gate (admin.HasGroup(chatId)) on non-admin commands.
- Cache TTL via millis timestamp; round score to 1 decimal; weekend silent
  send in scheduler.
- Match Java table renderer: " │ " separators, "─┼─" rows every 5 lines.
- Prefer MONGODB_CONNECTION_STRING env (Java parity); auto-extract DB
  name from URI with fallback to "store-scraper-bot".

Note: This is an AI-assisted port (not human-verified). Behavior parity
with the Java implementation has not been tested end-to-end; treat as a
starting point.
2026-04-25 20:26:25 +07:00

19 lines
604 B
Go

package request
// AppleAppRequest mirrors Java AppleAppRequest record. Either ID (iTunes
// trackId) or AppID (bundleId) is set; the other is omitted from JSON.
type AppleAppRequest struct {
ID *int64 `json:"id,omitempty"`
AppID *string `json:"appId,omitempty"`
Country string `json:"country"`
Ratings bool `json:"ratings"`
}
func ByTrackID(id int64, country string) AppleAppRequest {
return AppleAppRequest{ID: &id, Country: country, Ratings: true}
}
func ByBundleID(appID, country string) AppleAppRequest {
return AppleAppRequest{AppID: &appID, Country: country, Ratings: true}
}