Content Link Collections
Overview
A Content Link is a single link that bundles multiple pieces of content. Instead of sending one link per page, an administrator creates a content link bound to a set of criteria — categories, tags, or a hand-picked list — and shares one URL. Opening it presents every piece of content matching those criteria.
Each link carries its own token, which can be reissued when the original should no longer work. A preview endpoint lets the author confirm exactly what the link will show before distributing it.
Business Flow
GET /api/content-linkslists all links with filtering perQueryContentLinkDto.POST /api/content-linkscreates a link, specifying which content it should gather. The system generates a random token usingcrypto/rand, hex-encoded.GET /api/content-links/:id/preview-contentswithpageandlimitparameters returns a paginated preview of what the link will resolve to, before it goes out.GET /api/content-links/:idreturns details andPATCH /api/content-links/:idupdates the criteria.POST /api/content-links/:id/regenerate-tokenissues a new token, invalidating the previous link immediately.DELETE /api/content-links/:idremoves a link, responding with 204.- End users opening the link are served by the publicmod module's public endpoint,
GET /api/public/contents, which is rate limited to 10 requests per 60 seconds.
Key Files & Functions
Core code lives in internal/modules/contentlink/, comprising controller.go, service.go,
and dto.go, registered on the authed.Group("/content-links") group.
| Method | Route | Handler | Policy (metadata) |
|---|---|---|---|
| GET | /api/content-links | svc.findAllHandler | readAll line-oa |
| GET | /api/content-links/:id | svc.findOneHandler | read line-oa |
| GET | /api/content-links/:id/preview-contents | svc.getPreviewContentsHandler | read line-oa |
| POST | /api/content-links | svc.createHandler | create line-oa |
| POST | /api/content-links/:id/regenerate-token | svc.regenerateTokenHandler | create line-oa |
| PATCH | /api/content-links/:id | svc.updateHandler | update line-oa |
| DELETE | /api/content-links/:id | svc.removeHandler | delete line-oa |
Internally the module defines a userContext struct, ported from
ContentLinkService.getUserContext(), holding the userID, lineOaID, and organizationID
read from CLS.
Connections to Other Services
- Access control — requests must pass global
JwtAuth. The policy metadata isPolicyModuleLineOaand is not yet enforced; there is noModuleGate. - Tables —
content_link,content_page,content_category,content_subcategory,line_oa - Context — reads
userId,lineOaId, andorganizationIdfrom CLS. - Related modules — Content Page, Content Category, Content Subcategory, Public API, and Menu Builder, another public-token mini-site format.