feat: update users request createdbyid
This commit is contained in:
parent
0df57b40a7
commit
cf1003267c
|
|
@ -53,20 +53,36 @@ type ArticlesUpdateRequest struct {
|
||||||
CategoryId int `json:"categoryId" validate:"required"`
|
CategoryId int `json:"categoryId" validate:"required"`
|
||||||
TypeId int `json:"typeId" validate:"required"`
|
TypeId int `json:"typeId" validate:"required"`
|
||||||
Tags string `json:"tags" validate:"required"`
|
Tags string `json:"tags" validate:"required"`
|
||||||
|
CreatedById *uint `json:"createdById"`
|
||||||
StatusId *int `json:"statusId"`
|
StatusId *int `json:"statusId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req ArticlesUpdateRequest) ToEntity() *entity.Articles {
|
func (req ArticlesUpdateRequest) ToEntity() *entity.Articles {
|
||||||
return &entity.Articles{
|
if req.CreatedById == nil {
|
||||||
Title: req.Title,
|
return &entity.Articles{
|
||||||
Slug: req.Slug,
|
Title: req.Title,
|
||||||
Description: req.Description,
|
Slug: req.Slug,
|
||||||
HtmlDescription: req.HtmlDescription,
|
Description: req.Description,
|
||||||
CategoryId: req.CategoryId,
|
HtmlDescription: req.HtmlDescription,
|
||||||
TypeId: req.TypeId,
|
CategoryId: req.CategoryId,
|
||||||
Tags: req.Tags,
|
TypeId: req.TypeId,
|
||||||
StatusId: req.StatusId,
|
Tags: req.Tags,
|
||||||
UpdatedAt: time.Now(),
|
StatusId: req.StatusId,
|
||||||
|
UpdatedAt: time.Now(),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return &entity.Articles{
|
||||||
|
Title: req.Title,
|
||||||
|
Slug: req.Slug,
|
||||||
|
Description: req.Description,
|
||||||
|
HtmlDescription: req.HtmlDescription,
|
||||||
|
CategoryId: req.CategoryId,
|
||||||
|
TypeId: req.TypeId,
|
||||||
|
Tags: req.Tags,
|
||||||
|
StatusId: req.StatusId,
|
||||||
|
CreatedById: req.CreatedById,
|
||||||
|
UpdatedAt: time.Now(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5402,6 +5402,9 @@ const docTemplate = `{
|
||||||
"categoryId": {
|
"categoryId": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"createdById": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -5765,22 +5768,13 @@ const docTemplate = `{
|
||||||
"request.UsersCreateRequest": {
|
"request.UsersCreateRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"address",
|
|
||||||
"dateOfBirth",
|
|
||||||
"email",
|
"email",
|
||||||
"fullname",
|
"fullname",
|
||||||
"genderType",
|
|
||||||
"identityGroup",
|
|
||||||
"identityGroupNumber",
|
|
||||||
"identityNumber",
|
|
||||||
"identityType",
|
|
||||||
"lastEducation",
|
|
||||||
"password",
|
"password",
|
||||||
"phoneNumber",
|
"phoneNumber",
|
||||||
"userLevelId",
|
"userLevelId",
|
||||||
"userRoleId",
|
"userRoleId",
|
||||||
"username",
|
"username"
|
||||||
"workType"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"address": {
|
"address": {
|
||||||
|
|
@ -5836,21 +5830,13 @@ const docTemplate = `{
|
||||||
"request.UsersUpdateRequest": {
|
"request.UsersUpdateRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"address",
|
|
||||||
"dateOfBirth",
|
|
||||||
"email",
|
"email",
|
||||||
"fullname",
|
"fullname",
|
||||||
"genderType",
|
"password",
|
||||||
"identityGroup",
|
|
||||||
"identityGroupNumber",
|
|
||||||
"identityNumber",
|
|
||||||
"identityType",
|
|
||||||
"lastEducation",
|
|
||||||
"phoneNumber",
|
"phoneNumber",
|
||||||
"userLevelId",
|
"userLevelId",
|
||||||
"userRoleId",
|
"userRoleId",
|
||||||
"username",
|
"username"
|
||||||
"workType"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"address": {
|
"address": {
|
||||||
|
|
@ -5883,6 +5869,9 @@ const docTemplate = `{
|
||||||
"lastEducation": {
|
"lastEducation": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"password": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"phoneNumber": {
|
"phoneNumber": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5391,6 +5391,9 @@
|
||||||
"categoryId": {
|
"categoryId": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"createdById": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -5754,22 +5757,13 @@
|
||||||
"request.UsersCreateRequest": {
|
"request.UsersCreateRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"address",
|
|
||||||
"dateOfBirth",
|
|
||||||
"email",
|
"email",
|
||||||
"fullname",
|
"fullname",
|
||||||
"genderType",
|
|
||||||
"identityGroup",
|
|
||||||
"identityGroupNumber",
|
|
||||||
"identityNumber",
|
|
||||||
"identityType",
|
|
||||||
"lastEducation",
|
|
||||||
"password",
|
"password",
|
||||||
"phoneNumber",
|
"phoneNumber",
|
||||||
"userLevelId",
|
"userLevelId",
|
||||||
"userRoleId",
|
"userRoleId",
|
||||||
"username",
|
"username"
|
||||||
"workType"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"address": {
|
"address": {
|
||||||
|
|
@ -5825,21 +5819,13 @@
|
||||||
"request.UsersUpdateRequest": {
|
"request.UsersUpdateRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"address",
|
|
||||||
"dateOfBirth",
|
|
||||||
"email",
|
"email",
|
||||||
"fullname",
|
"fullname",
|
||||||
"genderType",
|
"password",
|
||||||
"identityGroup",
|
|
||||||
"identityGroupNumber",
|
|
||||||
"identityNumber",
|
|
||||||
"identityType",
|
|
||||||
"lastEducation",
|
|
||||||
"phoneNumber",
|
"phoneNumber",
|
||||||
"userLevelId",
|
"userLevelId",
|
||||||
"userRoleId",
|
"userRoleId",
|
||||||
"username",
|
"username"
|
||||||
"workType"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"address": {
|
"address": {
|
||||||
|
|
@ -5872,6 +5858,9 @@
|
||||||
"lastEducation": {
|
"lastEducation": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"password": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"phoneNumber": {
|
"phoneNumber": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,8 @@ definitions:
|
||||||
properties:
|
properties:
|
||||||
categoryId:
|
categoryId:
|
||||||
type: integer
|
type: integer
|
||||||
|
createdById:
|
||||||
|
type: integer
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
htmlDescription:
|
htmlDescription:
|
||||||
|
|
@ -413,22 +415,13 @@ definitions:
|
||||||
workType:
|
workType:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- address
|
|
||||||
- dateOfBirth
|
|
||||||
- email
|
- email
|
||||||
- fullname
|
- fullname
|
||||||
- genderType
|
|
||||||
- identityGroup
|
|
||||||
- identityGroupNumber
|
|
||||||
- identityNumber
|
|
||||||
- identityType
|
|
||||||
- lastEducation
|
|
||||||
- password
|
- password
|
||||||
- phoneNumber
|
- phoneNumber
|
||||||
- userLevelId
|
- userLevelId
|
||||||
- userRoleId
|
- userRoleId
|
||||||
- username
|
- username
|
||||||
- workType
|
|
||||||
type: object
|
type: object
|
||||||
request.UsersUpdateRequest:
|
request.UsersUpdateRequest:
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -452,6 +445,8 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
lastEducation:
|
lastEducation:
|
||||||
type: string
|
type: string
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
phoneNumber:
|
phoneNumber:
|
||||||
type: string
|
type: string
|
||||||
statusId:
|
statusId:
|
||||||
|
|
@ -465,21 +460,13 @@ definitions:
|
||||||
workType:
|
workType:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- address
|
|
||||||
- dateOfBirth
|
|
||||||
- email
|
- email
|
||||||
- fullname
|
- fullname
|
||||||
- genderType
|
- password
|
||||||
- identityGroup
|
|
||||||
- identityGroupNumber
|
|
||||||
- identityNumber
|
|
||||||
- identityType
|
|
||||||
- lastEducation
|
|
||||||
- phoneNumber
|
- phoneNumber
|
||||||
- userLevelId
|
- userLevelId
|
||||||
- userRoleId
|
- userRoleId
|
||||||
- username
|
- username
|
||||||
- workType
|
|
||||||
type: object
|
type: object
|
||||||
response.BadRequestError:
|
response.BadRequestError:
|
||||||
properties:
|
properties:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue