2022-11-16 09:05:26 +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-11-16 09:05:26 +00:00
|
|
|
. "github.com/xeronith/diamante/contracts/service"
|
|
|
|
)
|
|
|
|
|
|
|
|
func UpdateProfileByUserService(context IContext, input *UpdateProfileByUserRequest) (result *UpdateProfileByUserResult, err error) {
|
2023-06-12 05:53:39 +00:00
|
|
|
source := "update_profile_by_user"
|
|
|
|
/* //////// */ Conductor.LogRemoteCall(context, INIT, source, input, result, err)
|
|
|
|
defer func() { Conductor.LogRemoteCall(context, DONE, source, input, result, err) }()
|
2022-11-16 09:05:26 +00:00
|
|
|
|
2023-06-12 05:53:39 +00:00
|
|
|
commandResult, err := Conductor.UpdateProfileByUser(input.DisplayName, input.Avatar, input.Banner, input.Summary, input.Github, context.Identity())
|
|
|
|
if err != nil {
|
2022-11-16 09:05:26 +00:00
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
result = context.ResultContainer().(*UpdateProfileByUserResult)
|
2023-06-12 05:53:39 +00:00
|
|
|
result.DisplayName = commandResult.DisplayName()
|
|
|
|
result.Avatar = commandResult.Avatar()
|
|
|
|
result.Banner = commandResult.Banner()
|
|
|
|
result.Summary = commandResult.Summary()
|
|
|
|
result.Github = commandResult.Github()
|
2022-11-16 09:05:26 +00:00
|
|
|
return result, nil
|
|
|
|
}
|