Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
45af26fd
Commit
45af26fd
authored
1 year ago
by
Valera Shaitorov
Browse files
Options
Downloads
Patches
Plain Diff
Добавлены пропущенные функции в пакет Items
parent
5692d7e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
perxis-proto
+1
-1
1 addition, 1 deletion
perxis-proto
pkg/items/service.go
+22
-0
22 additions, 0 deletions
pkg/items/service.go
with
23 additions
and
1 deletion
perxis-proto
@
f000812a
Compare
8606df02
...
f000812a
Subproject commit
8606df02e0df6807e503bf22471a295020a47fba
Subproject commit
f000812a1eef24093c0d0abf1318e3179b679773
This diff is collapsed.
Click to expand it.
pkg/items/service.go
+
22
−
0
View file @
45af26fd
...
...
@@ -149,3 +149,25 @@ func EncodeAggregateResult(ctx context.Context, request map[string]string, r map
return
result
,
nil
}
func
CreateAndPublishItem
(
ctx
context
.
Context
,
items
Items
,
item
*
Item
)
error
{
var
err
error
if
item
,
err
=
items
.
Create
(
ctx
,
item
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"create item"
)
}
if
err
=
items
.
Publish
(
ctx
,
item
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"publish item"
)
}
return
nil
}
func
UpdateAndPublishItem
(
ctx
context
.
Context
,
items
Items
,
item
*
Item
)
error
{
var
err
error
if
err
=
items
.
Update
(
ctx
,
item
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"update item"
)
}
if
err
=
items
.
Publish
(
ctx
,
item
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"publish item"
)
}
return
nil
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment