2019-05-18 18:06:10 -04:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/web"
|
2019-05-23 14:32:24 -05:00
|
|
|
"github.com/jmoiron/sqlx"
|
2019-05-18 18:06:10 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// User represents the User API method handler set.
|
|
|
|
type User struct {
|
2019-05-23 14:32:24 -05:00
|
|
|
MasterDB *sqlx.DB
|
2019-05-18 18:06:10 -04:00
|
|
|
Renderer web.Renderer
|
|
|
|
// ADD OTHER STATE LIKE THE LOGGER AND CONFIG HERE.
|
|
|
|
}
|
|
|
|
|
|
|
|
// List returns all the existing users in the system.
|
|
|
|
func (u *User) Login(ctx context.Context, w http.ResponseWriter, r *http.Request, params map[string]string) error {
|
|
|
|
|
|
|
|
return u.Renderer.Render(ctx, w, r, baseLayoutTmpl, "user-login.tmpl", web.MIMETextHTMLCharsetUTF8, http.StatusOK, nil)
|
|
|
|
}
|