Documentation
¶
Index ¶
- type Review
- type ReviewController
- type ReviewRepo
- func (rr *ReviewRepo) CreateReview(review *Review) error
- func (rr *ReviewRepo) GetReview(filter interface{}, opts ...*options.FindOneOptions) (*Review, error)
- func (rr *ReviewRepo) GetReviews(filter interface{}, opts ...*options.FindOptions) ([]*Review, error)
- func (rr *ReviewRepo) IsExists(filter interface{}, opts ...*options.FindOneOptions) (bool, error)
- func (rr *ReviewRepo) UpdateReview(filter interface{}, update interface{}, opts ...*options.UpdateOptions) error
- type ReviewRepository
- type ReviewServices
- type ReviewSevice
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Review ¶
type Review struct { ID primitive.ObjectID `json:"id" bson:"_id,omitempty"` ItemID primitive.ObjectID `json:"item_id" bson:"item_id"` AuthorID primitive.ObjectID `json:"author_id" bson:"author_id"` AuthorName string `json:"author_name" bson:"author_name"` Star int `json:"star" bson:"star"` Content string `json:"content" bson:"content"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` Anonymous bool `json:"anonymous" bson:"anonymous"` }
type ReviewController ¶
type ReviewController struct {
// contains filtered or unexported fields
}
func NewReviewController ¶
func NewReviewController(reviewServices ReviewServices) *ReviewController
func (*ReviewController) GetReview ¶
func (rc *ReviewController) GetReview(c *gin.Context)
func (*ReviewController) GetReviews ¶
func (rc *ReviewController) GetReviews(c *gin.Context)
func (*ReviewController) PostReview ¶
func (rc *ReviewController) PostReview(c *gin.Context)
type ReviewRepo ¶
type ReviewRepo struct {
Collection *mongo.Collection
}
func NewReviewRepo ¶
func NewReviewRepo(collection *mongo.Collection) *ReviewRepo
func (*ReviewRepo) CreateReview ¶
func (rr *ReviewRepo) CreateReview(review *Review) error
func (*ReviewRepo) GetReview ¶
func (rr *ReviewRepo) GetReview(filter interface{}, opts ...*options.FindOneOptions) (*Review, error)
func (*ReviewRepo) GetReviews ¶
func (rr *ReviewRepo) GetReviews(filter interface{}, opts ...*options.FindOptions) ([]*Review, error)
func (*ReviewRepo) IsExists ¶
func (rr *ReviewRepo) IsExists(filter interface{}, opts ...*options.FindOneOptions) (bool, error)
func (*ReviewRepo) UpdateReview ¶
func (rr *ReviewRepo) UpdateReview(filter interface{}, update interface{}, opts ...*options.UpdateOptions) error
type ReviewRepository ¶
type ReviewRepository interface { CreateReview(review *Review) error UpdateReview(filter interface{}, update interface{}, opts ...*options.UpdateOptions) error GetReview(filter interface{}, opts ...*options.FindOneOptions) (*Review, error) GetReviews(filter interface{}, opts ...*options.FindOptions) ([]*Review, error) IsExists(filter interface{}, opts ...*options.FindOneOptions) (bool, error) }
type ReviewServices ¶
type ReviewSevice ¶
type ReviewSevice struct {
// contains filtered or unexported fields
}
func NewReviewService ¶
func NewReviewService(reviewRepository ReviewRepository, userRepository UserRepository) *ReviewSevice
func (*ReviewSevice) GetReview ¶
func (rs *ReviewSevice) GetReview(reviewId string) (*Review, *errors.AppError)
func (*ReviewSevice) GetReviews ¶
func (rs *ReviewSevice) GetReviews(itemId string) ([]*Review, *errors.AppError)
func (*ReviewSevice) PostReview ¶
func (rs *ReviewSevice) PostReview(review *Review) *errors.AppError
type UserRepository ¶
Click to show internal directories.
Click to hide internal directories.