categories

package
v1.1.16 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 7 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) DeleteCategoryByIds added in v1.1.10

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

func (Authstruct) DeleteChannelCategoryids added in v1.0.59

func (c Authstruct) DeleteChannelCategoryids(channelCategory *TblChannelCategory, channelId [][]int, rowId []string, categoryId int, DB *gorm.DB) error

func (Authstruct) DeleteEntriesCategoryids added in v1.0.59

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

func (Authstruct) DeleteEntryCategoryids added in v1.1.14

func (c Authstruct) DeleteEntryCategoryids(channelCategory *TblChannelEntrie, entryId string, rowId int, 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) DeleteallCategoryByIds added in v1.1.9

func (c Authstruct) DeleteallCategoryByIds(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) GetCategoryByIds added in v1.0.75

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

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) GetChannelCategoryids added in v1.1.13

func (c Authstruct) GetChannelCategoryids(channelcategory *TblChannelCategory, DB *gorm.DB) (categories []string, rowIds []string, err error)

func (Authstruct) GetChildCategoriesById

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

func (Authstruct) GetEntryCategoryids added in v1.1.14

func (c Authstruct) GetEntryCategoryids(entryCategory *TblChannelEntrie, channelId int, DB *gorm.DB) (entries []string, categoryRowIds []string, entryRowIds []string, err error)

func (Authstruct) GetParentPageCategorys

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

func (Authstruct) GetParentTreeByChild added in v1.0.66

func (c Authstruct) GetParentTreeByChild(childID int, DB *gorm.DB) ([]TblCategory, error)

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) MultiDeleteChannelCategoryids added in v1.1.14

func (c Authstruct) MultiDeleteChannelCategoryids(channelCategory *TblChannelCategory, channelIds [][]int, rowId []string, categoryIds []int, DB *gorm.DB) error

func (Authstruct) MultiGetEntryCategoryids added in v1.1.14

func (c Authstruct) MultiGetEntryCategoryids(entryCategory *TblChannelEntrie, channelId []int, DB *gorm.DB) (entries []string, categoryRowIds []string, entryRowIds []string, err error)

func (Authstruct) MultiselectGetChannelCategoryids added in v1.1.14

func (c Authstruct) MultiselectGetChannelCategoryids(channelcategory *TblChannelCategory, DB *gorm.DB) (categories []string, rowIds []string, err error)

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 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 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) GetParentGivenByChildId added in v1.0.66

func (c Category) GetParentGivenByChildId(childcategoryid string) (category []TblCategory, err error)

this func helps to get parent hierarcy by child id

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) MultiSelectDeleteCategoryGroup added in v1.1.9

func (c Category) MultiSelectDeleteCategoryGroup(Categoryids []int) error

DeleteCategoryGroup

func (Category) MultiselectSubCategoryDelete added in v1.1.10

func (c Category) MultiselectSubCategoryDelete(Categoryids []int) error

Delete Multiselect subcategory//

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
}

type TblChannelEntrie added in v1.1.14

type TblChannelEntrie struct {
	Id              int
	Title           string
	Slug            string
	Description     string
	UserId          int
	ChannelId       int
	Status          int //0-draft 1-publish 2-unpublish
	CoverImage      string
	ThumbnailImage  string
	MetaTitle       string
	MetaDescription string
	Keyword         string
	CategoriesId    string
	RelatedArticles string
	Feature         int       `gorm:"DEFAULT:0"`
	ViewCount       int       `gorm:"DEFAULT:0"`
	CreateTime      time.Time `gorm:"DEFAULT:NULL"`
	PublishedTime   time.Time `gorm:"DEFAULT:NULL"`
	ImageAltTag     string
	Author          string
	SortOrder       int
	Excerpt         string
	ReadingTime     int
	Tags            string
	CreatedOn       time.Time
	CreatedBy       int
	ModifiedBy      int       `gorm:"DEFAULT:NULL"`
	ModifiedOn      time.Time `gorm:"DEFAULT:NULL"`
	IsActive        int
	IsDeleted       int       `gorm:"DEFAULT:0"`
	DeletedOn       time.Time `gorm:"DEFAULT:NULL"`
	DeletedBy       int       `gorm:"DEFAULT:NULL"`
}

Jump to

Keyboard shortcuts

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