go项目脚手架
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sorbet/internal/services/system/request/system_user_upsert_request.go

35 lines
787 B

1 year ago
package request
import (
"sorbet/internal/entities"
)
type SystemUserUpsertRequest struct {
ID int64 `json:"id" xml:"id" form:"id" path:"id"`
Username string `json:"username" xml:"username" form:"username"`
Password string `json:"password" xml:"password" form:"password"`
Status bool `json:"status" xml:"status" form:"status"`
}
func (s *SystemUserUpsertRequest) GetID() any {
return s.ID
}
func (s *SystemUserUpsertRequest) ToMap() map[string]any {
return map[string]any{
"id": s.ID,
"username": s.Username,
"password": s.Password,
"status": s.Status,
}
}
func (s *SystemUserUpsertRequest) ToEntity() any {
return &entities.SystemUser{
ID: s.ID,
Username: s.Username,
Password: s.Password,
Status: s.Status,
}
}