generated from VLADIMIR/template
add games operations
This commit is contained in:
@@ -12,7 +12,7 @@ func mapScenariosLight(
|
||||
) []*Scenario {
|
||||
res := make([]*Scenario, 0, len(o))
|
||||
for _, item := range o {
|
||||
res = append(res, mapScenarioLight(item, domain))
|
||||
res = append(res, MapScenarioLight(item, domain))
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -32,10 +32,13 @@ func mapScenarios(
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func mapScenarioLight(
|
||||
func MapScenarioLight(
|
||||
o *repos.Scenario,
|
||||
domain string,
|
||||
) *Scenario {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
return &Scenario{
|
||||
ID: o.ID,
|
||||
Name: o.Name,
|
||||
@@ -55,7 +58,7 @@ func mapScenario(
|
||||
o *repos.Scenario,
|
||||
domain string,
|
||||
) (*Scenario, error) {
|
||||
scenario := mapScenarioLight(o, domain)
|
||||
scenario := MapScenarioLight(o, domain)
|
||||
story, err := mapStory(o.Scenario, domain)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -75,7 +75,7 @@ func (s *ScenarioService) GetScenarioByID(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return mapScenarioLight(scenario, s.domain), nil
|
||||
return MapScenarioLight(scenario, s.domain), nil
|
||||
}
|
||||
|
||||
func (s *ScenarioService) UpdateScenarioByID(
|
||||
|
||||
Reference in New Issue
Block a user