Merged PR 308: IF実装(Dealer取得API)
## 概要 [Task2352: IF実装(Dealer取得API)](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2352) - ディーラー取得APIのIFを実装 ## レビューポイント - レスポンスとして返却するデータの認識はあっているか ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 ## 動作確認状況 - ローカルで確認 ## 補足 - 相談、参考資料などがあれば
This commit is contained in:
parent
e279957392
commit
a1a91207e4
@ -502,6 +502,32 @@
|
||||
"security": [{ "bearer": [] }]
|
||||
}
|
||||
},
|
||||
"/accounts/dealers": {
|
||||
"get": {
|
||||
"operationId": "getDealers",
|
||||
"summary": "",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "成功時のレスポンス",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "$ref": "#/components/schemas/GetDealersResponse" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "想定外のサーバーエラー",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "$ref": "#/components/schemas/ErrorResponse" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": ["accounts"]
|
||||
}
|
||||
},
|
||||
"/users/confirm": {
|
||||
"post": {
|
||||
"operationId": "confirmUser",
|
||||
@ -2120,6 +2146,28 @@
|
||||
"required": ["orderedAccountId", "poNumber"]
|
||||
},
|
||||
"IssueLicenseResponse": { "type": "object", "properties": {} },
|
||||
"Dealer": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": { "type": "number", "description": "アカウントID" },
|
||||
"name": { "type": "string", "description": "会社名" },
|
||||
"country": {
|
||||
"type": "string",
|
||||
"description": "国名(ISO 3166-1 alpha-2)"
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "country"]
|
||||
},
|
||||
"GetDealersResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dealers": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/components/schemas/Dealer" }
|
||||
}
|
||||
},
|
||||
"required": ["dealers"]
|
||||
},
|
||||
"ConfirmRequest": {
|
||||
"type": "object",
|
||||
"properties": { "token": { "type": "string" } },
|
||||
|
||||
@ -32,6 +32,7 @@ import {
|
||||
GetOrderHistoriesResponse,
|
||||
IssueLicenseRequest,
|
||||
IssueLicenseResponse,
|
||||
GetDealersResponse,
|
||||
} from './types/types';
|
||||
import { USER_ROLES, ADMIN_ROLES, TIERS } from '../../constants';
|
||||
import { AuthGuard } from '../../common/guards/auth/authguards';
|
||||
@ -412,4 +413,28 @@ export class AccountsController {
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@Get('/dealers')
|
||||
@ApiResponse({
|
||||
status: HttpStatus.OK,
|
||||
type: GetDealersResponse,
|
||||
description: '成功時のレスポンス',
|
||||
})
|
||||
@ApiResponse({
|
||||
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
description: '想定外のサーバーエラー',
|
||||
type: ErrorResponse,
|
||||
})
|
||||
@ApiOperation({ operationId: 'getDealers' })
|
||||
async getDealers(): Promise<GetDealersResponse> {
|
||||
return {
|
||||
dealers: [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Dealer1',
|
||||
country: 'US',
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,3 +234,16 @@ export class IssueLicenseRequest {
|
||||
}
|
||||
|
||||
export class IssueLicenseResponse {}
|
||||
|
||||
export class Dealer {
|
||||
@ApiProperty({ description: 'アカウントID' })
|
||||
id: number;
|
||||
@ApiProperty({ description: '会社名' })
|
||||
name: string;
|
||||
@ApiProperty({ description: '国名(ISO 3166-1 alpha-2)' })
|
||||
country: string;
|
||||
}
|
||||
export class GetDealersResponse {
|
||||
@ApiProperty({ type: [Dealer] })
|
||||
dealers: Dealer[];
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user