Documentation ¶
Index ¶
- Constants
- func AddAccount(w http.ResponseWriter, r *http.Request, user database.User)
- func AddCard(w http.ResponseWriter, r *http.Request, user database.User)
- func CreateBank(w http.ResponseWriter, r *http.Request, user database.User)
- func CreateUser(w http.ResponseWriter, r *http.Request)
- func CreateUserByAdmin(w http.ResponseWriter, r *http.Request, user database.User)
- func DbDeleteUser(w http.ResponseWriter, r *http.Request, user database.User)
- func DeleteUser(w http.ResponseWriter, r *http.Request, user database.User)
- func GetAccount(w http.ResponseWriter, r *http.Request, user database.User)
- func GetAllAccounts(w http.ResponseWriter, r *http.Request, user database.User)
- func GetAllCards(w http.ResponseWriter, r *http.Request, user database.User)
- func GetAnotherUser(w http.ResponseWriter, r *http.Request, user database.User)
- func GetBankList(w http.ResponseWriter, r *http.Request)
- func GetCard(w http.ResponseWriter, r *http.Request, user database.User)
- func GetUser(w http.ResponseWriter, r *http.Request, user database.User)
- func GetUserList(w http.ResponseWriter, r *http.Request, user database.User)
- func HashPassword(password string) string
- func Hello(w http.ResponseWriter, r *http.Request)
- func Init()
- func LoginUser(w http.ResponseWriter, r *http.Request)
- func MiddlewareAuth(handler authHandler) http.HandlerFunc
- func UpdateAccount(w http.ResponseWriter, r *http.Request, user database.User)
- func UpdateAnotherUser(w http.ResponseWriter, r *http.Request, user database.User)
- func UpdateBank(w http.ResponseWriter, r *http.Request, user database.User)
- func UpdateCard(w http.ResponseWriter, r *http.Request, user database.User)
- func UpdateDB(db *database.Queries)
- func UpdateUser(w http.ResponseWriter, r *http.Request, user database.User)
- func UpdateUserPassword(w http.ResponseWriter, r *http.Request, user database.User)
Constants ¶
View Source
const ( UserRole_Admin = 100 UserRole_Base = 10 )
Variables ¶
This section is empty.
Functions ¶
func AddAccount ¶
AddAccount godoc
@Summary Create Account @Description create new bank account @Tags Bank Accounts @Accept json @Produce json @Param account body models.AddBankAccountReq true "Bank Account Body" @Success 201 {object} models.BankAccount @Failure 400 {object} models.JSONerrResponse @Router /accounts/ [post]
func CreateBank ¶
CreateBank godoc
@Summary Create Bank @Description create a new bank @Tags Bank @Accept json @Produce json @Param page body models.CreateBankReq true "Create Bank Body" @Success 201 {object} models.Bank @Failure 400 {object} models.JSONerrResponse @Router /banks/register [post]
func CreateUser ¶
func CreateUser(w http.ResponseWriter, r *http.Request)
CreateUser godoc
@Summary Create User @Description create new user @Tags Users @Accept json @Produce json @Param user body models.CreateUserReq true "User Body" @Success 201 {object} models.User @Failure 400 {object} models.JSONerrResponse @Router /users/register [post]
func CreateUserByAdmin ¶
CreateUserByAdmin godoc
@Summary Create User By Admin @Description create new user by admin @Tags Users @Accept json @Produce json @Param user body models.CreateUserByAdminReq true "User Body" @Success 201 {object} models.User @Failure 400 {object} models.JSONerrResponse @Router /users/add [post]
func DbDeleteUser ¶
DbDeleteUser godoc
@Summary Delete user from DB @Description delete user from db by admin @Tags Users @Accept json @Produce json @Param username path string true "Username" @Success 201 {object} models.JSONerrResponse @Failure 400 {object} models.JSONerrResponse @Router /users/{username} [delete]
func DeleteUser ¶
DeleteUser godoc
@Summary Delete user @Description delete user @Tags Users @Accept json @Produce json @Success 201 {object} models.JSONerrResponse @Failure 400 {object} models.JSONerrResponse @Router /users/me [delete]
func GetAccount ¶
GetAccount godoc
@Summary Get Account @Description get bank account details @Tags Bank Accounts @Accept json @Produce json @Param account_id path string true "Bank Account ID" @Success 201 {object} models.BankAccount @Failure 400 {object} models.JSONerrResponse @Router /accounts/{account_id} [get]
func GetAllAccounts ¶
GetAllAccounts godoc
@Summary Get All Account @Description get all bank account @Tags Bank Accounts @Accept json @Produce json @Param page query int32 true "Page Number" @Param items_per_page query int32 true "Items Per Page" @Success 200 {object} models.PaginatedListResp[models.BankAccount] @Failure 400 {object} models.JSONerrResponse @Router /accounts/ [get]
func GetAllCards ¶
func GetAnotherUser ¶
GetAnotherUser godoc
@Summary Get User @Description get another user details @Tags Users @Accept json @Produce json @Param username path string true "Username" @Success 200 {object} models.User @Failure 400 {object} models.JSONerrResponse @Router /users/{username} [get]
func GetBankList ¶
func GetBankList(w http.ResponseWriter, r *http.Request)
GetBankList godoc
@Summary Get Bank List @Description get all bank list @Tags Bank @Accept json @Produce json @Param page query int32 true "Page Number" @Param items_per_page query int32 true "Items Per Page" @Success 200 {object} models.PaginatedListResp[models.Bank] @Failure 400 {object} models.JSONerrResponse @Router /banks/list [get]
func GetUser ¶
GetUser godoc
@Summary Get User @Description get user details @Tags Users @Accept json @Produce json @Success 200 {object} models.User @Failure 400 {object} models.JSONerrResponse @Router /users/me [get]
func GetUserList ¶
GetUserList godoc
@Summary Get User List @Description user list @Tags Users @Accept json @Produce json @Param page query int32 true "Page Number" @Param items_per_page query int32 true "Items Per Page" @Success 200 {object} models.PaginatedListResp[models.User] @Failure 400 {object} models.JSONerrResponse @Router /users/list [get]
func HashPassword ¶
func Hello ¶
func Hello(w http.ResponseWriter, r *http.Request)
Hello godoc
@Summary Hello API @Description get string by ID @Tags Ping @Produce json @Success 200 {object} models.JSONResp @Router / [get]
func LoginUser ¶
func LoginUser(w http.ResponseWriter, r *http.Request)
LoginUser godoc
@Summary Login User @Description get login token @Tags Authentication @Accept json @Produce json @Param login body models.AuthReq true "Login Body" @Success 201 {object} models.AuthResp @Failure 400 {object} models.JSONerrResponse @Router /users/login [post]
func MiddlewareAuth ¶
func MiddlewareAuth(handler authHandler) http.HandlerFunc
func UpdateAccount ¶
UpdateAccount godoc
@Summary Update Account @Description update bank account details @Tags Bank Accounts @Accept json @Produce json @Param account_id path string true "Bank Account ID" @Param account body models.UpdateBankAccountReq true "Bank Account Body" @Success 201 {object} models.JSONerrResponse @Failure 400 {object} models.JSONerrResponse @Router /accounts/{account_id} [put]
func UpdateAnotherUser ¶
UpdateAnotherUser godoc
@Summary Create User By Admin @Description create new user by admin @Tags Users @Accept json @Produce json @Param username path string true "Username" @Param user body models.UpdateUserReq true "User Body" @Success 201 {object} models.JSONerrResponse @Failure 400 {object} models.JSONerrResponse @Router /users/{username} [post]
func UpdateBank ¶
func UpdateCard ¶
func UpdateUser ¶
UpdateUser godoc
@Summary update User @Description update user details @Tags Users @Accept json @Produce json @Param user body models.UpdateUserReq true "User Body" @Success 201 {object} models.JSONerrResponse @Failure 400 {object} models.JSONerrResponse @Router /users/me [put]
func UpdateUserPassword ¶
UpdateUserPassword godoc
@Summary Update User Password @Description update user password @Tags Users @Accept json @Produce json @Param password body models.UpdatePasswordReq true "Password Body" @Success 201 {object} models.JSONerrResponse @Failure 400 {object} models.JSONerrResponse @Router /users/me/password [put]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.