2026-05-12 17:10:05 +00:00
|
|
|
package resource
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"net/http"
|
|
|
|
|
|
2026-05-19 15:33:57 +00:00
|
|
|
//modelpublic "source.gleipnir.technology/Gleipnir/nidus-sync/db/gen/nidus-sync/public/model"
|
|
|
|
|
//modelpublicreport "source.gleipnir.technology/Gleipnir/nidus-sync/db/gen/nidus-sync/publicreport/model"
|
|
|
|
|
nhttp "source.gleipnir.technology/Gleipnir/nidus-sync/http"
|
|
|
|
|
"source.gleipnir.technology/Gleipnir/nidus-sync/platform"
|
2026-05-12 17:10:05 +00:00
|
|
|
//"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
|
|
|
|
|
}
|