user.go 753 字节
package transform

import (
	"gitlab.fjmaimaimai.com/mmm-go-pp/partner01/pkg/domain"
	"gitlab.fjmaimaimai.com/mmm-go-pp/partner01/pkg/infrastructure/pg/models"
)

func TransformToUserDomainModelFromPgModels(userModel *models.User) (*domain.User, error) {
	return &domain.User{
		UserId:         userModel.UserId,
		UserType:       userModel.UserType,
		Permissions:    userModel.Permissions,
		CompanyId:      userModel.CompanyId,
		UserInfo:       userModel.UserInfo,
		PartnerInfo:    userModel.PartnerInfo,
		Status:         userModel.Status,
		AdminType:      userModel.AdminType,
		AccessPartners: userModel.AccessPartners,
		CreateAt:       userModel.CreateAt,
		UpdateAt:       userModel.UpdateAt,
		DeleteAt:       userModel.DeleteAt,
	}, nil
}