Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oapi-codegenを使う #166

Merged
merged 34 commits into from
Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bff28da
:books: Fix openapi
ras0q Nov 2, 2021
6879970
:recycle: Generate from oapi-codegen
ras0q Nov 2, 2021
3a207cb
:recycle: optional.HogeFrom関数の引数をポインタ型にする
ras0q Nov 3, 2021
8c8f3f9
:bug: hogeIDInPathをPublicにする
ras0q Nov 3, 2021
6a198b0
:wrench: Use go generate
ras0q Nov 7, 2021
c241551
Merge branch 'main' into refactor/use-oapi-codegen
ras0q Nov 7, 2021
ddf0c22
:recycle: append to assign
ras0q Nov 7, 2021
d2fc96d
:boom: EventLevel,Hostnameをrequiredにする
ras0q Nov 7, 2021
23adf3a
:wrench: Remove convertToProjectMembers
ras0q Nov 7, 2021
a6457ff
:green_heart: Fix test
ras0q Nov 7, 2021
eddbd1b
:green_heart: Test PostContest
ras0q Nov 7, 2021
7394859
:recycle: swaggerとdomainの定義を合わせる
ras0q Nov 7, 2021
0a58fc4
:construction: constructer実装
ras0q Nov 8, 2021
b9e24ac
:sparkles: contestのコンストラクタ
ras0q Nov 8, 2021
0f64479
Revert ":recycle: optional.HogeFrom関数の引数をポインタ型にする"
ras0q Nov 10, 2021
9f70243
Merge branch 'main' into feat/oapi-codegen
ras0q Nov 10, 2021
b26e360
:recycle: openapi更新に伴うフィールドの型の変更
ras0q Nov 10, 2021
d5ca75f
:bug: optionalかけ忘れ、Fix nil pointer
ras0q Nov 10, 2021
37e8d56
:sparkles: constructorを使う
ras0q Nov 10, 2021
88298ce
:fire: Remove time.Time
ras0q Nov 11, 2021
6f71524
Merge branch 'main' into feat/oapi-codegen
ras0q Nov 13, 2021
6616b5b
:recycle: Remove CreatedAt
ras0q Nov 13, 2021
da8a36e
:boom: Add require & pass test
ras0q Nov 13, 2021
89c9c5b
:fire: レスポンスで使う構造体のvalidate:urlタグを削除
ras0q Nov 16, 2021
32b5627
Merge branch 'main' into feat/oapi-codegen
ras0q Nov 18, 2021
03a7291
:bug: Resolve merge errors
ras0q Nov 18, 2021
b660e33
:recycle: optional.StringFromなどの引数をポインタ型にする
ras0q Nov 19, 2021
ea4ac5c
:recycle: Use ValueOrZero()
ras0q Nov 19, 2021
830d0fe
:shirt: Lint
ras0q Nov 19, 2021
0e4c552
Merge branch 'main' into feat/oapi-codegen
ras0q Dec 16, 2021
d14d8ec
:bug: Fix merge error
ras0q Dec 16, 2021
84da8c0
Merge branch 'main' into feat/oapi-codegen
ras0q Dec 27, 2021
0d87cdb
:bug: Fix conflict bugs
ras0q Dec 27, 2021
c281898
:recycle: Use constructor
ras0q Dec 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .oapi.types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output: types_gen.go
generate:
- types
package: handler
48 changes: 46 additions & 2 deletions docs/swagger/traPortfolio.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ components:
type: string
description: ユーザーUUID
format: uuid
x-go-type: uuid.UUID
name:
type: string
pattern: '^[a-zA-Z0-9_-]{1,32}$'
Expand All @@ -762,6 +763,7 @@ components:
required:
- id
- name
- realName
UserAccountState:
type: integer
title: UserAccountState
Expand Down Expand Up @@ -803,9 +805,7 @@ components:
items:
$ref: '#/components/schemas/Account'
required:
- id
- state
- name
- bio
- accounts
EditUser:
Expand All @@ -829,6 +829,11 @@ components:
description: アカウントへのリンク
properties:
id:
type: string
description: アカウントUUID
format: uuid
x-go-type: uuid.UUID
name:
type: string
description: アカウントID
type:
Expand All @@ -840,6 +845,7 @@ components:
description: アカウントurl
required:
- id
- name
- type
- prPermitted
- url
Expand Down Expand Up @@ -877,6 +883,7 @@ components:
- Qiita (@は含まない)
- AtCoder
- SoundCloud
x-go-type: int64
Project:
title: Project
type: object
Expand All @@ -885,6 +892,7 @@ components:
id:
type: string
format: uuid
x-go-type: uuid.UUID
description: プロジェクトuuid
name:
type: string
Expand Down Expand Up @@ -934,6 +942,7 @@ components:
items:
$ref: '#/components/schemas/ProjectMember'
required:
- link
- description
- members
ProjectMember:
Expand Down Expand Up @@ -962,6 +971,7 @@ components:
id:
type: string
format: uuid
x-go-type: uuid.UUID
description: イベントuuid
name:
type: string
Expand Down Expand Up @@ -997,6 +1007,8 @@ components:
required:
- description
- place
- hostname
- eventLevel
type: object
Contest:
title: Contest
Expand All @@ -1006,6 +1018,7 @@ components:
id:
type: string
format: uuid
x-go-type: uuid.UUID
description: コンテストuuid
name:
type: string
Expand Down Expand Up @@ -1038,6 +1051,7 @@ components:
items:
$ref: '#/components/schemas/ContestTeam'
required:
- link
- description
- teams
ContestTeam:
Expand All @@ -1048,6 +1062,7 @@ components:
id:
type: string
format: uuid
x-go-type: uuid.UUID
description: コンテストチームuuid
name:
type: string
Expand All @@ -1058,6 +1073,7 @@ components:
required:
- id
- name
- result
ContestTeamDetail:
title: ContestTeamDetail
type: object
Expand All @@ -1079,6 +1095,7 @@ components:
items:
$ref: '#/components/schemas/User'
required:
- link
- description
- members
ContestTeamWithContestName:
Expand All @@ -1102,6 +1119,7 @@ components:
id:
type: string
format: uuid
x-go-type: uuid.UUID
description: 班uuid
name:
type: string
Expand Down Expand Up @@ -1149,6 +1167,7 @@ components:
type: string
description: 班説明
required:
- link
- leader
- members
- description
Expand Down Expand Up @@ -1183,6 +1202,8 @@ components:
type: string
format: uri
description: プロジェクトの詳細が載っているページへのリンク
x-oapi-codegen-extra-tags:
validate: url
description:
type: string
description: プロジェクト説明
Expand All @@ -1206,6 +1227,8 @@ components:
type: string
format: uri
description: プロジェクトの詳細が載っているページへのリンク
x-oapi-codegen-extra-tags:
validate: url
description:
type: string
description: プロジェクト説明
Expand All @@ -1223,6 +1246,8 @@ components:
type: string
format: uri
description: コンテストの詳細が載っているページへのリンク
x-oapi-codegen-extra-tags:
validate: url
description:
type: string
description: コンテスト説明
Expand All @@ -1245,6 +1270,8 @@ components:
type: string
format: uri
description: コンテストの詳細が載っているページへのリンク
x-oapi-codegen-extra-tags:
validate: url
description:
type: string
description: コンテスト説明
Expand All @@ -1263,6 +1290,8 @@ components:
type: string
format: uri
description: コンテストチームの説明が載っているページへのリンク
x-oapi-codegen-extra-tags:
validate: url
description:
type: string
description: チーム情報
Expand All @@ -1284,6 +1313,8 @@ components:
type: string
format: uri
description: コンテストチームの説明が載っているページへのリンク
x-oapi-codegen-extra-tags:
validate: url
description:
type: string
description: チーム情報
Expand Down Expand Up @@ -1394,6 +1425,7 @@ components:
userId:
type: string
format: uuid
x-go-type: uuid.UUID
duration:
$ref: '#/components/schemas/ProjectDuration'
required:
Expand All @@ -1410,6 +1442,7 @@ components:
items:
type: string
format: uuid
x-go-type: uuid.UUID
required:
- members
AddAccount:
Expand All @@ -1425,6 +1458,8 @@ components:
type: string
description: アカウントurl
format: uri
x-oapi-codegen-extra-tags:
validate: url
id:
type: string
description: アカウントID
Expand All @@ -1446,6 +1481,8 @@ components:
type: string
description: アカウントurl
format: uri
x-oapi-codegen-extra-tags:
validate: url
id:
type: string
description: アカウントID
Expand All @@ -1462,6 +1499,7 @@ components:
schema:
type: string
format: uuid
x-go-type: uuid.UUID
groupIdInPath:
name: groupId
in: path
Expand All @@ -1470,6 +1508,7 @@ components:
schema:
type: string
format: uuid
x-go-type: uuid.UUID
projectIdInPath:
name: projectId
in: path
Expand All @@ -1478,6 +1517,7 @@ components:
schema:
type: string
format: uuid
x-go-type: uuid.UUID
eventIdInPath:
name: eventId
in: path
Expand All @@ -1486,6 +1526,7 @@ components:
schema:
type: string
format: uuid
x-go-type: uuid.UUID
contestIdInPath:
name: contestId
in: path
Expand All @@ -1494,6 +1535,7 @@ components:
schema:
type: string
format: uuid
x-go-type: uuid.UUID
teamIdInPath:
name: teamId
in: path
Expand All @@ -1502,12 +1544,14 @@ components:
schema:
type: string
format: uuid
x-go-type: uuid.UUID
accountIdInPath:
name: accountId
in: path
schema:
type: string
format: uuid
x-go-type: uuid.UUID
description: アカウントUUID
required: true
tags:
Expand Down
2 changes: 0 additions & 2 deletions domain/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ type Project struct {
Description string
Link string
Members []*ProjectMember
CreatedAt time.Time
UpdatedAt time.Time
}

type ProjectMember struct {
Expand Down
2 changes: 2 additions & 0 deletions domain/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ type User struct {

type Account struct {
ID uuid.UUID
Name string
Type uint
PrPermitted bool
URL string
}

type UserDetail struct {
Expand Down