Documentation
¶
Index ¶
- Variables
- type AttachmentService
- type AttrCateService
- func (s *AttrCateService) AttrParamsCreate(params product.AttrCateAttrParamCreateReq) error
- func (s *AttrCateService) AttrParamsDelete(params product.MultiDeleteReq) error
- func (s *AttrCateService) AttrParamsList(params product.AttrCateAttrParamListReq) (*pagination.PaginateResp, error)
- func (s *AttrCateService) AttrParamsUpdate(params product.AttrCateAttrParamUpdateReq) error
- func (s *AttrCateService) Create(params product.AttrCateCreateReq) error
- func (s *AttrCateService) Delete(params product.MultiDeleteReq) error
- func (s *AttrCateService) Index(params product.IndexReq) (*pagination.PaginateResp, error)
- func (s *AttrCateService) List() ([]*model.ProductGoodsAttrCate, error)
- func (s *AttrCateService) Update(params product.AttrCateUpdateReq) error
- func (s *AttrCateService) View(params product.ViewReq) (*model.ProductGoodsAttrCate, error)
- type BrandService
- func (s *BrandService) Create(params product.BrandCreateReq) error
- func (s *BrandService) Delete(params product.MultiDeleteReq) error
- func (s *BrandService) Index(params product.IndexReq) (*pagination.PaginateResp, error)
- func (s *BrandService) List() ([]*model.ProductBrand, error)
- func (s *BrandService) Status(params product.StatusReq) error
- func (s *BrandService) Update(params product.BrandUpdateReq) error
- func (s *BrandService) View(params product.ViewReq) (*model.ProductBrand, error)
- type CateItem
- type CateNode
- type CateService
- func (s *CateService) Create(params product.CateCreateReq) error
- func (s *CateService) Delete(params product.MultiDeleteReq) error
- func (s *CateService) Index(params product.IndexReq) ([]*CateItem, error)
- func (s *CateService) List(params product.CateListReq) ([]*CateNode, error)
- func (s *CateService) Status(params product.StatusReq) error
- func (s *CateService) Update(params product.CateUpdateReq) error
- func (s *CateService) View(params product.ViewReq) (*model.ProductCategory, error)
- type ProductService
- func (s *ProductService) Create(params product.CreateReq) error
- func (s *ProductService) Delete(params product.DeleteReq) error
- func (s *ProductService) Index(params product.IndexReq) (*pagination.PaginateResp, error)
- func (s *ProductService) Status(params product.StatusReq) error
- func (s *ProductService) Update(params product.UpdateReq) error
- func (s *ProductService) View(params product.ViewReq) (*model.ProductGoods, error)
- type RegionService
- func (s *RegionService) GetAreaListByCity(params region.AreaReq) ([]*model.CAreas, error)
- func (s *RegionService) GetCityListByProvince(params region.CityReq) ([]*model.CCities, error)
- func (s *RegionService) GetProvinceList() ([]*model.CProvinces, error)
- func (s *RegionService) GetStreetListByArea(params region.StreetReq) ([]*model.CStreets, error)
- func (s *RegionService) GetVillageListByStreet(params region.VillageReq) ([]*model.CVillages, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Attachment = &AttachmentService{}
View Source
var AttrCate = &AttrCateService{}
View Source
var Brand = &BrandService{}
View Source
var Cate = &CateService{}
View Source
var Product = &ProductService{}
View Source
var Region = &RegionService{}
Functions ¶
This section is empty.
Types ¶
type AttachmentService ¶
func (*AttachmentService) Create ¶
func (s *AttachmentService) Create(userId string, params *upload.FileHeader) error
func (*AttachmentService) Index ¶
func (s *AttachmentService) Index(params attachment.IndexReq) (*pagination.PaginateResp, error)
Index ...
type AttrCateService ¶
func (*AttrCateService) AttrParamsCreate ¶
func (s *AttrCateService) AttrParamsCreate(params product.AttrCateAttrParamCreateReq) error
AttrParamsCreate ...
func (*AttrCateService) AttrParamsDelete ¶
func (s *AttrCateService) AttrParamsDelete(params product.MultiDeleteReq) error
AttrParamsDelete ...
func (*AttrCateService) AttrParamsList ¶
func (s *AttrCateService) AttrParamsList(params product.AttrCateAttrParamListReq) (*pagination.PaginateResp, error)
AttrParamsList ...
func (*AttrCateService) AttrParamsUpdate ¶
func (s *AttrCateService) AttrParamsUpdate(params product.AttrCateAttrParamUpdateReq) error
AttrParamsUpdate ...
func (*AttrCateService) Create ¶
func (s *AttrCateService) Create(params product.AttrCateCreateReq) error
Create ...
func (*AttrCateService) Delete ¶
func (s *AttrCateService) Delete(params product.MultiDeleteReq) error
Delete ...
func (*AttrCateService) Index ¶
func (s *AttrCateService) Index(params product.IndexReq) (*pagination.PaginateResp, error)
Index ...
func (*AttrCateService) List ¶
func (s *AttrCateService) List() ([]*model.ProductGoodsAttrCate, error)
List ...
func (*AttrCateService) Update ¶
func (s *AttrCateService) Update(params product.AttrCateUpdateReq) error
Update ...
func (*AttrCateService) View ¶
func (s *AttrCateService) View(params product.ViewReq) (*model.ProductGoodsAttrCate, error)
View ...
type BrandService ¶
func (*BrandService) Create ¶
func (s *BrandService) Create(params product.BrandCreateReq) error
Create ...
func (*BrandService) Delete ¶
func (s *BrandService) Delete(params product.MultiDeleteReq) error
Delete ...
func (*BrandService) Index ¶
func (s *BrandService) Index(params product.IndexReq) (*pagination.PaginateResp, error)
Index ...
func (*BrandService) Status ¶
func (s *BrandService) Status(params product.StatusReq) error
Status ...
func (*BrandService) Update ¶
func (s *BrandService) Update(params product.BrandUpdateReq) error
Update ...
func (*BrandService) View ¶
func (s *BrandService) View(params product.ViewReq) (*model.ProductBrand, error)
View ...
type CateItem ¶
type CateItem struct {
ID int64 `json:"id"`
CateName string `json:"cate_name"` // 分类名称
BannerCateID int64 `json:"banner_cate_id"` // 轮播图分类ID
CateURL string `json:"cate_url"` // 分类图标
CateDesc string `json:"cate_desc"` // 分类描述
SortOrder int `json:"sort_order"` // 排序
ParentID int64 `json:"parent_id"` // 父级ID
Path string `json:"path"` // ID路径 1-2-3-4...
IsHot int8 `json:"is_hot"` // 是否热门 1:热门 0:非热门
IsIndex int8 `json:"is_index"` // 是否首页 1:首页 0:非首页
Status int8 `json:"status"` // 状态 1:正常 0:下架
CreatedAt int64 `json:"created_at"` //
Children []*CateItem `json:"children"`
}
CateItem ...
func BuildHierarchy ¶
func BuildHierarchy(resources []*model.ProductCategory) []*CateItem
BuildHierarchy Function to build the hierarchical structure
type CateNode ¶
type CateNode struct {
ID int64 `json:"id"`
CateName string `json:"cate_name"` // 分类名称
BannerCateID int64 `json:"banner_cate_id"` // 轮播图分类ID
CateURL string `json:"cate_url"` // 分类图标
CateDesc string `json:"cate_desc"` // 分类描述
SortOrder int `json:"sort_order"` // 排序
ParentID int64 `json:"parent_id"` // 父级ID
Path string `json:"path"` // ID路径 1-2-3-4...
IsHot int8 `json:"is_hot"` // 是否热门 1:热门 0:非热门
IsIndex int8 `json:"is_index"` // 是否首页 1:首页 0:非首页
Status int8 `json:"status"` // 状态 1:正常 0:下架
CreatedAt int64 `json:"created_at"` //
Label string `json:"label"`
Level int `json:"level"`
}
CateNode Define a struct to hold the hierarchical data
func SortCategoriesTree ¶
func SortCategoriesTree(categories []*model.ProductCategory, parentID int64, level int) []*CateNode
SortCategoriesTree sorts the categories
type CateService ¶
func (*CateService) Create ¶
func (s *CateService) Create(params product.CateCreateReq) error
Create ...
func (*CateService) Delete ¶
func (s *CateService) Delete(params product.MultiDeleteReq) error
Delete ...
func (*CateService) Index ¶
func (s *CateService) Index(params product.IndexReq) ([]*CateItem, error)
Index ...
func (*CateService) List ¶
func (s *CateService) List(params product.CateListReq) ([]*CateNode, error)
List ...
func (*CateService) Status ¶
func (s *CateService) Status(params product.StatusReq) error
Status ...
func (*CateService) Update ¶
func (s *CateService) Update(params product.CateUpdateReq) error
Update ...
func (*CateService) View ¶
func (s *CateService) View(params product.ViewReq) (*model.ProductCategory, error)
View ...
type ProductService ¶
func (*ProductService) Create ¶
func (s *ProductService) Create(params product.CreateReq) error
Create
@Description: Todo @receiver s @param params @return error
func (*ProductService) Index ¶
func (s *ProductService) Index(params product.IndexReq) (*pagination.PaginateResp, error)
Index ...
func (*ProductService) Status ¶
func (s *ProductService) Status(params product.StatusReq) error
Status
@Description: Todo @receiver s @param params @return error
func (*ProductService) Update ¶
func (s *ProductService) Update(params product.UpdateReq) error
Update
@Description: Todo @receiver s @param params @return error
func (*ProductService) View ¶
func (s *ProductService) View(params product.ViewReq) (*model.ProductGoods, error)
View
@Description: Todo @receiver s @param id @return *model.ProductGoods @return error
type RegionService ¶
func (*RegionService) GetAreaListByCity ¶
GetAreaListByCity ...
func (*RegionService) GetCityListByProvince ¶
GetCityListByProvince ...
func (*RegionService) GetProvinceList ¶
func (s *RegionService) GetProvinceList() ([]*model.CProvinces, error)
GetProvinceList ...
func (*RegionService) GetStreetListByArea ¶
GetStreetListByArea ...
func (*RegionService) GetVillageListByStreet ¶
func (s *RegionService) GetVillageListByStreet(params region.VillageReq) ([]*model.CVillages, error)
GetVillageListByStreet ...
Click to show internal directories.
Click to hide internal directories.