Documentation ¶
Index ¶
- func AddArticle(title string, content string, primaryImageUrl string, writerID uint) error
- func AddProductIntoUserCart(userID uint, productID uint) error
- func CreateComment(uid uint, content string, post_id uint) error
- func CreatePost(uid uint, content string, imageURL *string, fileURL *string) error
- func CreateProduct(uid uint, title string, price float64, description string, category string, ...) error
- func DeleteProductFromUserCart(userID uint, productID uint) error
- func EditProfile(userID uint, updateData map[string]any) *gorm.DB
- func FetchProfileList(userID sql.NullInt64, role string) ([]gin.H, *gorm.DB)
- func FetchUserProfile(id uint) (*model.User, *gorm.DB)
- func FollowUser(userID uint, followedUserID uint) error
- func GetArticleDetail(userID sql.NullInt64, articleID int) (gin.H, error)
- func ListArticles(userID sql.NullInt64) ([]gin.H, error)
- func ListFavoriteArticle(userID uint) ([]gin.H, error)
- func ListFavoritePeople(userID uint) ([]gin.H, *gorm.DB)
- func ListPost() ([]model.Post, error)
- func Login(username string, password string) (model.User, error)
- func MarkArticle(userID uint, articleID uint) error
- func RegisterUser(username string, password string, role string, sex string, tel string) error
- func UnFollowUser(userID uint, followedUserID uint) error
- func UnMarkArticle(userID uint, articleID uint) error
- type CartProduct
- type ListAllProduct
- type ListByCategoryProduct
- type ListByUIDProduct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddArticle ¶
func AddProductIntoUserCart ¶
func CreatePost ¶
func CreateProduct ¶
func FetchProfileList ¶
func FollowUser ¶
func MarkArticle ¶
func RegisterUser ¶
func UnFollowUser ¶
func UnMarkArticle ¶
Types ¶
type CartProduct ¶
type CartProduct struct { ID uint `json:"id"` Title string `json:"title"` Price float64 `json:"price"` Description string `json:"description"` Category string `json:"category"` PrimaryImageURL string `json:"primary_image_url"` }
func ListUserCart ¶
func ListUserCart(userID uint) ([]CartProduct, error)
type ListAllProduct ¶
type ListAllProduct struct { ID uint `json:"id"` Title string `json:"title"` Price float64 `json:"price"` Description string `json:"description"` Category string `json:"category"` PrimaryImageURL string `json:"primary_image_url"` UserID uint `json:"user_id"` }
func ListAllProducts ¶
func ListAllProducts() ([]ListAllProduct, error)
type ListByCategoryProduct ¶
type ListByCategoryProduct struct { ID uint `json:"id"` Title string `json:"title"` Price float64 `json:"price"` Description string `json:"description"` PrimaryImageURL string `json:"primary_image_url"` UserID uint `json:"user_id"` }
func ListProductsByCategory ¶
func ListProductsByCategory(category string) ([]ListByCategoryProduct, error)
type ListByUIDProduct ¶
type ListByUIDProduct struct { ID uint `json:"id"` Title string `json:"title"` Price float64 `json:"price"` Description string `json:"description"` Category string `json:"category"` PrimaryImageURL string `json:"primary_image_url"` }
func ListProductsByUID ¶
func ListProductsByUID(uid uint) ([]ListByUIDProduct, error)
Click to show internal directories.
Click to hide internal directories.