All Friends Report (Report All Friends)
Overview
This is the platform's primary report: a table of every LINE friend belonging to an OA, with selectable attribute columns. It is used to survey the friend base, filter it by any supported condition, and export the results as CSV.
It also covers friend import history, showing how many records each import run succeeded or failed on.
The module reuses the query builder from the lineuser module so that the filters available here match the friend search screen exactly.
The actual module in code is internal/modules/report and the system module name is
report-all-friends. This documentation page uses the all-friend-listing slug due to
file-naming constraints in the documentation repository.
Business Flow
- View the report —
GET /api/report/all-friendreturns paginated data.- Filtering uses
FilterGetLineUserDto, the same DTO asGET /api/line-users/search - The available attribute columns come from
GET /api/attribute-master/reportable
- Filtering uses
- Export to CSV —
GET /api/report/all-friend/exportapplies the same conditions as above but streams the result directly to the response with no page limit. This endpoint requires theexportpolicy, which is separate fromreadAll. - View import history —
GET /api/report/import-historyreads fromline_user_importandline_user_import_detailand reports the outcome of each import run, covering both LINE User Management and Import Mapping. If the read fails, the system responds with the messageFailed to find all line user importas an HTTP 500, matching the legacy behaviour.
Key Files & Functions
The code lives in internal/modules/report/, comprising controller.go, service.go,
dto.go and module.go.
All routes are registered on authed.Group("/report") and wrapped in
modulegate.ModuleGate(d, "report-all-friends").
| Method | Route | Handler | Policy |
|---|---|---|---|
| GET | /api/report/all-friend | svc.getReportAllFriendHandler | readAll report-all-friends |
| GET | /api/report/all-friend/export | svc.getExportReportAllFriendHandler | export report-all-friends |
| GET | /api/report/import-history | svc.getImportHistoryHandler | readAll report-all-friends |
The variable governing the error behaviour is errFindAllLineUserImport in service.go.
Connections to Other Services
- Permissions — requires
ModuleGate("report-all-friends")and carriesPolicyModuleReportAllFriendsas metadata. - Tables —
line_user,line_user_import,line_user_import_detail,attribute_master,system_attributeandline_oa. - Cross-module — imports
internal/modules/lineuserto share its query builder, and usesinternal/core/validationto validate query parameters. - CSV export — results are streamed to the response, the same approach used for audience exports.
- Related modules — LINE User Management, Attribute Master, Import Mapping, Audience Management and Dashboard.