backend

package
v0.0.0-...-573b8f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

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

type AttachmentService struct {
	service.Service
}

func (*AttachmentService) Create

func (s *AttachmentService) Create(userId string, params *upload.FileHeader) error

func (*AttachmentService) Index

Index ...

type AttrCateService

type AttrCateService struct {
	service.Service
}

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

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

Index ...

func (*AttrCateService) List

List ...

func (*AttrCateService) Update

func (s *AttrCateService) Update(params product.AttrCateUpdateReq) error

Update ...

func (*AttrCateService) View

View ...

type BrandService

type BrandService struct {
	service.Service
}

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

Index ...

func (*BrandService) List

func (s *BrandService) List() ([]*model.ProductBrand, error)

List ...

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

type CateService struct {
	service.Service
}

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

type ProductService struct {
	service.Service
}

func (*ProductService) Create

func (s *ProductService) Create(params product.CreateReq) error

Create

@Description: Todo
@receiver s
@param params
@return error

func (*ProductService) Delete

func (s *ProductService) Delete(params product.DeleteReq) error

func (*ProductService) Index

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

type RegionService struct {
	service.Service
}

func (*RegionService) GetAreaListByCity

func (s *RegionService) GetAreaListByCity(params region.AreaReq) ([]*model.CAreas, error)

GetAreaListByCity ...

func (*RegionService) GetCityListByProvince

func (s *RegionService) GetCityListByProvince(params region.CityReq) ([]*model.CCities, error)

GetCityListByProvince ...

func (*RegionService) GetProvinceList

func (s *RegionService) GetProvinceList() ([]*model.CProvinces, error)

GetProvinceList ...

func (*RegionService) GetStreetListByArea

func (s *RegionService) GetStreetListByArea(params region.StreetReq) ([]*model.CStreets, error)

GetStreetListByArea ...

func (*RegionService) GetVillageListByStreet

func (s *RegionService) GetVillageListByStreet(params region.VillageReq) ([]*model.CVillages, error)

GetVillageListByStreet ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址