dto

package
v0.0.0-...-3014034 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	StatusSuccess      = 200
	StatusBadRequest   = 400
	StatusUnauthorized = 401
	StatusError        = 500
)

Variables

This section is empty.

Functions

func BalanceToPB

func BalanceToPB(in *domain.BalanceView) *pb.Balance

func CreateOrderResponseToPB

func CreateOrderResponseToPB(in *CreateOrderResponse) *pb.CreateOrderResponse

func CreateUserResponseToPB

func CreateUserResponseToPB(in *CreateUserResponse) *pb.CreateUserResponse

func DailyCloseToPB

func DailyCloseToPB(in *domain.DailyClose) *pb.DailyClose

func GetBalanceResponseToPB

func GetBalanceResponseToPB(in *domain.BalanceView) *pb.GetBalanceResponse

func GetStakeConcentrationResponseToPB

func GetStakeConcentrationResponseToPB(
	in *domain.StakeConcentration,
) *pb.GetStakeConcentrationResponse

func ListOrderResponseToPB

func ListOrderResponseToPB(in *ListOrderResponse) *pb.ListOrderResponse

func ListSelectionResponseToPB

func ListSelectionResponseToPB(in *ListSelectionResponse) *pb.ListSelectionResponse

func ListStockResponseToPB

func ListStockResponseToPB(in *ListStockResponse) *pb.ListStockResponse

func ListUsersResponseToPB

func ListUsersResponseToPB(in *ListUsersResponse) *pb.ListUsersResponse

func LoginResponseToPB

func LoginResponseToPB(in *LoginResponse) *pb.LoginResponse

func LogoutResponseToPB

func LogoutResponseToPB(in *LogoutResponse) *pb.LogoutResponse

func MapToProtobufStructFloat32

func MapToProtobufStructFloat32(m map[int]float32) *structpb.Struct

func MapToProtobufStructUint64

func MapToProtobufStructUint64(m map[int]uint64) *structpb.Struct

func OrderToPB

func OrderToPB(in *domain.Order) *pb.Order

func SelectionToPB

func SelectionToPB(in *domain.Selection) *pb.Selection

func StockToPB

func StockToPB(in *domain.Stock) *pb.Stock

func ThreePrimaryToPB

func ThreePrimaryToPB(in *domain.ThreePrimary) *pb.ThreePrimary

func UserToPB

func UserToPB(in *domain.User) *pb.User

Types

type CreateOrderRequest

type CreateOrderRequest struct {
	OrderType    string  `json:"orderType"`
	StockID      string  `json:"stockID"`
	ExchangeDate string  `json:"exchangeDate"`
	TradePrice   float32 `json:"tradePrice"`
	Quantity     uint64  `json:"quantity"`
}

func CreateOrderRequestFromPB

func CreateOrderRequestFromPB(in *pb.CreateOrderRequest) *CreateOrderRequest

type CreateOrderResponse

type CreateOrderResponse struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
	Success      bool   `json:"success"`
	Status       int    `json:"status"`
}

type CreateTransactionRequest

type CreateTransactionRequest struct {
	OrderType string  `json:"orderType"`
	Amount    float32 `json:"amount"`
}

type CreateTransactionResponse

type CreateTransactionResponse struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
	Success      bool   `json:"success"`
	Status       int    `json:"status"`
}

type CreateUserRequest

type CreateUserRequest struct {
	Email     string `json:"email"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Phone     string `json:"phone"`
	Password  string `json:"password"`
	Recaptcha string `json:"recaptcha"`
}

func CreateUserRequestFromPB

func CreateUserRequestFromPB(in *pb.CreateUserRequest) *CreateUserRequest

type CreateUserResponse

type CreateUserResponse struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
	Success      bool   `json:"success"`
	Status       int    `json:"status"`
}

type DeletePickedStocksRequest

type DeletePickedStocksRequest struct {
	StockID string `json:"stockID"`
}

type DeletePickedStocksResponse

type DeletePickedStocksResponse struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
	Success      bool   `json:"success"`
	Status       int    `json:"status"`
}

type GetBalanceViewRequest

type GetBalanceViewRequest struct{}

func GetBalanceRequestFromPB

func GetBalanceRequestFromPB(in *pb.GetBalanceRequest) *GetBalanceViewRequest

type GetBalanceViewResponse

type GetBalanceViewResponse struct {
	Balance *domain.BalanceView `json:"balance"`
}

type GetStakeConcentrationRequest

type GetStakeConcentrationRequest struct {
	StockID string `json:"stockID"`
	Date    string `json:"date"`
}

type InsertPickedStocksRequest

type InsertPickedStocksRequest struct {
	StockIDs []string `json:"stockIDs"`
}

type InsertPickedStocksResponse

type InsertPickedStocksResponse struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
	Success      bool   `json:"success"`
	Status       int    `json:"status"`
}

type ListCategoriesResponse

type ListCategoriesResponse struct {
	Entries []string `json:"entries"`
}

type ListDailyCloseRequest

type ListDailyCloseRequest struct {
	SearchParams *ListDailyCloseSearchParams `json:"searchParams"`
	Offset       int32                       `json:"offset"`
	Limit        int32                       `json:"limit"`
}

func ListDailyCloseRequestFromPB

func ListDailyCloseRequestFromPB(in *pb.ListDailyCloseRequest) *ListDailyCloseRequest

type ListDailyCloseResponse

type ListDailyCloseResponse struct {
	Entries    []*domain.DailyClose `json:"entries"`
	Offset     int32                `json:"offset"`
	Limit      int32                `json:"limit"`
	TotalCount int64                `json:"totalCount"`
}

type ListDailyCloseSearchParams

type ListDailyCloseSearchParams struct {
	StockID string  `json:"stockID"`
	End     *string `json:"end,omitempty"`
	Start   string  `json:"start"`
}

type ListOrderRequest

type ListOrderRequest struct {
	SearchParams *ListOrderSearchParams `json:"searchParams"`
	Offset       int32                  `json:"offset"`
	Limit        int32                  `json:"limit"`
}

func ListOrderRequestFromPB

func ListOrderRequestFromPB(in *pb.ListOrderRequest) *ListOrderRequest

type ListOrderResponse

type ListOrderResponse struct {
	Entries    []*domain.Order `json:"entries"`
	Offset     int32           `json:"offset"`
	Limit      int32           `json:"limit"`
	TotalCount int64           `json:"totalCount"`
}

type ListOrderSearchParams

type ListOrderSearchParams struct {
	StockIDs      *[]string `json:"stockIDs,omitempty"`
	ExchangeMonth *string   `json:"exchangeMonth,omitempty"`
	Status        *string   `json:"status,omitempty"`
}

func ListOrderSearchParamsFromPB

func ListOrderSearchParamsFromPB(in *pb.ListOrderSearchParams) *ListOrderSearchParams

type ListPickedStocksResponse

type ListPickedStocksResponse struct {
	Entries []*domain.Selection `json:"entries"`
}

type ListSelectionRequest

type ListSelectionRequest struct {
	Date   string `json:"date"`
	Strict bool   `json:"strict"`
}

func ListSelectionRequestFromPB

func ListSelectionRequestFromPB(in *pb.ListSelectionRequest) *ListSelectionRequest

type ListSelectionResponse

type ListSelectionResponse struct {
	Entries []*domain.Selection `json:"entries"`
}

type ListStockRequest

type ListStockRequest struct {
	SearchParams *ListStockSearchParams `json:"searchParams"`
	Offset       int32                  `json:"offset"`
	Limit        int32                  `json:"limit"`
}

func ListStockRequestFromPB

func ListStockRequestFromPB(in *pb.ListStockRequest) *ListStockRequest

type ListStockResponse

type ListStockResponse struct {
	Entries    []*domain.Stock `json:"entries"`
	Offset     int32           `json:"offset"`
	Limit      int32           `json:"limit"`
	TotalCount int64           `json:"totalCount"`
}

type ListStockSearchParams

type ListStockSearchParams struct {
	StockIDs *[]string `json:"stockIDs,omitempty"`
	Name     *string   `json:"name,omitempty"`
	Category *string   `json:"category,omitempty"`
	Country  string    `json:"country"`
}

type ListThreePrimaryRequest

type ListThreePrimaryRequest struct {
	SearchParams *ListThreePrimarySearchParams `json:"searchParams"`
	Offset       int32                         `json:"offset"`
	Limit        int32                         `json:"limit"`
}

type ListThreePrimaryResponse

type ListThreePrimaryResponse struct {
	Entries    []*domain.ThreePrimary `json:"entries"`
	Offset     int32                  `json:"offset"`
	Limit      int32                  `json:"limit"`
	TotalCount int64                  `json:"totalCount"`
}

type ListThreePrimarySearchParams

type ListThreePrimarySearchParams struct {
	End     *string `json:"end,omitempty"`
	StockID string  `json:"stockID,omitempty"`
	Start   string  `json:"start"`
}

type ListUsersRequest

type ListUsersRequest struct {
	Offset int32 `json:"offset"`
	Limit  int32 `json:"limit"`
}

func ListUsersRequestFromPB

func ListUsersRequestFromPB(in *pb.ListUsersRequest) *ListUsersRequest

type ListUsersResponse

type ListUsersResponse struct {
	Entries    []*domain.User `json:"entries"`
	Offset     int32          `json:"offset"`
	Limit      int32          `json:"limit"`
	TotalCount int64          `json:"totalCount"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

func LoginRequestFromPB

func LoginRequestFromPB(in *pb.LoginRequest) *LoginRequest

type LoginResponse

type LoginResponse struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
	AccessToken  string `json:"access_token"`
	Status       int    `json:"status"`
	Success      bool   `json:"success"`
}

type LogoutResponse

type LogoutResponse struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
	Success      bool   `json:"success"`
	Status       int    `json:"status"`
}

Jump to

Keyboard shortcuts

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