Documentation
¶
Index ¶
- type Admin
- type AllMasterDataResponse
- type BankAccount
- type Buyer
- type Comments
- type ConfirmPaymentResponse
- type CreatePaymentBody
- type CreatePaymentResponse
- type DeletePetResponse
- type ErrorResponse
- type MasterData
- type MasterDataCategory
- type MasterDataCategoryResponse
- type MasterDataResponse
- type Medical_record
- type OTP
- type OTPResponse
- type PartyReport
- type Password
- type PaymentIntent
- type Pet
- type PetCard
- type PetCardResponse
- type PetDetail
- type PetRequest
- type PetResponse
- type ResetPassword
- type Review
- type Seller
- type SystemReport
- type Transaction
- type TransactionWithDetails
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Username string `json:"username" binding:"required"` // unique
Email string `json:"email" binding:"required"` // unique
Password string `json:"password" binding:"required"`
FirstName string `json:"first_name" bson:"first_name" binding:"required"`
LastName string `json:"last_name" bson:"last_name" binding:"required"`
Gender string `json:"gender"`
PhoneNumber string `json:"phoneNumber" bson:"phoneNumber" binding:"required"`
Image string `json:"image"`
Address struct {
Province string `json:"province"`
District string `json:"district"`
SubDistrict string `json:"subdistrict"`
PostalCode string `json:"postalCode"`
Street string `json:"street"`
Building string `json:"building"`
HouseNumber string `json:"houseNumber"`
} `json:"address"`
}
admin model from user collection
type AllMasterDataResponse ¶
type AllMasterDataResponse struct {
Success bool `json:"success" example:"true"`
Count int `json:"count" example:"1"`
Data []MasterData `json:"data"`
}
type BankAccount ¶
type BankAccount struct {
BankName string `json:"bank_name" bson:"bank_name"`
BankAccountName string `json:"bank_account_name" bson:"bank_account_name"`
BankAccountNumber string `json:"bank_account_number" bson:"bank_account_number"`
}
BankAccount model
type ConfirmPaymentResponse ¶
type CreatePaymentBody ¶
type CreatePaymentResponse ¶
type DeletePetResponse ¶
type ErrorResponse ¶
type MasterData ¶
type MasterDataCategory ¶
type MasterDataCategory struct {
Categories []string `json:"categories"`
}
type MasterDataResponse ¶
type MasterDataResponse struct {
Success bool `json:"success" example:"true"`
Data MasterData `json:"data"`
}
type Medical_record ¶
type OTP ¶
type OTP struct {
ID string `json:"id,omitempty" bson:"_id,omitempty"`
Email string `json:"email" bson:"email" binding:"required"`
OTP string `json:"otp" bson:"otp" binding:"required"`
CreatedAt time.Time `json:"created_at" bson:"created_at"`
}
OTP model
type OTPResponse ¶
type PartyReport ¶
type PartyReport struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Reporter_id primitive.ObjectID `json:"reporter_id,omitempty" bson:"reporter_id,omitempty"`
Reportee_id primitive.ObjectID `json:"reportee_id,omitempty" bson:"reportee_id,omitempty"`
Description string `json:"description" bson:"description"`
Is_solved bool `json:"is_solved" bson:"is_solved"`
}
type Password ¶
type Password struct {
Password string `json:"password" binding:"required"`
}
Password model
type PaymentIntent ¶
type PaymentIntent struct {
ID string `json:"payment_id" bson:"payment_id" example:"123456789"`
TransactionID primitive.ObjectID `json:"transaction_id" bson:"transaction_id" example:"60163b3be1e8712c4e7f35cf"`
PaymentMethod string `json:"payment_method" bson:"payment_method" example:"card" enum:"card,promptpay"`
}
type Pet ¶
type Pet struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty" example:"60163b3be1e8712c4e7f35cf"`
Name string `json:"name" example:"Fluffy"`
Age float32 `json:"age" example:"3.0"`
Price int32 `json:"price" example:"500"`
Is_sold bool `json:"is_sold" example:"false"`
Description string `json:"description" example:"A friendly and playful dog"`
Weight float64 `json:"weight" example:"25.5"`
Sex string `json:"sex" example:"male"`
Category string `json:"category" example:"Dog"`
Species string `json:"species" example:"Golden Retriever"`
Behavior string `json:"behavior" example:"Friendly"`
Media string `json:"media" example:"https://example.com/fluffy.jpg"`
Medical_records []Medical_record `json:"medical_records" bson:"medical_records"`
Seller_id primitive.ObjectID `json:"seller_id,omitempty" bson:"seller_id,omitempty" example:"60163b3be1e8712c4e7f35ce"`
}
pet model from pet collection
type PetCard ¶
type PetCard struct {
ID primitive.ObjectID `json:"id" bson:"_id" example:"60163b3be1e8712c4e7f35cf"`
Name string `json:"name" example:"Fluffy"`
Price int `json:"price" example:"100"`
Category string `json:"category" example:"Dog"`
Species string `json:"species" example:"Golden Retriever"`
Media string `json:"media" example:"https://example.com/fluffy.jpg"`
SellerID primitive.ObjectID `json:"seller_id" bson:"seller_id" example:"60163b3be1e8712c4e7f35ce"`
SellerName string `json:"seller_name" example:"John"`
SellerSurname string `json:"seller_surname" example:"Doe"`
}
type PetCardResponse ¶
type PetRequest ¶
type PetRequest struct {
Name string `json:"name" example:"Fluffy"`
Age int32 `json:"age" example:"3"`
Price int32 `json:"price" example:"500"`
Is_sold bool `json:"is_sold" example:"false"`
Description string `json:"description" example:"A friendly and playful dog"`
Weight float64 `json:"weight" example:"25.5"`
Sex string `json:"sex" example:"male"`
Category string `json:"category" example:"Dog"`
Species string `json:"species" example:"Golden Retriever"`
Behavior string `json:"behavior" example:"Friendly"`
Media string `json:"media" example:"https://example.com/fluffy.jpg"`
Medical_records []Medical_record `json:"medical_records" bson:"medical_records"`
}
type PetResponse ¶
type ResetPassword ¶
type Review ¶
type Review struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Reviewer_id primitive.ObjectID `json:"reviewer_id,omitempty" bson:"reviewer_id,omitempty"`
Reviewee_id primitive.ObjectID `json:"reviewee_id,omitempty" bson:"reviewee_id,omitempty"`
Rating_score float64 `json:"rating_score" bson:"rating_score"`
Description string `json:"description" bson:"description"`
Comment_records []Comments `json:"comment_records" bson:"comment_records"`
Time time.Time `json:"time" bson:"time"`
}
type Seller ¶
type Seller struct {
ID primitive.ObjectID `json:"id" bson:"_id"`
FirstName string `json:"first_name" bson:"first_name"`
LastName string `json:"last_name" bson:"last_name"`
Pets []primitive.ObjectID `json:"pets"`
BankAccount BankAccount `json:"bank_account" bson:"bank_account"`
License string `json:"license" bson:"license"`
Status string `json:"status" bson:"status"`
}
Seller model from seller collection
type SystemReport ¶
type Transaction ¶
type Transaction struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
SellerID primitive.ObjectID `json:"seller_id" bson:"seller_id" binding:"required"`
PetID primitive.ObjectID `json:"pet_id" bson:"pet_id" binding:"required"`
BuyerID primitive.ObjectID `json:"buyer_id" bson:"buyer_id" binding:"required"`
PaymentID string `json:"payment_id" bson:"payment_id"`
Price int64 `json:"price" binding:"required"`
PaymentMethod string `json:"payment_method" bson:"payment_method"`
Status string `json:"status"`
Timestamp time.Time `json:"timestamp"`
}
transaction model
type TransactionWithDetails ¶
type TransactionWithDetails struct {
Transaction
SellerName string `json:"seller_name" bson:"seller_name"`
BuyerName string `json:"buyer_name" bson:"buyer_name"`
PetDetail PetDetail `json:"pet_detail" bson:"pet_detail"`
}
type User ¶
type User struct {
// ID represents the unique identifier of a user.
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Username string `json:"username" binding:"required" validate:"required,min=4,max=20"` // unique
Email string `json:"email" binding:"required" validate:"required,email"` // unique
Password string `json:"password" binding:"required" validate:"required,min=6"`
FirstName string `json:"first_name" bson:"first_name"`
LastName string `json:"last_name" bson:"last_name"`
Gender string `json:"gender"`
PhoneNumber string `json:"phoneNumber" bson:"phoneNumber"`
Image string `json:"image"`
Role int32 `json:"role" binding:"required" validate:"required,eq=1|eq=2"`
License string `json:"license,omitempty" bson:"license,omitempty"`
Address struct {
Province string `json:"province"`
District string `json:"district"`
SubDistrict string `json:"subdistrict"`
PostalCode string `json:"postalCode"`
Street string `json:"street"`
Building string `json:"building"`
HouseNumber string `json:"houseNumber"`
} `json:"address"`
}
user model from user collection
Click to show internal directories.
Click to hide internal directories.