登录功能完成
This commit is contained in:
18
pkg/dto/user.go
Normal file
18
pkg/dto/user.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"mc-client-updater-server/pkg/dao/entity"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
Username string
|
||||
Roles []string
|
||||
}
|
||||
|
||||
func UserEntity2DTO(user *entity.User) *User {
|
||||
return &User{
|
||||
Username: user.Username,
|
||||
Roles: strings.Split(user.Roles, ","),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user