Start work on populating context of communication at API layer
Remove communication stub, it's a performance enhancement.
This commit is contained in:
parent
266004624d
commit
e569bb32b7
9 changed files with 331 additions and 119 deletions
35
resource/email.go
Normal file
35
resource/email.go
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package resource
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
//modelpublic "github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/model"
|
||||
//modelpublicreport "github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/publicreport/model"
|
||||
nhttp "github.com/Gleipnir-Technology/nidus-sync/http"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/platform"
|
||||
//"github.com/gorilla/mux"
|
||||
//"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
type emailR struct {
|
||||
router *router
|
||||
}
|
||||
|
||||
func Email(r *router) *emailR {
|
||||
return &emailR{
|
||||
router: r,
|
||||
}
|
||||
}
|
||||
|
||||
type email struct {
|
||||
ID int
|
||||
}
|
||||
|
||||
func (res *emailR) Get(ctx context.Context, r *http.Request, user platform.User, query QueryParams) (email, *nhttp.ErrorWithStatus) {
|
||||
email_id, error_with_status := res.router.IDFromMux(r)
|
||||
if error_with_status != nil {
|
||||
return email{}, error_with_status
|
||||
}
|
||||
return email{ID: email_id}, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue