2022-12-22 16:46:08 +00:00
|
|
|
package services
|
|
|
|
|
|
|
|
import (
|
2023-04-21 06:49:17 +00:00
|
|
|
. "github.com/reiver/greatape/components/api/protobuf"
|
|
|
|
. "github.com/reiver/greatape/components/contracts"
|
2023-06-12 05:53:39 +00:00
|
|
|
. "github.com/reiver/greatape/components/core"
|
2022-12-22 16:46:08 +00:00
|
|
|
. "github.com/xeronith/diamante/contracts/service"
|
|
|
|
)
|
|
|
|
|
|
|
|
func PostToInboxService(context IContext, input *PostToInboxRequest) (result *PostToInboxResult, err error) {
|
2023-06-12 05:53:39 +00:00
|
|
|
source := "post_to_inbox"
|
|
|
|
/* //////// */ Conductor.LogRemoteCall(context, INIT, source, input, result, err)
|
|
|
|
defer func() { Conductor.LogRemoteCall(context, DONE, source, input, result, err) }()
|
2022-12-22 16:46:08 +00:00
|
|
|
|
2023-06-12 05:53:39 +00:00
|
|
|
commandResult, err := Conductor.PostToInbox(input.Username, input.Body, context.Identity())
|
|
|
|
if err != nil {
|
2022-12-22 16:46:08 +00:00
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
result = context.ResultContainer().(*PostToInboxResult)
|
2023-06-12 05:53:39 +00:00
|
|
|
result.Body = commandResult.Body()
|
2022-12-22 16:46:08 +00:00
|
|
|
return result, nil
|
|
|
|
}
|