From fa027815ea2ec021551ac21cb338e57e0649aa42 Mon Sep 17 00:00:00 2001 From: Sarah Kim <64837162+bonjuruu@users.noreply.github.com> Date: Sun, 16 Feb 2025 15:30:13 +1300 Subject: [PATCH] Feat/add updated at (#10) --- .github/workflows/auto_tag.yml | 2 +- go-client/api/openapi.yaml | 5 +++++ go-client/docs/IUserDTO.md | 23 ++++++++++++++++++++++- go-client/model_i_user_dto.go | 31 ++++++++++++++++++++++++++++++- openapi.yml | 5 ++++- typescript-client/api.ts | 6 ++++++ 6 files changed, 68 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto_tag.yml b/.github/workflows/auto_tag.yml index 27d052c..1b34745 100644 --- a/.github/workflows/auto_tag.yml +++ b/.github/workflows/auto_tag.yml @@ -1,4 +1,4 @@ -name: Auto Tag on Merge +name: On Merge on: push: diff --git a/go-client/api/openapi.yaml b/go-client/api/openapi.yaml index eb09feb..1335070 100644 --- a/go-client/api/openapi.yaml +++ b/go-client/api/openapi.yaml @@ -275,6 +275,7 @@ components: id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 email: email username: username + updatedAt: updatedAt properties: id: description: User id. @@ -292,11 +293,15 @@ components: createdAt: description: User creation date. type: string + updatedAt: + description: User update date. + type: string required: - createdAt - email - id - role + - updatedAt - username type: object ICreatePostRequestDTO: diff --git a/go-client/docs/IUserDTO.md b/go-client/docs/IUserDTO.md index 0d0e612..5dfec0c 100644 --- a/go-client/docs/IUserDTO.md +++ b/go-client/docs/IUserDTO.md @@ -9,12 +9,13 @@ Name | Type | Description | Notes **Email** | **string** | User email. | **Role** | [**IUserRoleEnum**](IUserRoleEnum.md) | | **CreatedAt** | **string** | User creation date. | +**UpdatedAt** | **string** | User update date. | ## Methods ### NewIUserDTO -`func NewIUserDTO(id string, username string, email string, role IUserRoleEnum, createdAt string, ) *IUserDTO` +`func NewIUserDTO(id string, username string, email string, role IUserRoleEnum, createdAt string, updatedAt string, ) *IUserDTO` NewIUserDTO instantiates a new IUserDTO object This constructor will assign default values to properties that have it defined, @@ -129,6 +130,26 @@ and a boolean to check if the value has been set. SetCreatedAt sets CreatedAt field to given value. +### GetUpdatedAt + +`func (o *IUserDTO) GetUpdatedAt() string` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *IUserDTO) GetUpdatedAtOk() (*string, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *IUserDTO) SetUpdatedAt(v string)` + +SetUpdatedAt sets UpdatedAt field to given value. + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/go-client/model_i_user_dto.go b/go-client/model_i_user_dto.go index 7a1140e..c734dc1 100644 --- a/go-client/model_i_user_dto.go +++ b/go-client/model_i_user_dto.go @@ -30,6 +30,8 @@ type IUserDTO struct { Role IUserRoleEnum `json:"role"` // User creation date. CreatedAt string `json:"createdAt"` + // User update date. + UpdatedAt string `json:"updatedAt"` } type _IUserDTO IUserDTO @@ -38,13 +40,14 @@ type _IUserDTO IUserDTO // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIUserDTO(id string, username string, email string, role IUserRoleEnum, createdAt string) *IUserDTO { +func NewIUserDTO(id string, username string, email string, role IUserRoleEnum, createdAt string, updatedAt string) *IUserDTO { this := IUserDTO{} this.Id = id this.Username = username this.Email = email this.Role = role this.CreatedAt = createdAt + this.UpdatedAt = updatedAt return &this } @@ -176,6 +179,30 @@ func (o *IUserDTO) SetCreatedAt(v string) { o.CreatedAt = v } +// GetUpdatedAt returns the UpdatedAt field value +func (o *IUserDTO) GetUpdatedAt() string { + if o == nil { + var ret string + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *IUserDTO) GetUpdatedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *IUserDTO) SetUpdatedAt(v string) { + o.UpdatedAt = v +} + func (o IUserDTO) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -191,6 +218,7 @@ func (o IUserDTO) ToMap() (map[string]interface{}, error) { toSerialize["email"] = o.Email toSerialize["role"] = o.Role toSerialize["createdAt"] = o.CreatedAt + toSerialize["updatedAt"] = o.UpdatedAt return toSerialize, nil } @@ -204,6 +232,7 @@ func (o *IUserDTO) UnmarshalJSON(data []byte) (err error) { "email", "role", "createdAt", + "updatedAt", } allProperties := make(map[string]interface{}) diff --git a/openapi.yml b/openapi.yml index 096a597..821dfc6 100644 --- a/openapi.yml +++ b/openapi.yml @@ -249,7 +249,7 @@ components: IUserDTO: type: object - required: [id, username, email, role, createdAt] + required: [id, username, email, role, createdAt, updatedAt] properties: id: type: string @@ -268,6 +268,9 @@ components: createdAt: type: string description: User creation date. + updatedAt: + type: string + description: User update date. # request ICreatePostRequestDTO: diff --git a/typescript-client/api.ts b/typescript-client/api.ts index 1ea74e6..6bd50d2 100644 --- a/typescript-client/api.ts +++ b/typescript-client/api.ts @@ -214,6 +214,12 @@ export interface IUserDTO { * @memberof IUserDTO */ 'createdAt': string; + /** + * User update date. + * @type {string} + * @memberof IUserDTO + */ + 'updatedAt': string; }