From d0a5e5fb0b425b373d3ac191539b4f1f75821601 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Sat, 25 Mar 2023 01:23:15 +0300 Subject: [PATCH] move domains in back repo --- domain/domain.go | 45 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/domain/domain.go b/domain/domain.go index 86002d3..1978d42 100644 --- a/domain/domain.go +++ b/domain/domain.go @@ -1,31 +1,10 @@ package domain -import ( - "errors" -) +// type Domains []SkirdaDomain -type SkirdaDomain struct { - DomainId string `json:"domainId"` - Users []SkirdaDomainUser `json:"users"` - Games []string `json:"games"` - Events []string `json:"events"` -} - -type SkirdaDomainUser struct { - SkirdaUserId string `json:"skirdauserid"` - RolesId []string `json:"rolesid"` -} - -//func (domain SkirdaDomain) BuildDomain(newGames []SkirdaGame, newSessions []SkirdaSession) { -// domain.AddGames(newGames) -// // domain.AddSessions(newSessions) -//} - -type Domains []SkirdaDomain - -func (domains Domains) Set(newDomains []SkirdaDomain) { - domains = append([]SkirdaDomain{}, newDomains...) -} +// func (domains Domains) Set(newDomains []SkirdaDomain) { +// domains = append([]SkirdaDomain{}, newDomains...) +// } //func (domains Domains) FindGameByID(gameId string) (SkirdaGame, error) { // for _, domain := range domains { @@ -54,11 +33,11 @@ func (domains Domains) Set(newDomains []SkirdaDomain) { // return plainSessions // } -func (domains Domains) FindDomain(domainId string) (SkirdaDomain, error) { - for _, domain := range domains { - if domain.DomainId == domainId { - return domain, nil - } - } - return SkirdaDomain{}, errors.New("not any domain founded") -} +// func (domains Domains) FindDomain(domainId string) (SkirdaDomain, error) { +// for _, domain := range domains { +// if domain.DomainId == domainId { +// return domain, nil +// } +// } +// return SkirdaDomain{}, errors.New("not any domain founded") +// }