categories

package
v1.0.65 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateTable

func MigrateTable(DB *gorm.DB)

Categories table migrate

Types

type Arrangecategories

type Arrangecategories struct {
	Categories []CatgoriesOrd
}

type Authstruct

type Authstruct struct{}
var C Authstruct

func (Authstruct) CheckCategoryGroupName

func (c Authstruct) CheckCategoryGroupName(category TblCategory, userid int, name string, DB *gorm.DB) error

Check category group name already exists

func (Authstruct) CheckSubCategoryName added in v1.0.51

func (c Authstruct) CheckSubCategoryName(category TblCategory, categoryid []int, currentid int, name string, DB *gorm.DB) error

Check sub category name already exists

func (Authstruct) CreateCategory

func (c Authstruct) CreateCategory(category *TblCategory, DB *gorm.DB) error

func (Authstruct) DeleteCategoryById

func (c Authstruct) DeleteCategoryById(category *TblCategory, categoryId int, DB *gorm.DB) error

func (Authstruct) DeleteChannelCategoryids added in v1.0.59

func (c Authstruct) DeleteChannelCategoryids(channelcategory *TblChannelCategory, cid string, DB *gorm.DB) error

func (Authstruct) DeleteEntriesCategoryids added in v1.0.59

func (c Authstruct) DeleteEntriesCategoryids(cid string, DB *gorm.DB) error

func (Authstruct) DeletePopup

func (c Authstruct) DeletePopup(category *TblCategory, id int, DB *gorm.DB) (categorylist TblCategory, err error)

delete sub category

func (Authstruct) DeleteallCategoryById added in v1.0.58

func (c Authstruct) DeleteallCategoryById(category *TblCategory, categoryId []int, spacecatid int, DB *gorm.DB) error

func (Authstruct) GetAllParentCategory

func (c Authstruct) GetAllParentCategory(categories *[]TblCategory, DB *gorm.DB) error

func (Authstruct) GetCategoryById

func (c Authstruct) GetCategoryById(category *TblCategory, categoryId int, DB *gorm.DB) (categorylist TblCategory, err error)

getCategory Details

func (Authstruct) GetCategoryDetails

func (c Authstruct) GetCategoryDetails(id int, category *TblCategory, DB *gorm.DB) (categorylist TblCategory, err error)

Get Childern list

func (Authstruct) GetCategoryList

func (c Authstruct) GetCategoryList(categories []TblCategory, offset int, limit int, filter Filter, DB *gorm.DB) (category []TblCategory, count int64)

Parent Category List

func (Authstruct) GetCategoryTree

func (c Authstruct) GetCategoryTree(categoryID int, DB *gorm.DB) ([]TblCategory, error)

func (Authstruct) GetChildCategoriesById

func (c Authstruct) GetChildCategoriesById(childCategories *[]TblCategory, parentId int, DB *gorm.DB) error

func (Authstruct) GetParentPageCategorys

func (c Authstruct) GetParentPageCategorys(category *[]TblCategory, parent_id int, DB *gorm.DB) (error, []TblCategory)

func (Authstruct) GetSubCategoryList

func (c Authstruct) GetSubCategoryList(categories *[]TblCategory, offset int, limit int, filter Filter, parent_id int, flag int, DB *gorm.DB) (categorylist *[]TblCategory, count int64)

Children Category List

func (Authstruct) UpdateCategory

func (c Authstruct) UpdateCategory(category *TblCategory, DB *gorm.DB) error

Update Children list

func (Authstruct) UpdateImagePath added in v1.0.61

func (c Authstruct) UpdateImagePath(Imagepath string, DB *gorm.DB) error

update imagepath

type Category

type Category struct {
	Authority *auth.Authorization
}

this struct holds dbconnection ,token

func (Category) AddCategory

func (c Category) AddCategory(req CategoryCreate) error

Add Category

func (Category) AllCategoriesWithSubList

func (c Category) AllCategoriesWithSubList() (arrangecategories []Arrangecategories, CategoryNames []string)

Get All cateogry with parents and subcategory

func (Category) CategoryGroupList

func (c Category) CategoryGroupList(limit int, offset int, filter Filter) (Categorylist []TblCategory, categorycount int64, err error)

List Category Group

func (Category) CheckCategroyGroupName

func (c Category) CheckCategroyGroupName(id int, name string) (bool, error)

func (Category) CheckSubCategroyName added in v1.0.51

func (c Category) CheckSubCategroyName(id []int, Currentcategoryid int, name string) (bool, error)

Check Sub category name already exists

func (Category) CreateCategoryGroup

func (c Category) CreateCategoryGroup(req CategoryCreate) error

Add Category Group

func (Category) DeleteCategoryGroup

func (c Category) DeleteCategoryGroup(Categoryid int) error

DeleteCategoryGroup

func (Category) DeletePopup

func (c Category) DeletePopup(categoryid int) (TblCategory, error)

Delete Sub Category

func (Category) DeleteSubCategory

func (c Category) DeleteSubCategory(categoryid int) error

Delete Sub Category

func (Category) FilterSubCategory

func (c Category) FilterSubCategory(limit int, filter Filter, parent_id int) (tblcat []TblCategory, categorycount int64, err error)

Filter Category

func (Category) GetSubCategoryDetails

func (c Category) GetSubCategoryDetails(categoryid int) (categorys TblCategory, err error)

func (Category) ListCategory

func (c Category) ListCategory(offset int, limit int, filter Filter, parent_id int) (tblcat []TblCategory, category []TblCategory, parentcategory TblCategory, categorycount int64, err error)

ListCategory

func (Category) UpdateCategoryGroup

func (c Category) UpdateCategoryGroup(req CategoryCreate) error

UpdateCategoryGroup

func (Category) UpdateImagePath added in v1.0.61

func (c Category) UpdateImagePath(ImagePath string) error

Remove entries cover image if media image delete

func (Category) UpdateSubCategory

func (c Category) UpdateSubCategory(req CategoryCreate) error

Update Sub category

type CategoryCreate

type CategoryCreate struct {
	Id           int
	CategoryName string
	CategorySlug string
	Description  string
	ImagePath    string
	ParentId     int
}

type CatgoriesOrd

type CatgoriesOrd struct {
	Id       int
	Category string
}

type Filter

type Filter struct {
	Keyword  string
	Category string
	Status   string
	FromDate string
	ToDate   string
}

type Result

type Result struct {
	CategoryName string
}

type TblCategory

type TblCategory struct {
	Id                 int
	CategoryName       string
	CategorySlug       string
	Description        string
	ImagePath          string
	CreatedOn          time.Time
	CreatedBy          int
	ModifiedOn         time.Time `gorm:"DEFAULT:NULL"`
	ModifiedBy         int       `gorm:"DEFAULT:NULL"`
	IsDeleted          int
	DeletedOn          time.Time `gorm:"DEFAULT:NULL"`
	DeletedBy          int       `gorm:"DEFAULT:NULL"`
	ParentId           int
	CreatedDate        string   `gorm:"-"`
	ModifiedDate       string   `gorm:"-"`
	DateString         string   `gorm:"-"`
	ParentCategoryName string   `gorm:"-"`
	Parent             []string `gorm:"-"`
	ParentWithChild    []Result `gorm:"-"`
}

func GetChildPageCategoriess

func GetChildPageCategoriess(category *TblCategory, category_id int, DB *gorm.DB) (error, TblCategory)

type TblChannelCategory added in v1.0.59

type TblChannelCategory struct {
	Id           int
	ChannelId    int
	CategoriesId string
	CreatedAt    int
	CreatedOn    time.Time
}

Jump to

Keyboard shortcuts

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