service

package
v0.0.0-...-4b44fdb Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetHeader

func SetHeader(header http.Header, reqHeader *ReqHeaderTest1)

Types

type Dber

type Dber interface {
	GetAllWallet() ([]repository.TbWallet, error)
	PostCreateNewWallet(req repository.TbWallet, reqWAcc repository.TbWalletAccount, reqTrans repository.TbTransaction) (int64, error)
	GetWalletDetail(cid, accNo string) ([]repository.TmpWalletDetail, error)
	PostAddBalance(req repository.TbTransaction, status string) (int64, error)
	PostDeductBalance(req repository.TbTransaction) (int64, error)
	PostWalletStatus(req repository.TbWalletAccount) (int64, error)
}

type Handle

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

func NewHandle

func NewHandle(service Servicer) *Handle

func (*Handle) ExecuteAddBalance

func (h *Handle) ExecuteAddBalance(c echo.Context) error

func (*Handle) ExecuteCreateNewWallet

func (h *Handle) ExecuteCreateNewWallet(c echo.Context) error

func (*Handle) ExecuteDeductBalance

func (h *Handle) ExecuteDeductBalance(c echo.Context) error

func (*Handle) ExecuteGetAllWallet

func (h *Handle) ExecuteGetAllWallet(c echo.Context) error

func (*Handle) ExecuteGetWalletDetail

func (h *Handle) ExecuteGetWalletDetail(c echo.Context) error

func (*Handle) ExecuteTest1

func (h *Handle) ExecuteTest1(c echo.Context) error

func (*Handle) ExecuteWalletStatus

func (h *Handle) ExecuteWalletStatus(c echo.Context) error

type ReqHeaderTest1

type ReqHeaderTest1 struct {
	AppID string `validate:"nonzero" json:"app-id"`
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ test api

type ReqTest1

type ReqTest1 struct {
	AccountNo string  `validate:"nonzero" json:"account_no"`
	Amount    float64 `json:"amount"`
}

type RequestAddBalance

type RequestAddBalance struct {
	AccountNo string  `validate:"nonzero,max=10,regexp=^[0-9]*$" json:"account_no"`
	Amount    float64 `validate:"nonzero,max=99999999.9999" json:"amount"`
}

type RequestDeductBalance

type RequestDeductBalance struct {
	AccountNo string  `validate:"nonzero,max=10,regexp=^[0-9]*$" json:"account_no"`
	Amount    float64 `validate:"nonzero,max=99999999.9999" json:"amount"`
}

type RequestNewWallet

type RequestNewWallet struct {
	CitizenId   string  `validate:"nonzero,max=13,regexp=^[0-9]*$" json:"citizen_id"`
	Title       string  `validate:"nonzero,max=20,regexp=^[\u0E00-\u0E7Fa-zA-Z0-9-_:\\,.#$+/\\(\\)\\/\\s]*$" json:"title"`
	Firstname   string  `validate:"nonzero,max=50,regexp=^[\u0E00-\u0E7Fa-zA-Z0-9-_:\\,.#$+/\\(\\)\\/\\s]*$" json:"firstname"`
	Lastname    string  `validate:"nonzero,max=50,regexp=^[\u0E00-\u0E7Fa-zA-Z0-9-_:\\,.#$+/\\(\\)\\/\\s]*$" json:"lastname"`
	Address     string  `validate:"nonzero,max=200,regexp=^[\u0E00-\u0E7Fa-zA-Z0-9-_:\\,.#$+/\\(\\)\\/\\s]*$" json:"address"`
	Subdistrict string  `validate:"nonzero,max=100,regexp=^[\u0E00-\u0E7Fa-zA-Z0-9-_:\\,.#$+/\\(\\)\\/\\s]*$" json:"subdistrict"`
	District    string  `validate:"nonzero,max=100,regexp=^[\u0E00-\u0E7Fa-zA-Z0-9-_:\\,.#$+/\\(\\)\\/\\s]*$" json:"district"`
	Province    string  `validate:"nonzero,max=100,regexp=^[\u0E00-\u0E7Fa-zA-Z0-9-_:\\,.#$+/\\(\\)\\/\\s]*$" json:"province"`
	ZipCode     string  `validate:"nonzero,max=5,regexp=^[0-9]*$" json:"zipcode"`
	Tel         string  `validate:"nonzero,max=20,regexp=^[0-9]*$" json:"tel"`
	AccountNo   string  `validate:"nonzero,max=10,regexp=^[0-9]*$" json:"account_no"`
	Remark      string  `validate:"max=250,regexp=^[\u0E00-\u0E7Fa-zA-Z0-9-_:\\,.#$+/\\(\\)\\/\\s]*$" json:"remark"`
	Amount      float64 `validate:"nonzero,max=99999999.9999" json:"amount"`
}

type RequestWalletDetail

type RequestWalletDetail struct {
	CitizenId string `validate:"nonzero,max=13,regexp=^[0-9]*$" json:"citizen_id"`
	AccountNo string `validate:"nonzero,max=10,regexp=^[0-9]*$" json:"account_no"`
}

type RequestWalletStatus

type RequestWalletStatus struct {
	AccountNo string `validate:"nonzero,max=10,regexp=^[0-9]*$" json:"account_no"`
	Status    string `validate:"nonzero,max=10,regexp=^[\u0E00-\u0E7Fa-zA-Z0-9-_:\\,.#$+/\\(\\)\\/\\s]*$" json:"status"`
}

type ResTest1

type ResTest1 struct {
	RespCode    string `json:"respCode"`
	RespDesc    string `json:"respDesc"`
	RespDisplay string `json:"respDisplay"`
}

type ResponseAddBalance

type ResponseAddBalance struct {
	RespCode    string `json:"respCode"`
	RespDesc    string `json:"respDesc"`
	RespDisplay string `json:"respDisplay"`
}

type ResponseAllWallet

type ResponseAllWallet struct {
	RespCode    string           `json:"respCode"`
	RespDesc    string           `json:"respDesc"`
	RespDisplay string           `json:"respDisplay"`
	Values      []ValueAllWallet `json:"values"`
}

type ResponseDeductBalance

type ResponseDeductBalance struct {
	RespCode    string `json:"respCode"`
	RespDesc    string `json:"respDesc"`
	RespDisplay string `json:"respDisplay"`
}

type ResponseNewWallet

type ResponseNewWallet struct {
	RespCode    string `json:"respCode"`
	RespDesc    string `json:"respDesc"`
	RespDisplay string `json:"respDisplay"`
}

type ResponseWalletDetail

type ResponseWalletDetail struct {
	RespCode    string              `json:"respCode"`
	RespDesc    string              `json:"respDesc"`
	RespDisplay string              `json:"respDisplay"`
	Values      []ValueWalletDetail `json:"values"`
}

type ResponseWalletStatus

type ResponseWalletStatus struct {
	RespCode    string `json:"respCode"`
	RespDesc    string `json:"respDesc"`
	RespDisplay string `json:"respDisplay"`
}

type Service

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

func NewService

func NewService(db Dber) *Service

func (*Service) ApiGetAllWallet

func (s *Service) ApiGetAllWallet(c echo.Context) *ResponseAllWallet

func (*Service) ApiGetWalletDetail

func (s *Service) ApiGetWalletDetail(c echo.Context, req RequestWalletDetail) *ResponseWalletDetail

func (*Service) ApiPostAddBalance

func (s *Service) ApiPostAddBalance(c echo.Context, req RequestAddBalance) *ResponseAddBalance

func (*Service) ApiPostCreatNewWallet

func (s *Service) ApiPostCreatNewWallet(c echo.Context, req RequestNewWallet) *ResponseNewWallet

func (*Service) ApiPostDeductBalance

func (s *Service) ApiPostDeductBalance(c echo.Context, req RequestDeductBalance) *ResponseDeductBalance

func (*Service) ApiPostWalletStatus

func (s *Service) ApiPostWalletStatus(c echo.Context, req RequestWalletStatus) *ResponseWalletStatus

func (*Service) ApiTest1

func (s *Service) ApiTest1(c echo.Context, req ReqTest1) *ResTest1

type Servicer

type Servicer interface {
	ApiGetAllWallet(c echo.Context) *ResponseAllWallet
	ApiPostCreatNewWallet(c echo.Context, req RequestNewWallet) *ResponseNewWallet
	ApiGetWalletDetail(c echo.Context, req RequestWalletDetail) *ResponseWalletDetail
	ApiPostAddBalance(c echo.Context, req RequestAddBalance) *ResponseAddBalance
	ApiPostDeductBalance(c echo.Context, req RequestDeductBalance) *ResponseDeductBalance
	ApiPostWalletStatus(c echo.Context, req RequestWalletStatus) *ResponseWalletStatus

	ApiTest1(c echo.Context, req ReqTest1) *ResTest1
}

type ValueAllWallet

type ValueAllWallet struct {
	CitizenId   string `json:"citizen_id"`
	Title       string `json:"title"`
	Firstname   string `json:"firstname"`
	Lastname    string `json:"lastname"`
	Address     string `json:"address"`
	Subdistrict string `json:"subdistrict"`
	District    string `json:"district"`
	Province    string `json:"province"`
	ZipCode     string `json:"zipcode"`
	Tel         string `json:"tel"`
}

type ValueWalletDetail

type ValueWalletDetail struct {
	CitizenId string `json:"citizen_id"`
	AccountNo string `json:"account_no"`
	Title     string `json:"title"`
	Firstname string `json:"firstname"`
	Lastname  string `json:"lastname"`
	Balance   string `json:"balance"`
	Status    string `json:"status"`
	Remark    string `json:"remark"`
}

Jump to

Keyboard shortcuts

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