DriveLinked/pkg/dto/user.go

35 lines
663 B
Go

package dto
import (
"drive-linked/pkg/model"
"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
}
type QueryUserParams struct {
Method string `json:"method"`
Value string `json:"value"`
}
type LoginParams struct {
Account string `json:"account"`
Password string `json:"password"`
}