dto

package
v0.0.0-...-bef4ad1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []string, item string) bool

Contains test slice contain string

Types

type ImgUploadToken

type ImgUploadToken struct {
	Token   string `json:"token"`
	FileKey string `json:"file_key"`
}

type LoginUserInfo

type LoginUserInfo struct {
	ID    primitive.ObjectID `json:"id" example:"xxxxxxxxxxxxx==" `
	Name  string             `json:"name" example:"account name"`
	Email string             `json:"email" example:"email@qq.com"`
	Roles []model.Erole      `json:"roles" example:"ordinaryUser" `
}

todo implement error

func Account2SuccessLogin

func Account2SuccessLogin(a model.Account) (s LoginUserInfo)

func (LoginUserInfo) IsInRole

func (t LoginUserInfo) IsInRole(role string) bool

func (LoginUserInfo) IsUserInRole

func (user LoginUserInfo) IsUserInRole(role model.Erole) bool

type RelateEntity2Entity

type RelateEntity2Entity struct {
	RelatedID  primitive.ObjectID `json:"related_id,omitempty"`
	RelateToID primitive.ObjectID `json:"relateTo_id,omitempty"`
}

RelateEntity2Entity 将单实体关联到单实体dto

type RelateEntity2EntitySet

type RelateEntity2EntitySet struct {
	RelatedID   primitive.ObjectID   `json:"related_id,omitempty"`
	RelateToIDs []primitive.ObjectID `json:"relateTo_ids,omitempty"`
}

RelateEntity2EntitySet 关联单实体到多实体集dto

type RelateEntitySet2Entity

type RelateEntitySet2Entity struct {
	RelatedIDs []primitive.ObjectID `json:"related_ids,omitempty"`
	RelateToID primitive.ObjectID   `json:"relateTo_id,omitempty"`
}

RelateEntitySet2Entity 关联实体集到单实体dto

type RelateEntitySet2EntitySet

type RelateEntitySet2EntitySet struct {
	RelatedIDs  []primitive.ObjectID `json:"related_ids,omitempty"`
	RelateToIDs []primitive.ObjectID `json:"relateTo_ids,omitempty"`
}

RelateEntitySet2EntitySet 关联两个实体集dto

type ScoreReq

type ScoreReq struct {
	Score  float64
	Target primitive.ObjectID
}

type UserInfo

type UserInfo struct {
	ID       primitive.ObjectID `json:"id" example:"xxxxxxxxxxxxx=="`
	Name     string             `json:"name" example:"account name"`
	Email    string             `json:"email" example:"email@qq.com"`
	Roles    []model.Erole      `json:"roles" example:"ordinaryUser"  `
	Settings map[string]string  `` /* 127-byte string literal not displayed */
}

func Account2UserPublicInfo

func Account2UserPublicInfo(a model.Account) (u UserInfo)

type UserInfoBrief

type UserInfoBrief struct {
	ID       primitive.ObjectID `json:"id" example:"xxxxxxxxxxxxx==" bson:"_id"`
	Name     string             `json:"name" example:"account name" bson:"username"`
	Email    string             `json:"email" example:"email@qq.com"`
	Settings map[string]string  `` /* 127-byte string literal not displayed */
}

func MapAccount2InfoBrief

func MapAccount2InfoBrief(a model.Account) (b UserInfoBrief)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL