瀏覽代碼

comment count

master
Daniel 1 年之前
父節點
當前提交
df3404fe63
共有 4 個檔案被更改,包括 16 行新增1 行删除
  1. +1
    -1
      export/openapi.json
  2. +12
    -0
      export/openapi.yaml
  3. +1
    -0
      src/ApiResource/PostingApi.php
  4. +2
    -0
      src/Mapper/PostingEntityToApiMapper.php

+ 1
- 1
export/openapi.json
文件差異過大導致無法顯示
查看文件


+ 12
- 0
export/openapi.yaml 查看文件

@@ -5450,6 +5450,10 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
numComments:
type:
- integer
- 'null'
createdAt:
readOnly: true
type:
@@ -5581,6 +5585,10 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
numComments:
type:
- integer
- 'null'
createdAt:
readOnly: true
type:
@@ -5719,6 +5727,10 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
numComments:
type:
- integer
- 'null'
createdAt:
readOnly: true
type:


+ 1
- 0
src/ApiResource/PostingApi.php 查看文件

@@ -173,6 +173,7 @@ class PostingApi implements OwnerInterface
#[Groups(['posting:create'])]
public ?SaleApi $saleIri = null;

public ?int $numComments = null;

#[ApiProperty(writable: false)]
public ?\DateTimeImmutable $createdAt = null;


+ 2
- 0
src/Mapper/PostingEntityToApiMapper.php 查看文件

@@ -68,6 +68,8 @@ class PostingEntityToApiMapper implements MapperInterface
]);
}

$dto->numComments = count($entity->getComments());

$dto->createdAt = $entity->getCreatedAt();

return $dto;


Loading…
取消
儲存