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