This commit is contained in:
seb
2026-10-11 03:30:30 +02:00
parent 47c61c9f2a
commit b5e7643e12
5 changed files with 9 additions and 5 deletions

View File

@@ -233,7 +233,7 @@ _none_
#### List brands — `GET /brand` #### List brands — `GET /brand`
- Params: `query: offset?: int, limit?: int, includeSmallThumbs?: bool` - Params: `query: offset?: int, limit?: int, includeSmallThumbs?: bool`
- Returns: `200 { brands: { id: int, name: str, pics: { fullHash: str, thumbW: int, thumbH: int, thumbHash: str, smallThumbW?: int|null, smallThumbH?: int|null, smallThumbBinary?: str|null }[], gsprpinfo?: str|null }[], total: int, offset: int, limit: int }` - Returns: `200 { brands: { id: int, name: str, articleCount: int, pics: { fullHash: str, thumbW: int, thumbH: int, thumbHash: str, smallThumbW?: int|null, smallThumbH?: int|null, smallThumbBinary?: str|null }[], gsprpinfo?: str|null }[], total: int, offset: int, limit: int }`
#### Create brand — `POST /brand` #### Create brand — `POST /brand`
- Params: `body: { name: str, gsprpinfo?: str }` - Params: `body: { name: str, gsprpinfo?: str }`
- Returns: `201 { brand: { id: int, name: str, pics: T36[], gsprpinfo?: str|null } }` - Returns: `201 { brand: { id: int, name: str, pics: T36[], gsprpinfo?: str|null } }`

View File

@@ -216,7 +216,7 @@ _none_
#### List brands — `GET /brand` #### List brands — `GET /brand`
- Params: `query: offset?: int, limit?: int, includeSmallThumbs?: bool` - Params: `query: offset?: int, limit?: int, includeSmallThumbs?: bool`
- Returns: `200 { brands: { id: int, name: str, pics: { fullHash: str, thumbW: int, thumbH: int, thumbHash: str, smallThumbW?: int|null, smallThumbH?: int|null, smallThumbBinary?: str|null }[], gsprpinfo?: str|null }[], total: int, offset: int, limit: int }` - Returns: `200 { brands: { id: int, name: str, articleCount: int, pics: { fullHash: str, thumbW: int, thumbH: int, thumbHash: str, smallThumbW?: int|null, smallThumbH?: int|null, smallThumbBinary?: str|null }[], gsprpinfo?: str|null }[], total: int, offset: int, limit: int }`
#### Create brand — `POST /brand` #### Create brand — `POST /brand`
- Params: `body: { name: str, gsprpinfo?: str }` - Params: `body: { name: str, gsprpinfo?: str }`
- Returns: `201 { brand: { id: int, name: str, pics: T32[], gsprpinfo?: str|null } }` - Returns: `201 { brand: { id: int, name: str, pics: T32[], gsprpinfo?: str|null } }`

View File

@@ -4,7 +4,7 @@ Protected. Requires a valid session cookie (`credentials: 'include'`).
List brands List brands
Lists brands for the authenticated user's selected company, sorted by name. Paged; `total` is the unpaged count. Small-thumbnail fields are omitted by default. Set `includeSmallThumbs=true` to include each picture's `smallThumbW`, `smallThumbH`, and `smallThumbBinary` (base64-encoded AVIF bytes, resized with a 32px maximum edge). Lists brands for the authenticated user's selected company, sorted by name. Paged; `total` is the unpaged count. Each brand includes `articleCount` (child articles inherit the brand from their father article; father articles are not counted). Small-thumbnail fields are omitted by default. Set `includeSmallThumbs=true` to include each picture's `smallThumbW`, `smallThumbH`, and `smallThumbBinary` (base64-encoded AVIF bytes, resized with a 32px maximum edge).
## Query parameters ## Query parameters
@@ -24,6 +24,7 @@ Brand list
{ {
"id": 1, "id": 1,
"name": "…", "name": "…",
"articleCount": 1,
"gsprpinfo": "…", "gsprpinfo": "…",
"pics": [ "pics": [
{ {

View File

@@ -396,12 +396,15 @@
* description: Base64-encoded small AVIF thumbnail bytes * description: Base64-encoded small AVIF thumbnail bytes
* BrandList: * BrandList:
* type: object * type: object
* required: [id, name, pics] * required: [id, name, articleCount, pics]
* properties: * properties:
* id: * id:
* type: integer * type: integer
* name: * name:
* type: string * type: string
* articleCount:
* type: integer
* description: Number of articles assigned to this brand (excluding father articles, including child articles inheriting the brand)
* gsprpinfo: * gsprpinfo:
* type: string * type: string
* nullable: true * nullable: true

View File

@@ -51,7 +51,7 @@ export function register(app, basePath = '') {
* get: * get:
* tags: [Brand] * tags: [Brand]
* summary: List brands * summary: List brands
* description: Lists brands for the authenticated user's selected company, sorted by name. Paged; `total` is the unpaged count. Small-thumbnail fields are omitted by default. Set `includeSmallThumbs=true` to include each picture's `smallThumbW`, `smallThumbH`, and `smallThumbBinary` (base64-encoded AVIF bytes, resized with a 32px maximum edge). * description: Lists brands for the authenticated user's selected company, sorted by name. Paged; `total` is the unpaged count. Each brand includes `articleCount` (child articles inherit the brand from their father article; father articles are not counted). Small-thumbnail fields are omitted by default. Set `includeSmallThumbs=true` to include each picture's `smallThumbW`, `smallThumbH`, and `smallThumbBinary` (base64-encoded AVIF bytes, resized with a 32px maximum edge).
* security: * security:
* - cookieAuth: [] * - cookieAuth: []
* parameters: * parameters: