package course

import "spaceofcheng/services/models/model"

// GetCourseTagsByPage 获取课程标签
func (c *CourseController) GetCourseTagsByPage() {
	orgid := c.GetString("orgid")
	if orgid == "" {
		org := c.Context.Get("org").(*model.SysOrg)
		orgid = org.OrgId
	}
	page, _ := c.GetInt("page")
	pageSize, _ := c.GetInt("pagesize")
	tags, err := c.dao.GetTagsList(orgid, page, pageSize)
	if err != nil {
		c.ResponseError(err)
	}
	c.ResponseJSON(tags)
}

// GetCourseTags 获取课程标签
func (c *CourseController) GetCourseTags() {
	orgid := c.GetString("orgid")
	if orgid == "" {
		org := c.Context.Get("org").(*model.SysOrg)
		orgid = org.OrgId
	}
	tags, err := c.dao.GetCourseTags(orgid)
	if err != nil {
		c.ResponseError(err)
	}
	c.ResponseJSON(tags)
}
