account

package
v0.0.0-...-b16b3cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountSecurityServer

type AccountSecurityServer struct {
}

func (AccountSecurityServer) UpdatePasswordHandler

func (server AccountSecurityServer) UpdatePasswordHandler(w http.ResponseWriter, r *http.Request)

UpdatePasswordHandler handles the request

PUT /api/v1.0/account/password

type AccountServer

AccountServer provides a virtual server that handles requests that are related to Account

func (AccountServer) AccountAuthenticationHandler

func (server AccountServer) AccountAuthenticationHandler(w http.ResponseWriter, r *http.Request)

AccountAuthenticationHandler handles the request:

POST /api/v1.0/account/authenticate

func (AccountServer) RegisterAccountHandler

func (server AccountServer) RegisterAccountHandler(w http.ResponseWriter, r *http.Request)

RegisterAccountHandler handle the request

POST /api/v1.0/account/register

A JWT from Firebase should be sent to this endpoint. The handler will then send the token to Firebase for validation. Once the token is validated, this handler will pull data from Firebase, including user's name, email, phone number, and create a local account profile within the database. Identity is completely managed Firebase and DAS only checks the token and store additional user-provided data.

type AccountTypeServer

type AccountTypeServer struct {
	businesslogic.IAccountTypeRepository
}

AccountTypeServer is a micro-server that serves requests that ask for available account types in DAS

func (AccountTypeServer) GetAccountTypeHandler

func (server AccountTypeServer) GetAccountTypeHandler(w http.ResponseWriter, r *http.Request)

GetAccountTypeHandler handles the request

GET /api/account/type

No parameter is required for this request.

Sample returned result:

[
	{"id":1,"name":"Athlete"},
	{"id":2,"name":"Adjudicator"},
	{"id":3,"name":"Scrutineer"},
	{"id":4,"name":"Organizer"},
	{"id":5,"name":"Deck Captain"},
	{"id":6,"name":"Emcee"}
]

type GenderServer

type GenderServer struct {
	businesslogic.IGenderRepository
}

GenderServer serves requests that ask for all possible gender options in DAS

func (GenderServer) GetAccountGenderHandler

func (handler GenderServer) GetAccountGenderHandler(w http.ResponseWriter, r *http.Request)

GetAccountGenderHandler handles request

GET /api/account/gender

No parameter is required for this request.

Sample returned result:

[
	{"id":1,"name":"Female"},
	{"id":2,"name":"Male"}
]

type ProfileSearchServer

type ProfileSearchServer struct {
	// contains filtered or unexported fields
}

ProfileSearchServer defines a virtual server that handles requests from search user profiles, such as competitors, couples, competition officials (adjudicators, scrutineers, organizers, etc).

func NewProfileSearchServer

func NewProfileSearchServer(accountRepo businesslogic.IAccountRepository) ProfileSearchServer

func (ProfileSearchServer) SearchDancerProfileHandler

func (server ProfileSearchServer) SearchDancerProfileHandler(w http.ResponseWriter, r *http.Request)

SearchDancerProfileHandler handles the request

GET /api/v1.0/profile/dancers

func (ProfileSearchServer) SearchPartnershipProfileHandler

func (server ProfileSearchServer) SearchPartnershipProfileHandler(w http.ResponseWriter, r *http.Request)

type RoleApplicationServer

type RoleApplicationServer struct {
	// contains filtered or unexported fields
}

func (RoleApplicationServer) AdminGetRoleApplicationHandler

func (server RoleApplicationServer) AdminGetRoleApplicationHandler(w http.ResponseWriter, r *http.Request)

AdminGetRoleApplicationHandler handles the request:

GET /api/v1/admin/role/application

This will return all role applications to the admin user. This handler is for admin uses only and should enforce role check

func (RoleApplicationServer) CreateRoleApplicationHandler

func (server RoleApplicationServer) CreateRoleApplicationHandler(w http.ResponseWriter, r *http.Request)

CreateRoleApplicationHandler handles the request:

POST /api/v1.0/account/role/application

Accepted JSON payload:

{
	"role": 2,
	"description": "I am applying this role because..."
}

Sample response payload:

{
	"status": 200,
	"message":
	"data": null
}

func (RoleApplicationServer) GetAllApplicationStatus

func (server RoleApplicationServer) GetAllApplicationStatus(w http.ResponseWriter, r *http.Request)

func (RoleApplicationServer) ProvisionRoleApplicationHandler

func (server RoleApplicationServer) ProvisionRoleApplicationHandler(w http.ResponseWriter, r *http.Request)

ProvisionRoleApplicationHandler handles the request:

PUT /api/v1.o/account/role/provision

func (RoleApplicationServer) SearchRoleApplicationHandler

func (server RoleApplicationServer) SearchRoleApplicationHandler(w http.ResponseWriter, r *http.Request)

SearchRoleApplicationHandler handles the request:

GET /api/v1.0/account/role/application

type RoleServer

type RoleServer struct {
	Auth        auth.IAuthenticationStrategy
	AccountRepo businesslogic.IAccountRepository
}

RoleServer handles the role information of user

func (RoleServer) GetAccountRolesHandler

func (server RoleServer) GetAccountRolesHandler(w http.ResponseWriter, r *http.Request)

GetAccountRoles get the roles of current user

type UserPreferenceServer

UserPreferenceServer provides a virtual server that handles requests that are related to User Preference

func (UserPreferenceServer) GetUserPreferenceHandler

func (server UserPreferenceServer) GetUserPreferenceHandler(w http.ResponseWriter, r *http.Request)

GetUserPreferenceHandler handles the request

GET /api/v1.0/account/preference

func (UserPreferenceServer) UpdateUserPreferenceHandler

func (server UserPreferenceServer) UpdateUserPreferenceHandler(w http.ResponseWriter, r *http.Request)

UpdateUserPreferenceHandler handles the request

PUT /api/v1.0/account/preference

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL