DriveLinked/pkg/dto/user.go

35 lines
663 B
Go
Raw Normal View History

2022-04-03 12:30:50 +08:00
package dto
import (
2022-04-09 11:48:44 +08:00
"drive-linked/pkg/model"
2022-04-03 12:30:50 +08:00
"github.com/jinzhu/copier"
)
type UserProfile struct {
Id int64 `json:"id,string"`
Name string `json:"name"`
Nickname string `json:"nickname"`
Email string `json:"email"`
Status int32 `json:"status"`
Avatar string `json:"avatar"`
Roles string `json:"roles"`
}
func (u *UserProfile) CopyOf(user *model.User) error {
err := copier.Copy(u, user)
if err != nil {
return err
}
return nil
}
2022-04-09 11:48:44 +08:00
type QueryUserParams struct {
Method string `json:"method"`
Value string `json:"value"`
}
type LoginParams struct {
Account string `json:"account"`
Password string `json:"password"`
}