From 17dace7edf59daa90bca74a3f310fe20daef25ff Mon Sep 17 00:00:00 2001 From: Sinh Date: Fri, 18 Nov 2022 10:24:06 +0700 Subject: [PATCH] remove err method email --- client/email.go | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/client/email.go b/client/email.go index 0de10e1..7725884 100644 --- a/client/email.go +++ b/client/email.go @@ -1,13 +1,5 @@ package client -import ( - "encoding/json" - "errors" - "git.selly.red/Selly-Modules/natsio" - "git.selly.red/Selly-Modules/natsio/model" - "git.selly.red/Selly-Modules/natsio/subject" -) - // Email ... type Email struct{} @@ -16,23 +8,23 @@ func GetEmail() Email { return Email{} } -func (s Email) Send(p model.GetEmailRequest) ([]*model.ResponseEmailInfo, error) { - msg, err := natsio.GetServer().Request(subject.Email.GetListEmailInfo, toBytes(p)) - if err != nil { - return nil, err - } - - var r struct { - Data []*model.ResponseEmailInfo `json:"data"` - Error string `json:"error"` - } - - if err := json.Unmarshal(msg.Data, &r); err != nil { - return nil, err - } - if r.Error != "" { - return nil, errors.New(r.Error) - } - - return r.Data, nil -} +// func (s Email) Send(p model.GetEmailRequest) ([]*model.ResponseEmailInfo, error) { +// msg, err := natsio.GetServer().Request(subject.Email.GetListEmailInfo, toBytes(p)) +// if err != nil { +// return nil, err +// } +// +// var r struct { +// Data []*model.ResponseEmailInfo `json:"data"` +// Error string `json:"error"` +// } +// +// if err := json.Unmarshal(msg.Data, &r); err != nil { +// return nil, err +// } +// if r.Error != "" { +// return nil, errors.New(r.Error) +// } +// +// return r.Data, nil +// }