Documentation ¶
Index ¶
- func AbortContextWithError(ctx *gin.Context, err error)
- func CORS(r *gin.Engine)
- func Code(i InternalMessage) int
- func ConvertToJST(utcTime time.Time) string
- func DBInit() (db *gorm.DB, err error)
- func DBInitTest() (db *gorm.DB, err error)
- func GenerateRandomString() string
- func GetParams(params string, ctx *gin.Context) (*string, error)
- func GetPayloadFromBody[T any](ctx *gin.Context, p *T) (result T, err error)
- func GetQuery(params string, ctx *gin.Context) (*string, error)
- func HistoryDBInitTest() (db *gorm.DB, err error)
- func ReturnErrorResponse(ctx *gin.Context, err error)
- type Cart
- type IDBUtils
- type InternalCart
- type InternalError
- type InternalItem
- type InternalMessage
- type InternalTransaction
- type Item
- type Shipping
- type Transaction
- type TransactionItem
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbortContextWithError ¶
func Code ¶
func Code(i InternalMessage) int
func ConvertToJST ¶
func DBInitTest ¶
func GenerateRandomString ¶
func GenerateRandomString() string
func GetPayloadFromBody ¶
func HistoryDBInitTest ¶
func ReturnErrorResponse ¶
Types ¶
type InternalCart ¶
type InternalError ¶
type InternalError struct {
Message InternalMessage `json:"message"`
}
func (*InternalError) Error ¶
func (r *InternalError) Error() string
type InternalItem ¶
type InternalMessage ¶
type InternalMessage string
const ( InternalErrorInvalidItem InternalMessage = "invalid item" InternalErrorStockOver InternalMessage = "stock over" InternalErrorInvalidQuantity InternalMessage = "invalid quantity" InternalErrorNoStock InternalMessage = "no stock" )
在庫管理系
const ( InternalErrorInvalidPayload InternalMessage = "The request payload is malformed or contains invalid data." InternalErrorInvalidQuery InternalMessage = "invalid Query" InternalErrorInvalidParams InternalMessage = "invalid Params" InternalErrorInvalidCart InternalMessage = "invalid cart" InternalErrorInvalidUserRequest InternalMessage = "invalid user request" InternalErrorUnAuthorized InternalMessage = "unauthorized" InternalErrorEmailIsNotVerified InternalMessage = "email is not verified" InternalErrorAddressIsNotRegistered InternalMessage = "address is not registered" InternalErrorNotLogined InternalMessage = "not logined" )
リクエスト系
const ( InternalErrorNotFound InternalMessage = "record not found" InternalErrorDB InternalMessage = "DB error" InternalErrorCartIsEmpty InternalMessage = "cart is empty" )
DB系
const ( InternalErrorManufacturerAlreadyHasBank InternalMessage = "manufacturer already has bank" InternalErrorManufacturerDoesNotHaveBank InternalMessage = "manufacturer does not have bank" InternalErrorAccountIsNotSatisfied InternalMessage = "account is not satisfied" InternalErrorFromStripe InternalMessage = "error from stripe" )
ストライプ系
const (
InternalErrorIncident InternalMessage = "incident"
)
const (
InternalErrorR2 InternalMessage = "r2 error"
)
type InternalTransaction ¶
type InternalTransaction struct { Transaction Transaction `gorm:"embedded"` TransactionItems TransactionItem `gorm:"embedded"` }
type Item ¶
type Item struct { Id string `gorm:"id"` ManufacturerUserId string `gorm:"manufacturer_user_id;type:varchar(100)"` Name string `gorm:"name"` Price int `gorm:"price"` Status string `gorm:"status"` Stock int `gorm:"stock"` Size int `gorm:"size"` Description string `gorm:"description"` Tags string `gorm:"type:json"` }
type Shipping ¶
type Shipping struct { Id string `gorm:"id"` ZipCode string `gorm:"zip_code"` Address_1 string `gorm:"address_1"` Address_2 string `gorm:"address_2"` Address_3 string `gorm:"address_3" null:"true"` PhoneNumber string `gorm:"phone_number"` FirstName string `gorm:"first_name"` FirstNameKana string `gorm:"first_name_kana"` LastName string `gorm:"last_name"` LastNameKana string `gorm:"last_name_kana"` }
type Transaction ¶
type Transaction struct { TransactionId string `gorm:"column:transaction_id;type:varchar(100);primaryKey"` PurchaserUserId string `gorm:"purchaser_user_id;type:varchar(100)"` Email string `gorm:"email"` TrackingId string `gorm:"tracking_id;type:varchar(100)"` CreatedAt time.Time `gorm:"created_at"` ZipCode string `gorm:"zip_code"` Address string `gorm:"address"` PhoneNumber string `gorm:"phone_number"` RealName string `gorm:"real_name"` Status string `gorm:"status"` TotalPrice int `gorm:"total_price"` TotalAmount int `gorm:"total_amount"` }
type TransactionItem ¶
type TransactionItem struct { Id int `gorm:"id"` TransactionId string `gorm:"transaction_id;type:varchar(100)"` ItemId string `gorm:"item_id;type:varchar(100)"` Name string `gorm:"name"` Price int `gorm:"price"` Size int `gorm:"size"` Quantity int `gorm:"quantity"` Description string `gorm:"description"` Tags string `gorm:"tags"` ManufacturerUserId string `gorm:"manufacturer_user_id;type:varchar(100)"` ManufacturerName string `gorm:"manufacturer_name"` ManufacturerDescription string `gorm:"manufacturer_description"` ManufacturerStripeAccountId string `gorm:"manufacturer_stripe_account_id;type:varchar(100)"` StripeTransferId string `gorm:"stripe_transfer_id;type:varchar(100)"` Status string `gorm:"status"` }
Click to show internal directories.
Click to hide internal directories.