package router

import (
	"demo/data/dao/manage"
	"demo/data/domain"
	"demo/share"
	"fmt"
	"github.com/gin-gonic/gin"
	"github.com/mitchellh/mapstructure"
	"github.com/spf13/cast"
	"strings"
	"time"
	"unicode"
)

func UtilStructToMap(m map[string]interface{}) map[string]interface{} {
	res := make(map[string]interface{})
	for s := range m {
		result := ""
		for i, r := range s {
			if unicode.IsUpper(r) && i > 0 {
				result += "_"
			}
			result += strings.ToLower(string(r))
		}
		res[result] = m[s]
	}
	return res
}

func DateToString(date time.Time) string {
	return date.Format("2006-01-02 15:04:05")
}

//BaseArticleRouter(group)
//BaseArticleTagRouter(group)
//BaseArticleTopicRouter(group)
//BaseAuthorityRouter(group)
//BaseBackAuthorityRouter(group)
//BaseBackMenuRouter(group)
//BaseBackRoleRouter(group)
//BaseBackRoleAuthorityRouter(group)
//BaseBackRoleMenuRouter(group)
//BaseDictDataRouter(group)
//BaseDictTypeRouter(group)
//BaseGenTableRouter(group)
//BaseGenTableColumnRouter(group)
//BaseGoodsRouter(group)
//BaseGoodsCommodityAreaRouter(group)
//BaseGoodsCouponRouter(group)
//BaseGoodsCouponUserRouter(group)
//BaseGoodsIntroductionRouter(group)
//BaseGoodsOrderRouter(group)
//BaseGoodsSkuRouter(group)
//BaseGoodsSkuCardRouter(group)
//BaseGoodsTagRouter(group)
//BaseGoodsTypeRouter(group)
//BaseManageUserRouter(group)
//BaseShopAdviceCarouselRouter(group)
//BaseShopTopicRouter(group)
//BaseShopTopicSkuRouter(group)
//BaseUserRouter(group)
//BaseUserWalletRouter(group)

func BaseArticleRouter(group *gin.RouterGroup) {
	BaseArticleGroup := group.Group("/back/base")
	PushRouter(BaseArticleGroup, "GET", "/article", GetBaseArticleById)
	PushRouter(BaseArticleGroup, "POST", "/article/list", GetBaseArticleList)
	PushRouter(BaseArticleGroup, "POST", "/article/in", GetBaseArticleListInId)
	PushRouter(BaseArticleGroup, "POST", "/article", SaveBaseArticle)
	PushRouter(BaseArticleGroup, "PUT", "/article", UpdateBaseArticle)
	PushRouter(BaseArticleGroup, "DELETE", "/article", DeleteBaseArticle)
}

func BaseArticleTagRouter(group *gin.RouterGroup) {
	BaseArticleTagGroup := group.Group("/back/base")
	PushRouter(BaseArticleTagGroup, "GET", "/articleTag", GetBaseArticleTagById)
	PushRouter(BaseArticleTagGroup, "POST", "/articleTag/list", GetBaseArticleTagList)
	PushRouter(BaseArticleTagGroup, "POST", "/articleTag/in", GetBaseArticleTagListInId)
	PushRouter(BaseArticleTagGroup, "POST", "/articleTag", SaveBaseArticleTag)
	PushRouter(BaseArticleTagGroup, "PUT", "/articleTag", UpdateBaseArticleTag)
	PushRouter(BaseArticleTagGroup, "DELETE", "/articleTag", DeleteBaseArticleTag)
}

func BaseArticleTopicRouter(group *gin.RouterGroup) {
	BaseArticleTopicGroup := group.Group("/back/base")
	PushRouter(BaseArticleTopicGroup, "GET", "/articleTopic", GetBaseArticleTopicById)
	PushRouter(BaseArticleTopicGroup, "POST", "/articleTopic/list", GetBaseArticleTopicList)
	PushRouter(BaseArticleTopicGroup, "POST", "/articleTopic/in", GetBaseArticleTopicListInId)
	PushRouter(BaseArticleTopicGroup, "POST", "/articleTopic", SaveBaseArticleTopic)
	PushRouter(BaseArticleTopicGroup, "PUT", "/articleTopic", UpdateBaseArticleTopic)
	PushRouter(BaseArticleTopicGroup, "DELETE", "/articleTopic", DeleteBaseArticleTopic)
}

func BaseAuthorityRouter(group *gin.RouterGroup) {
	BaseAuthorityGroup := group.Group("/back/base")
	PushRouter(BaseAuthorityGroup, "GET", "/authority", GetBaseAuthorityById)
	PushRouter(BaseAuthorityGroup, "POST", "/authority/list", GetBaseAuthorityList)
	PushRouter(BaseAuthorityGroup, "POST", "/authority/in", GetBaseAuthorityListInId)
	PushRouter(BaseAuthorityGroup, "POST", "/authority", SaveBaseAuthority)
	PushRouter(BaseAuthorityGroup, "PUT", "/authority", UpdateBaseAuthority)
	PushRouter(BaseAuthorityGroup, "DELETE", "/authority", DeleteBaseAuthority)
}

func BaseBackAuthorityRouter(group *gin.RouterGroup) {
	BaseBackAuthorityGroup := group.Group("/back/base")
	PushRouter(BaseBackAuthorityGroup, "GET", "/backAuthority", GetBaseBackAuthorityById)
	PushRouter(BaseBackAuthorityGroup, "POST", "/backAuthority/list", GetBaseBackAuthorityList)
	PushRouter(BaseBackAuthorityGroup, "POST", "/backAuthority/in", GetBaseBackAuthorityListInId)
	PushRouter(BaseBackAuthorityGroup, "POST", "/backAuthority", SaveBaseBackAuthority)
	PushRouter(BaseBackAuthorityGroup, "PUT", "/backAuthority", UpdateBaseBackAuthority)
	PushRouter(BaseBackAuthorityGroup, "DELETE", "/backAuthority", DeleteBaseBackAuthority)
}

func BaseBackMenuRouter(group *gin.RouterGroup) {
	BaseBackMenuGroup := group.Group("/back/base")
	PushRouter(BaseBackMenuGroup, "GET", "/backMenu", GetBaseBackMenuById)
	PushRouter(BaseBackMenuGroup, "POST", "/backMenu/list", GetBaseBackMenuList)
	PushRouter(BaseBackMenuGroup, "POST", "/backMenu/in", GetBaseBackMenuListInId)
	PushRouter(BaseBackMenuGroup, "POST", "/backMenu", SaveBaseBackMenu)
	PushRouter(BaseBackMenuGroup, "PUT", "/backMenu", UpdateBaseBackMenu)
	PushRouter(BaseBackMenuGroup, "DELETE", "/backMenu", DeleteBaseBackMenu)
}

func BaseBackRoleRouter(group *gin.RouterGroup) {
	BaseBackRoleGroup := group.Group("/back/base")
	PushRouter(BaseBackRoleGroup, "GET", "/backRole", GetBaseBackRoleById)
	PushRouter(BaseBackRoleGroup, "POST", "/backRole/list", GetBaseBackRoleList)
	PushRouter(BaseBackRoleGroup, "POST", "/backRole/in", GetBaseBackRoleListInId)
	PushRouter(BaseBackRoleGroup, "POST", "/backRole", SaveBaseBackRole)
	PushRouter(BaseBackRoleGroup, "PUT", "/backRole", UpdateBaseBackRole)
	PushRouter(BaseBackRoleGroup, "DELETE", "/backRole", DeleteBaseBackRole)
}

func BaseBackRoleAuthorityRouter(group *gin.RouterGroup) {
	BaseBackRoleAuthorityGroup := group.Group("/back/base")
	PushRouter(BaseBackRoleAuthorityGroup, "GET", "/backRoleAuthority", GetBaseBackRoleAuthorityById)
	PushRouter(BaseBackRoleAuthorityGroup, "POST", "/backRoleAuthority/list", GetBaseBackRoleAuthorityList)
	PushRouter(BaseBackRoleAuthorityGroup, "POST", "/backRoleAuthority/in", GetBaseBackRoleAuthorityListInId)
	PushRouter(BaseBackRoleAuthorityGroup, "POST", "/backRoleAuthority", SaveBaseBackRoleAuthority)
	PushRouter(BaseBackRoleAuthorityGroup, "PUT", "/backRoleAuthority", UpdateBaseBackRoleAuthority)
	PushRouter(BaseBackRoleAuthorityGroup, "DELETE", "/backRoleAuthority", DeleteBaseBackRoleAuthority)
}

func BaseBackRoleMenuRouter(group *gin.RouterGroup) {
	BaseBackRoleMenuGroup := group.Group("/back/base")
	PushRouter(BaseBackRoleMenuGroup, "GET", "/backRoleMenu", GetBaseBackRoleMenuById)
	PushRouter(BaseBackRoleMenuGroup, "POST", "/backRoleMenu/list", GetBaseBackRoleMenuList)
	PushRouter(BaseBackRoleMenuGroup, "POST", "/backRoleMenu/in", GetBaseBackRoleMenuListInId)
	PushRouter(BaseBackRoleMenuGroup, "POST", "/backRoleMenu", SaveBaseBackRoleMenu)
	PushRouter(BaseBackRoleMenuGroup, "PUT", "/backRoleMenu", UpdateBaseBackRoleMenu)
	PushRouter(BaseBackRoleMenuGroup, "DELETE", "/backRoleMenu", DeleteBaseBackRoleMenu)
}

func BaseDictDataRouter(group *gin.RouterGroup) {
	BaseDictDataGroup := group.Group("/back/base")
	PushRouter(BaseDictDataGroup, "GET", "/dictData", GetBaseDictDataById)
	PushRouter(BaseDictDataGroup, "POST", "/dictData/list", GetBaseDictDataList)
	PushRouter(BaseDictDataGroup, "POST", "/dictData/in", GetBaseDictDataListInId)
	PushRouter(BaseDictDataGroup, "POST", "/dictData", SaveBaseDictData)
	PushRouter(BaseDictDataGroup, "PUT", "/dictData", UpdateBaseDictData)
	PushRouter(BaseDictDataGroup, "DELETE", "/dictData", DeleteBaseDictData)
}

func BaseDictTypeRouter(group *gin.RouterGroup) {
	BaseDictTypeGroup := group.Group("/back/base")
	PushRouter(BaseDictTypeGroup, "GET", "/dictType", GetBaseDictTypeById)
	PushRouter(BaseDictTypeGroup, "POST", "/dictType/list", GetBaseDictTypeList)
	PushRouter(BaseDictTypeGroup, "POST", "/dictType/in", GetBaseDictTypeListInId)
	PushRouter(BaseDictTypeGroup, "POST", "/dictType", SaveBaseDictType)
	PushRouter(BaseDictTypeGroup, "PUT", "/dictType", UpdateBaseDictType)
	PushRouter(BaseDictTypeGroup, "DELETE", "/dictType", DeleteBaseDictType)
}

func BaseGenTableRouter(group *gin.RouterGroup) {
	BaseGenTableGroup := group.Group("/back/base")
	PushRouter(BaseGenTableGroup, "GET", "/genTable", GetBaseGenTableById)
	PushRouter(BaseGenTableGroup, "POST", "/genTable/list", GetBaseGenTableList)
	PushRouter(BaseGenTableGroup, "POST", "/genTable/in", GetBaseGenTableListInId)
	PushRouter(BaseGenTableGroup, "POST", "/genTable", SaveBaseGenTable)
	PushRouter(BaseGenTableGroup, "PUT", "/genTable", UpdateBaseGenTable)
	PushRouter(BaseGenTableGroup, "DELETE", "/genTable", DeleteBaseGenTable)
}

func BaseGenTableColumnRouter(group *gin.RouterGroup) {
	BaseGenTableColumnGroup := group.Group("/back/base")
	PushRouter(BaseGenTableColumnGroup, "GET", "/genTableColumn", GetBaseGenTableColumnById)
	PushRouter(BaseGenTableColumnGroup, "POST", "/genTableColumn/list", GetBaseGenTableColumnList)
	PushRouter(BaseGenTableColumnGroup, "POST", "/genTableColumn/in", GetBaseGenTableColumnListInId)
	PushRouter(BaseGenTableColumnGroup, "POST", "/genTableColumn", SaveBaseGenTableColumn)
	PushRouter(BaseGenTableColumnGroup, "PUT", "/genTableColumn", UpdateBaseGenTableColumn)
	PushRouter(BaseGenTableColumnGroup, "DELETE", "/genTableColumn", DeleteBaseGenTableColumn)
}

func BaseGoodsRouter(group *gin.RouterGroup) {
	BaseGoodsGroup := group.Group("/back/base")
	PushRouter(BaseGoodsGroup, "GET", "/goods", GetBaseGoodsById)
	PushRouter(BaseGoodsGroup, "POST", "/goods/list", GetBaseGoodsList)
	PushRouter(BaseGoodsGroup, "POST", "/goods/in", GetBaseGoodsListInId)
	PushRouter(BaseGoodsGroup, "POST", "/goods", SaveBaseGoods)
	PushRouter(BaseGoodsGroup, "PUT", "/goods", UpdateBaseGoods)
	PushRouter(BaseGoodsGroup, "DELETE", "/goods", DeleteBaseGoods)
}

func BaseGoodsCommodityAreaRouter(group *gin.RouterGroup) {
	BaseGoodsCommodityAreaGroup := group.Group("/back/base")
	PushRouter(BaseGoodsCommodityAreaGroup, "GET", "/goodsCommodityArea", GetBaseGoodsCommodityAreaById)
	PushRouter(BaseGoodsCommodityAreaGroup, "POST", "/goodsCommodityArea/list", GetBaseGoodsCommodityAreaList)
	PushRouter(BaseGoodsCommodityAreaGroup, "POST", "/goodsCommodityArea/in", GetBaseGoodsCommodityAreaListInId)
	PushRouter(BaseGoodsCommodityAreaGroup, "POST", "/goodsCommodityArea", SaveBaseGoodsCommodityArea)
	PushRouter(BaseGoodsCommodityAreaGroup, "PUT", "/goodsCommodityArea", UpdateBaseGoodsCommodityArea)
	PushRouter(BaseGoodsCommodityAreaGroup, "DELETE", "/goodsCommodityArea", DeleteBaseGoodsCommodityArea)
}

func BaseGoodsCouponRouter(group *gin.RouterGroup) {
	BaseGoodsCouponGroup := group.Group("/back/base")
	PushRouter(BaseGoodsCouponGroup, "GET", "/goodsCoupon", GetBaseGoodsCouponById)
	PushRouter(BaseGoodsCouponGroup, "POST", "/goodsCoupon/list", GetBaseGoodsCouponList)
	PushRouter(BaseGoodsCouponGroup, "POST", "/goodsCoupon/in", GetBaseGoodsCouponListInId)
	PushRouter(BaseGoodsCouponGroup, "POST", "/goodsCoupon", SaveBaseGoodsCoupon)
	PushRouter(BaseGoodsCouponGroup, "PUT", "/goodsCoupon", UpdateBaseGoodsCoupon)
	PushRouter(BaseGoodsCouponGroup, "DELETE", "/goodsCoupon", DeleteBaseGoodsCoupon)
}

func BaseGoodsCouponUserRouter(group *gin.RouterGroup) {
	BaseGoodsCouponUserGroup := group.Group("/back/base")
	PushRouter(BaseGoodsCouponUserGroup, "GET", "/goodsCouponUser", GetBaseGoodsCouponUserById)
	PushRouter(BaseGoodsCouponUserGroup, "POST", "/goodsCouponUser/list", GetBaseGoodsCouponUserList)
	PushRouter(BaseGoodsCouponUserGroup, "POST", "/goodsCouponUser/in", GetBaseGoodsCouponUserListInId)
	PushRouter(BaseGoodsCouponUserGroup, "POST", "/goodsCouponUser", SaveBaseGoodsCouponUser)
	PushRouter(BaseGoodsCouponUserGroup, "PUT", "/goodsCouponUser", UpdateBaseGoodsCouponUser)
	PushRouter(BaseGoodsCouponUserGroup, "DELETE", "/goodsCouponUser", DeleteBaseGoodsCouponUser)
}

func BaseGoodsIntroductionRouter(group *gin.RouterGroup) {
	BaseGoodsIntroductionGroup := group.Group("/back/base")
	PushRouter(BaseGoodsIntroductionGroup, "GET", "/goodsIntroduction", GetBaseGoodsIntroductionById)
	PushRouter(BaseGoodsIntroductionGroup, "POST", "/goodsIntroduction/list", GetBaseGoodsIntroductionList)
	PushRouter(BaseGoodsIntroductionGroup, "POST", "/goodsIntroduction/in", GetBaseGoodsIntroductionListInId)
	PushRouter(BaseGoodsIntroductionGroup, "POST", "/goodsIntroduction", SaveBaseGoodsIntroduction)
	PushRouter(BaseGoodsIntroductionGroup, "PUT", "/goodsIntroduction", UpdateBaseGoodsIntroduction)
	PushRouter(BaseGoodsIntroductionGroup, "DELETE", "/goodsIntroduction", DeleteBaseGoodsIntroduction)
}

func BaseGoodsOrderRouter(group *gin.RouterGroup) {
	BaseGoodsOrderGroup := group.Group("/back/base")
	PushRouter(BaseGoodsOrderGroup, "GET", "/goodsOrder", GetBaseGoodsOrderById)
	PushRouter(BaseGoodsOrderGroup, "POST", "/goodsOrder/list", GetBaseGoodsOrderList)
	PushRouter(BaseGoodsOrderGroup, "POST", "/goodsOrder/in", GetBaseGoodsOrderListInId)
	PushRouter(BaseGoodsOrderGroup, "POST", "/goodsOrder", SaveBaseGoodsOrder)
	PushRouter(BaseGoodsOrderGroup, "PUT", "/goodsOrder", UpdateBaseGoodsOrder)
	PushRouter(BaseGoodsOrderGroup, "DELETE", "/goodsOrder", DeleteBaseGoodsOrder)
}

func BaseGoodsSkuRouter(group *gin.RouterGroup) {
	BaseGoodsSkuGroup := group.Group("/back/base")
	PushRouter(BaseGoodsSkuGroup, "GET", "/goodsSku", GetBaseGoodsSkuById)
	PushRouter(BaseGoodsSkuGroup, "POST", "/goodsSku/list", GetBaseGoodsSkuList)
	PushRouter(BaseGoodsSkuGroup, "POST", "/goodsSku/in", GetBaseGoodsSkuListInId)
	PushRouter(BaseGoodsSkuGroup, "POST", "/goodsSku", SaveBaseGoodsSku)
	PushRouter(BaseGoodsSkuGroup, "PUT", "/goodsSku", UpdateBaseGoodsSku)
	PushRouter(BaseGoodsSkuGroup, "DELETE", "/goodsSku", DeleteBaseGoodsSku)
}

func BaseGoodsSkuCardRouter(group *gin.RouterGroup) {
	BaseGoodsSkuCardGroup := group.Group("/back/base")
	PushRouter(BaseGoodsSkuCardGroup, "GET", "/goodsSkuCard", GetBaseGoodsSkuCardById)
	PushRouter(BaseGoodsSkuCardGroup, "POST", "/goodsSkuCard/list", GetBaseGoodsSkuCardList)
	PushRouter(BaseGoodsSkuCardGroup, "POST", "/goodsSkuCard/in", GetBaseGoodsSkuCardListInId)
	PushRouter(BaseGoodsSkuCardGroup, "POST", "/goodsSkuCard", SaveBaseGoodsSkuCard)
	PushRouter(BaseGoodsSkuCardGroup, "PUT", "/goodsSkuCard", UpdateBaseGoodsSkuCard)
	PushRouter(BaseGoodsSkuCardGroup, "DELETE", "/goodsSkuCard", DeleteBaseGoodsSkuCard)
}

func BaseGoodsTagRouter(group *gin.RouterGroup) {
	BaseGoodsTagGroup := group.Group("/back/base")
	PushRouter(BaseGoodsTagGroup, "GET", "/goodsTag", GetBaseGoodsTagById)
	PushRouter(BaseGoodsTagGroup, "POST", "/goodsTag/list", GetBaseGoodsTagList)
	PushRouter(BaseGoodsTagGroup, "POST", "/goodsTag/in", GetBaseGoodsTagListInId)
	PushRouter(BaseGoodsTagGroup, "POST", "/goodsTag", SaveBaseGoodsTag)
	PushRouter(BaseGoodsTagGroup, "PUT", "/goodsTag", UpdateBaseGoodsTag)
	PushRouter(BaseGoodsTagGroup, "DELETE", "/goodsTag", DeleteBaseGoodsTag)
}

func BaseGoodsTypeRouter(group *gin.RouterGroup) {
	BaseGoodsTypeGroup := group.Group("/back/base")
	PushRouter(BaseGoodsTypeGroup, "GET", "/goodsType", GetBaseGoodsTypeById)
	PushRouter(BaseGoodsTypeGroup, "POST", "/goodsType/list", GetBaseGoodsTypeList)
	PushRouter(BaseGoodsTypeGroup, "POST", "/goodsType/in", GetBaseGoodsTypeListInId)
	PushRouter(BaseGoodsTypeGroup, "POST", "/goodsType", SaveBaseGoodsType)
	PushRouter(BaseGoodsTypeGroup, "PUT", "/goodsType", UpdateBaseGoodsType)
	PushRouter(BaseGoodsTypeGroup, "DELETE", "/goodsType", DeleteBaseGoodsType)
}

func BaseManageUserRouter(group *gin.RouterGroup) {
	BaseManageUserGroup := group.Group("/back/base")
	PushRouter(BaseManageUserGroup, "GET", "/manageUser", GetBaseManageUserById)
	PushRouter(BaseManageUserGroup, "POST", "/manageUser/list", GetBaseManageUserList)
	PushRouter(BaseManageUserGroup, "POST", "/manageUser/in", GetBaseManageUserListInId)
	PushRouter(BaseManageUserGroup, "POST", "/manageUser", SaveBaseManageUser)
	PushRouter(BaseManageUserGroup, "PUT", "/manageUser", UpdateBaseManageUser)
	PushRouter(BaseManageUserGroup, "DELETE", "/manageUser", DeleteBaseManageUser)
}

func BaseShopAdviceCarouselRouter(group *gin.RouterGroup) {
	BaseShopAdviceCarouselGroup := group.Group("/back/base")
	PushRouter(BaseShopAdviceCarouselGroup, "GET", "/shopAdviceCarousel", GetBaseShopAdviceCarouselById)
	PushRouter(BaseShopAdviceCarouselGroup, "POST", "/shopAdviceCarousel/list", GetBaseShopAdviceCarouselList)
	PushRouter(BaseShopAdviceCarouselGroup, "POST", "/shopAdviceCarousel/in", GetBaseShopAdviceCarouselListInId)
	PushRouter(BaseShopAdviceCarouselGroup, "POST", "/shopAdviceCarousel", SaveBaseShopAdviceCarousel)
	PushRouter(BaseShopAdviceCarouselGroup, "PUT", "/shopAdviceCarousel", UpdateBaseShopAdviceCarousel)
	PushRouter(BaseShopAdviceCarouselGroup, "DELETE", "/shopAdviceCarousel", DeleteBaseShopAdviceCarousel)
}

func BaseShopTopicRouter(group *gin.RouterGroup) {
	BaseShopTopicGroup := group.Group("/back/base")
	PushRouter(BaseShopTopicGroup, "GET", "/shopTopic", GetBaseShopTopicById)
	PushRouter(BaseShopTopicGroup, "POST", "/shopTopic/list", GetBaseShopTopicList)
	PushRouter(BaseShopTopicGroup, "POST", "/shopTopic/in", GetBaseShopTopicListInId)
	PushRouter(BaseShopTopicGroup, "POST", "/shopTopic", SaveBaseShopTopic)
	PushRouter(BaseShopTopicGroup, "PUT", "/shopTopic", UpdateBaseShopTopic)
	PushRouter(BaseShopTopicGroup, "DELETE", "/shopTopic", DeleteBaseShopTopic)
}

func BaseShopTopicSkuRouter(group *gin.RouterGroup) {
	BaseShopTopicSkuGroup := group.Group("/back/base")
	PushRouter(BaseShopTopicSkuGroup, "GET", "/shopTopicSku", GetBaseShopTopicSkuById)
	PushRouter(BaseShopTopicSkuGroup, "POST", "/shopTopicSku/list", GetBaseShopTopicSkuList)
	PushRouter(BaseShopTopicSkuGroup, "POST", "/shopTopicSku/in", GetBaseShopTopicSkuListInId)
	PushRouter(BaseShopTopicSkuGroup, "POST", "/shopTopicSku", SaveBaseShopTopicSku)
	PushRouter(BaseShopTopicSkuGroup, "PUT", "/shopTopicSku", UpdateBaseShopTopicSku)
	PushRouter(BaseShopTopicSkuGroup, "DELETE", "/shopTopicSku", DeleteBaseShopTopicSku)
}

func BaseUserRouter(group *gin.RouterGroup) {
	BaseUserGroup := group.Group("/back/base")
	PushRouter(BaseUserGroup, "GET", "/user", GetBaseUserById)
	PushRouter(BaseUserGroup, "POST", "/user/list", GetBaseUserList)
	PushRouter(BaseUserGroup, "POST", "/user/in", GetBaseUserListInId)
	PushRouter(BaseUserGroup, "POST", "/user", SaveBaseUser)
	PushRouter(BaseUserGroup, "PUT", "/user", UpdateBaseUser)
	PushRouter(BaseUserGroup, "DELETE", "/user", DeleteBaseUser)
}

func BaseUserWalletRouter(group *gin.RouterGroup) {
	BaseUserWalletGroup := group.Group("/back/base")
	PushRouter(BaseUserWalletGroup, "GET", "/userWallet", GetBaseUserWalletById)
	PushRouter(BaseUserWalletGroup, "POST", "/userWallet/list", GetBaseUserWalletList)
	PushRouter(BaseUserWalletGroup, "POST", "/userWallet/in", GetBaseUserWalletListInId)
	PushRouter(BaseUserWalletGroup, "POST", "/userWallet", SaveBaseUserWallet)
	PushRouter(BaseUserWalletGroup, "PUT", "/userWallet", UpdateBaseUserWallet)
	PushRouter(BaseUserWalletGroup, "DELETE", "/userWallet", DeleteBaseUserWallet)
}

func GetBaseArticleById(c *gin.Context) {
	id := c.Query("id")
	article, err := manage.GetArticleById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(article))
	return
}

func GetBaseArticleList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	article := domain.Article{}
	err := mapstructure.Decode(param, &article)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetArticleList(article, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseArticleListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetArticleListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseArticle(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	articleParam, _ := data("article")
	article := domain.Article{}
	err := mapstructure.Decode(articleParam, &article)
	article.CreateBy = fmt.Sprint(GetUserIdByToken(c))
	article.CreateTime = time.Now()
	saveArticle, err := manage.SaveArticle(&article)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveArticle))
}

func UpdateBaseArticle(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	article, _ := data("article")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(article))
	toMap["create_by"] = nil
	toMap["create_time"] = nil
	toMap["update_by"] = fmt.Sprint(GetUserIdByToken(c))
	toMap["update_time"] = DateToString(time.Now())
	setArticle, b, err := manage.SetArticle(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setArticle))
}

func DeleteBaseArticle(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteArticle(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseArticleTagById(c *gin.Context) {
	id := c.Query("id")
	articleTag, err := manage.GetArticleTagById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(articleTag))
	return
}

func GetBaseArticleTagList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	articleTag := domain.ArticleTag{}
	err := mapstructure.Decode(param, &articleTag)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetArticleTagList(articleTag, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseArticleTagListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetArticleTagListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseArticleTag(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	articleTagParam, _ := data("articleTag")
	articleTag := domain.ArticleTag{}
	err := mapstructure.Decode(articleTagParam, &articleTag)
	saveArticleTag, err := manage.SaveArticleTag(&articleTag)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveArticleTag))
}

func UpdateBaseArticleTag(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	articleTag, _ := data("articleTag")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(articleTag))
	setArticleTag, b, err := manage.SetArticleTag(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setArticleTag))
}

func DeleteBaseArticleTag(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteArticleTag(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseArticleTopicById(c *gin.Context) {
	id := c.Query("id")
	articleTopic, err := manage.GetArticleTopicById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(articleTopic))
	return
}

func GetBaseArticleTopicList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	articleTopic := domain.ArticleTopic{}
	err := mapstructure.Decode(param, &articleTopic)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetArticleTopicList(articleTopic, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseArticleTopicListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetArticleTopicListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseArticleTopic(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	articleTopicParam, _ := data("articleTopic")
	articleTopic := domain.ArticleTopic{}
	err := mapstructure.Decode(articleTopicParam, &articleTopic)
	saveArticleTopic, err := manage.SaveArticleTopic(&articleTopic)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveArticleTopic))
}

func UpdateBaseArticleTopic(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	articleTopic, _ := data("articleTopic")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(articleTopic))
	setArticleTopic, b, err := manage.SetArticleTopic(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setArticleTopic))
}

func DeleteBaseArticleTopic(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteArticleTopic(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseAuthorityById(c *gin.Context) {
	id := c.Query("id")
	authority, err := manage.GetAuthorityById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(authority))
	return
}

func GetBaseAuthorityList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	authority := domain.Authority{}
	err := mapstructure.Decode(param, &authority)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetAuthorityList(authority, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseAuthorityListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetAuthorityListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseAuthority(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	authorityParam, _ := data("authority")
	authority := domain.Authority{}
	err := mapstructure.Decode(authorityParam, &authority)
	saveAuthority, err := manage.SaveAuthority(&authority)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveAuthority))
}

func UpdateBaseAuthority(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	authority, _ := data("authority")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(authority))
	setAuthority, b, err := manage.SetAuthority(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setAuthority))
}

func DeleteBaseAuthority(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteAuthority(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseBackAuthorityById(c *gin.Context) {
	id := c.Query("id")
	backAuthority, err := manage.GetBackAuthorityById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(backAuthority))
	return
}

func GetBaseBackAuthorityList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	backAuthority := domain.BackAuthority{}
	err := mapstructure.Decode(param, &backAuthority)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetBackAuthorityList(backAuthority, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseBackAuthorityListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetBackAuthorityListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseBackAuthority(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backAuthorityParam, _ := data("backAuthority")
	backAuthority := domain.BackAuthority{}
	err := mapstructure.Decode(backAuthorityParam, &backAuthority)
	backAuthority.CreateTime = time.Now()
	saveBackAuthority, err := manage.SaveBackAuthority(&backAuthority)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveBackAuthority))
}

func UpdateBaseBackAuthority(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backAuthority, _ := data("backAuthority")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(backAuthority))
	setBackAuthority, b, err := manage.SetBackAuthority(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setBackAuthority))
}

func DeleteBaseBackAuthority(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteBackAuthority(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseBackMenuById(c *gin.Context) {
	id := c.Query("id")
	backMenu, err := manage.GetBackMenuById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(backMenu))
	return
}

func GetBaseBackMenuList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	backMenu := domain.BackMenu{}
	err := mapstructure.Decode(param, &backMenu)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetBackMenuList(backMenu, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseBackMenuListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetBackMenuListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseBackMenu(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backMenuParam, _ := data("backMenu")
	backMenu := domain.BackMenu{}
	err := mapstructure.Decode(backMenuParam, &backMenu)
	saveBackMenu, err := manage.SaveBackMenu(&backMenu)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveBackMenu))
}

func UpdateBaseBackMenu(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backMenu, _ := data("backMenu")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(backMenu))
	setBackMenu, b, err := manage.SetBackMenu(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setBackMenu))
}

func DeleteBaseBackMenu(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteBackMenu(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseBackRoleById(c *gin.Context) {
	id := c.Query("id")
	backRole, err := manage.GetBackRoleById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(backRole))
	return
}

func GetBaseBackRoleList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	backRole := domain.BackRole{}
	err := mapstructure.Decode(param, &backRole)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetBackRoleList(backRole, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseBackRoleListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetBackRoleListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseBackRole(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backRoleParam, _ := data("backRole")
	backRole := domain.BackRole{}
	err := mapstructure.Decode(backRoleParam, &backRole)
	saveBackRole, err := manage.SaveBackRole(&backRole)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveBackRole))
}

func UpdateBaseBackRole(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backRole, _ := data("backRole")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(backRole))
	setBackRole, b, err := manage.SetBackRole(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setBackRole))
}

func DeleteBaseBackRole(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteBackRole(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseBackRoleAuthorityById(c *gin.Context) {
	id := c.Query("id")
	backRoleAuthority, err := manage.GetBackRoleAuthorityById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(backRoleAuthority))
	return
}

func GetBaseBackRoleAuthorityList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	backRoleAuthority := domain.BackRoleAuthority{}
	err := mapstructure.Decode(param, &backRoleAuthority)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetBackRoleAuthorityList(backRoleAuthority, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseBackRoleAuthorityListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetBackRoleAuthorityListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseBackRoleAuthority(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backRoleAuthorityParam, _ := data("backRoleAuthority")
	backRoleAuthority := domain.BackRoleAuthority{}
	err := mapstructure.Decode(backRoleAuthorityParam, &backRoleAuthority)
	saveBackRoleAuthority, err := manage.SaveBackRoleAuthority(&backRoleAuthority)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveBackRoleAuthority))
}

func UpdateBaseBackRoleAuthority(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backRoleAuthority, _ := data("backRoleAuthority")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(backRoleAuthority))
	setBackRoleAuthority, b, err := manage.SetBackRoleAuthority(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setBackRoleAuthority))
}

func DeleteBaseBackRoleAuthority(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteBackRoleAuthority(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseBackRoleMenuById(c *gin.Context) {
	id := c.Query("id")
	backRoleMenu, err := manage.GetBackRoleMenuById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(backRoleMenu))
	return
}

func GetBaseBackRoleMenuList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	backRoleMenu := domain.BackRoleMenu{}
	err := mapstructure.Decode(param, &backRoleMenu)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetBackRoleMenuList(backRoleMenu, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseBackRoleMenuListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetBackRoleMenuListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseBackRoleMenu(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backRoleMenuParam, _ := data("backRoleMenu")
	backRoleMenu := domain.BackRoleMenu{}
	err := mapstructure.Decode(backRoleMenuParam, &backRoleMenu)
	saveBackRoleMenu, err := manage.SaveBackRoleMenu(&backRoleMenu)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveBackRoleMenu))
}

func UpdateBaseBackRoleMenu(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	backRoleMenu, _ := data("backRoleMenu")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(backRoleMenu))
	setBackRoleMenu, b, err := manage.SetBackRoleMenu(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setBackRoleMenu))
}

func DeleteBaseBackRoleMenu(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteBackRoleMenu(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseDictDataById(c *gin.Context) {
	id := c.Query("id")
	dictData, err := manage.GetDictDataById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(dictData))
	return
}

func GetBaseDictDataList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	dictData := domain.DictData{}
	err := mapstructure.Decode(param, &dictData)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetDictDataList(dictData, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseDictDataListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetDictDataListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseDictData(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	dictDataParam, _ := data("dictData")
	dictData := domain.DictData{}
	err := mapstructure.Decode(dictDataParam, &dictData)
	saveDictData, err := manage.SaveDictData(&dictData)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveDictData))
}

func UpdateBaseDictData(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	dictData, _ := data("dictData")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(dictData))
	setDictData, b, err := manage.SetDictData(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setDictData))
}

func DeleteBaseDictData(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteDictData(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseDictTypeById(c *gin.Context) {
	id := c.Query("id")
	dictType, err := manage.GetDictTypeById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(dictType))
	return
}

func GetBaseDictTypeList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	dictType := domain.DictType{}
	err := mapstructure.Decode(param, &dictType)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetDictTypeList(dictType, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseDictTypeListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetDictTypeListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseDictType(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	dictTypeParam, _ := data("dictType")
	dictType := domain.DictType{}
	err := mapstructure.Decode(dictTypeParam, &dictType)
	saveDictType, err := manage.SaveDictType(&dictType)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveDictType))
}

func UpdateBaseDictType(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	dictType, _ := data("dictType")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(dictType))
	setDictType, b, err := manage.SetDictType(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setDictType))
}

func DeleteBaseDictType(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteDictType(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGenTableById(c *gin.Context) {
	id := c.Query("id")
	genTable, err := manage.GetGenTableById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(genTable))
	return
}

func GetBaseGenTableList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	genTable := domain.GenTable{}
	err := mapstructure.Decode(param, &genTable)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGenTableList(genTable, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGenTableListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGenTableListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGenTable(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	genTableParam, _ := data("genTable")
	genTable := domain.GenTable{}
	err := mapstructure.Decode(genTableParam, &genTable)
	saveGenTable, err := manage.SaveGenTable(&genTable)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGenTable))
}

func UpdateBaseGenTable(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	genTable, _ := data("genTable")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(genTable))
	setGenTable, b, err := manage.SetGenTable(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGenTable))
}

func DeleteBaseGenTable(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGenTable(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGenTableColumnById(c *gin.Context) {
	id := c.Query("id")
	genTableColumn, err := manage.GetGenTableColumnById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(genTableColumn))
	return
}

func GetBaseGenTableColumnList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	genTableColumn := domain.GenTableColumn{}
	err := mapstructure.Decode(param, &genTableColumn)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGenTableColumnList(genTableColumn, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGenTableColumnListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGenTableColumnListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGenTableColumn(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	genTableColumnParam, _ := data("genTableColumn")
	genTableColumn := domain.GenTableColumn{}
	err := mapstructure.Decode(genTableColumnParam, &genTableColumn)
	saveGenTableColumn, err := manage.SaveGenTableColumn(&genTableColumn)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGenTableColumn))
}

func UpdateBaseGenTableColumn(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	genTableColumn, _ := data("genTableColumn")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(genTableColumn))
	setGenTableColumn, b, err := manage.SetGenTableColumn(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGenTableColumn))
}

func DeleteBaseGenTableColumn(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGenTableColumn(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsById(c *gin.Context) {
	id := c.Query("id")
	goods, err := manage.GetGoodsById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goods))
	return
}

func GetBaseGoodsList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goods := domain.Goods{}
	err := mapstructure.Decode(param, &goods)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsList(goods, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoods(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsParam, _ := data("goods")
	goods := domain.Goods{}
	err := mapstructure.Decode(goodsParam, &goods)
	saveGoods, err := manage.SaveGoods(&goods)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoods))
}

func UpdateBaseGoods(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goods, _ := data("goods")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goods))
	setGoods, b, err := manage.SetGoods(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoods))
}

func DeleteBaseGoods(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoods(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsCommodityAreaById(c *gin.Context) {
	id := c.Query("id")
	goodsCommodityArea, err := manage.GetGoodsCommodityAreaById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goodsCommodityArea))
	return
}

func GetBaseGoodsCommodityAreaList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goodsCommodityArea := domain.GoodsCommodityArea{}
	err := mapstructure.Decode(param, &goodsCommodityArea)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsCommodityAreaList(goodsCommodityArea, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsCommodityAreaListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsCommodityAreaListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoodsCommodityArea(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsCommodityAreaParam, _ := data("goodsCommodityArea")
	goodsCommodityArea := domain.GoodsCommodityArea{}
	err := mapstructure.Decode(goodsCommodityAreaParam, &goodsCommodityArea)
	saveGoodsCommodityArea, err := manage.SaveGoodsCommodityArea(&goodsCommodityArea)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoodsCommodityArea))
}

func UpdateBaseGoodsCommodityArea(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsCommodityArea, _ := data("goodsCommodityArea")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goodsCommodityArea))
	setGoodsCommodityArea, b, err := manage.SetGoodsCommodityArea(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoodsCommodityArea))
}

func DeleteBaseGoodsCommodityArea(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoodsCommodityArea(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsCouponById(c *gin.Context) {
	id := c.Query("id")
	goodsCoupon, err := manage.GetGoodsCouponById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goodsCoupon))
	return
}

func GetBaseGoodsCouponList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goodsCoupon := domain.GoodsCoupon{}
	err := mapstructure.Decode(param, &goodsCoupon)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsCouponList(goodsCoupon, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsCouponListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsCouponListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoodsCoupon(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsCouponParam, _ := data("goodsCoupon")
	goodsCoupon := domain.GoodsCoupon{}
	err := mapstructure.Decode(goodsCouponParam, &goodsCoupon)
	saveGoodsCoupon, err := manage.SaveGoodsCoupon(&goodsCoupon)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoodsCoupon))
}

func UpdateBaseGoodsCoupon(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsCoupon, _ := data("goodsCoupon")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goodsCoupon))
	setGoodsCoupon, b, err := manage.SetGoodsCoupon(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoodsCoupon))
}

func DeleteBaseGoodsCoupon(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoodsCoupon(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsCouponUserById(c *gin.Context) {
	id := c.Query("id")
	goodsCouponUser, err := manage.GetGoodsCouponUserById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goodsCouponUser))
	return
}

func GetBaseGoodsCouponUserList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goodsCouponUser := domain.GoodsCouponUser{}
	err := mapstructure.Decode(param, &goodsCouponUser)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsCouponUserList(goodsCouponUser, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsCouponUserListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsCouponUserListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoodsCouponUser(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsCouponUserParam, _ := data("goodsCouponUser")
	goodsCouponUser := domain.GoodsCouponUser{}
	err := mapstructure.Decode(goodsCouponUserParam, &goodsCouponUser)
	saveGoodsCouponUser, err := manage.SaveGoodsCouponUser(&goodsCouponUser)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoodsCouponUser))
}

func UpdateBaseGoodsCouponUser(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsCouponUser, _ := data("goodsCouponUser")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goodsCouponUser))
	setGoodsCouponUser, b, err := manage.SetGoodsCouponUser(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoodsCouponUser))
}

func DeleteBaseGoodsCouponUser(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoodsCouponUser(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsIntroductionById(c *gin.Context) {
	id := c.Query("id")
	goodsIntroduction, err := manage.GetGoodsIntroductionById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goodsIntroduction))
	return
}

func GetBaseGoodsIntroductionList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goodsIntroduction := domain.GoodsIntroduction{}
	err := mapstructure.Decode(param, &goodsIntroduction)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsIntroductionList(goodsIntroduction, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsIntroductionListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsIntroductionListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoodsIntroduction(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsIntroductionParam, _ := data("goodsIntroduction")
	goodsIntroduction := domain.GoodsIntroduction{}
	err := mapstructure.Decode(goodsIntroductionParam, &goodsIntroduction)
	goodsIntroduction.CreateBy = fmt.Sprint(GetUserIdByToken(c))
	goodsIntroduction.CreateTime = time.Now()
	saveGoodsIntroduction, err := manage.SaveGoodsIntroduction(&goodsIntroduction)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoodsIntroduction))
}

func UpdateBaseGoodsIntroduction(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsIntroduction, _ := data("goodsIntroduction")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goodsIntroduction))
	toMap["create_by"] = nil
	toMap["create_time"] = nil
	toMap["update_by"] = fmt.Sprint(GetUserIdByToken(c))
	toMap["update_time"] = DateToString(time.Now())
	setGoodsIntroduction, b, err := manage.SetGoodsIntroduction(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoodsIntroduction))
}

func DeleteBaseGoodsIntroduction(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoodsIntroduction(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsOrderById(c *gin.Context) {
	id := c.Query("id")
	goodsOrder, err := manage.GetGoodsOrderById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goodsOrder))
	return
}

func GetBaseGoodsOrderList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goodsOrder := domain.GoodsOrder{}
	err := mapstructure.Decode(param, &goodsOrder)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsOrderList(goodsOrder, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsOrderListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsOrderListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoodsOrder(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsOrderParam, _ := data("goodsOrder")
	goodsOrder := domain.GoodsOrder{}
	err := mapstructure.Decode(goodsOrderParam, &goodsOrder)
	goodsOrder.CreateBy = GetUserIdByToken(c)
	goodsOrder.CreateTime = time.Now()
	saveGoodsOrder, err := manage.SaveGoodsOrder(&goodsOrder)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoodsOrder))
}

func UpdateBaseGoodsOrder(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsOrder, _ := data("goodsOrder")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goodsOrder))
	setGoodsOrder, b, err := manage.SetGoodsOrder(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoodsOrder))
}

func DeleteBaseGoodsOrder(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoodsOrder(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsSkuById(c *gin.Context) {
	id := c.Query("id")
	goodsSku, err := manage.GetGoodsSkuById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goodsSku))
	return
}

func GetBaseGoodsSkuList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goodsSku := domain.GoodsSku{}
	err := mapstructure.Decode(param, &goodsSku)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsSkuList(goodsSku, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsSkuListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsSkuListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoodsSku(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsSkuParam, _ := data("goodsSku")
	goodsSku := domain.GoodsSku{}
	err := mapstructure.Decode(goodsSkuParam, &goodsSku)
	goodsSku.CreateBy = fmt.Sprint(GetUserIdByToken(c))
	goodsSku.CreateTime = time.Now()
	saveGoodsSku, err := manage.SaveGoodsSku(&goodsSku)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoodsSku))
}

func UpdateBaseGoodsSku(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsSku, _ := data("goodsSku")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goodsSku))
	setGoodsSku, b, err := manage.SetGoodsSku(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoodsSku))
}

func DeleteBaseGoodsSku(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoodsSku(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsSkuCardById(c *gin.Context) {
	id := c.Query("id")
	goodsSkuCard, err := manage.GetGoodsSkuCardById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goodsSkuCard))
	return
}

func GetBaseGoodsSkuCardList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goodsSkuCard := domain.GoodsSkuCard{}
	err := mapstructure.Decode(param, &goodsSkuCard)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsSkuCardList(goodsSkuCard, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsSkuCardListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsSkuCardListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoodsSkuCard(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsSkuCardParam, _ := data("goodsSkuCard")
	goodsSkuCard := domain.GoodsSkuCard{}
	err := mapstructure.Decode(goodsSkuCardParam, &goodsSkuCard)
	saveGoodsSkuCard, err := manage.SaveGoodsSkuCard(&goodsSkuCard)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoodsSkuCard))
}

func UpdateBaseGoodsSkuCard(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsSkuCard, _ := data("goodsSkuCard")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goodsSkuCard))
	setGoodsSkuCard, b, err := manage.SetGoodsSkuCard(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoodsSkuCard))
}

func DeleteBaseGoodsSkuCard(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoodsSkuCard(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsTagById(c *gin.Context) {
	id := c.Query("id")
	goodsTag, err := manage.GetGoodsTagById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goodsTag))
	return
}

func GetBaseGoodsTagList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goodsTag := domain.GoodsTag{}
	err := mapstructure.Decode(param, &goodsTag)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsTagList(goodsTag, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsTagListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsTagListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoodsTag(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsTagParam, _ := data("goodsTag")
	goodsTag := domain.GoodsTag{}
	err := mapstructure.Decode(goodsTagParam, &goodsTag)
	saveGoodsTag, err := manage.SaveGoodsTag(&goodsTag)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoodsTag))
}

func UpdateBaseGoodsTag(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsTag, _ := data("goodsTag")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goodsTag))
	setGoodsTag, b, err := manage.SetGoodsTag(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoodsTag))
}

func DeleteBaseGoodsTag(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoodsTag(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseGoodsTypeById(c *gin.Context) {
	id := c.Query("id")
	goodsType, err := manage.GetGoodsTypeById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(goodsType))
	return
}

func GetBaseGoodsTypeList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	goodsType := domain.GoodsType{}
	err := mapstructure.Decode(param, &goodsType)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetGoodsTypeList(goodsType, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseGoodsTypeListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetGoodsTypeListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseGoodsType(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsTypeParam, _ := data("goodsType")
	goodsType := domain.GoodsType{}
	err := mapstructure.Decode(goodsTypeParam, &goodsType)
	goodsType.CreateTime = time.Now()
	saveGoodsType, err := manage.SaveGoodsType(&goodsType)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveGoodsType))
}

func UpdateBaseGoodsType(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	goodsType, _ := data("goodsType")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(goodsType))
	setGoodsType, b, err := manage.SetGoodsType(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setGoodsType))
}

func DeleteBaseGoodsType(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteGoodsType(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseManageUserById(c *gin.Context) {
	id := c.Query("id")
	manageUser, err := manage.GetManageUserById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(manageUser))
	return
}

func GetBaseManageUserList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	manageUser := domain.ManageUser{}
	err := mapstructure.Decode(param, &manageUser)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetManageUserList(manageUser, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseManageUserListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetManageUserListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseManageUser(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	manageUserParam, _ := data("manageUser")
	manageUser := domain.ManageUser{}
	err := mapstructure.Decode(manageUserParam, &manageUser)
	saveManageUser, err := manage.SaveManageUser(&manageUser)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveManageUser))
}

func UpdateBaseManageUser(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	manageUser, _ := data("manageUser")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(manageUser))
	setManageUser, b, err := manage.SetManageUser(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setManageUser))
}

func DeleteBaseManageUser(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteManageUser(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseShopAdviceCarouselById(c *gin.Context) {
	id := c.Query("id")
	shopAdviceCarousel, err := manage.GetShopAdviceCarouselById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(shopAdviceCarousel))
	return
}

func GetBaseShopAdviceCarouselList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	shopAdviceCarousel := domain.ShopAdviceCarousel{}
	err := mapstructure.Decode(param, &shopAdviceCarousel)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetShopAdviceCarouselList(shopAdviceCarousel, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseShopAdviceCarouselListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetShopAdviceCarouselListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseShopAdviceCarousel(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	shopAdviceCarouselParam, _ := data("shopAdviceCarousel")
	shopAdviceCarousel := domain.ShopAdviceCarousel{}
	err := mapstructure.Decode(shopAdviceCarouselParam, &shopAdviceCarousel)
	shopAdviceCarousel.CreateBy = fmt.Sprint(GetUserIdByToken(c))
	shopAdviceCarousel.CreateTime = time.Now()
	saveShopAdviceCarousel, err := manage.SaveShopAdviceCarousel(&shopAdviceCarousel)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveShopAdviceCarousel))
}

func UpdateBaseShopAdviceCarousel(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	shopAdviceCarousel, _ := data("shopAdviceCarousel")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(shopAdviceCarousel))
	toMap["create_by"] = nil
	toMap["create_time"] = nil
	toMap["update_by"] = fmt.Sprint(GetUserIdByToken(c))
	toMap["update_time"] = DateToString(time.Now())
	setShopAdviceCarousel, b, err := manage.SetShopAdviceCarousel(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setShopAdviceCarousel))
}

func DeleteBaseShopAdviceCarousel(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteShopAdviceCarousel(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseShopTopicById(c *gin.Context) {
	id := c.Query("id")
	shopTopic, err := manage.GetShopTopicById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(shopTopic))
	return
}

func GetBaseShopTopicList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	shopTopic := domain.ShopTopic{}
	err := mapstructure.Decode(param, &shopTopic)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetShopTopicList(shopTopic, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseShopTopicListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetShopTopicListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseShopTopic(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	shopTopicParam, _ := data("shopTopic")
	shopTopic := domain.ShopTopic{}
	err := mapstructure.Decode(shopTopicParam, &shopTopic)
	saveShopTopic, err := manage.SaveShopTopic(&shopTopic)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveShopTopic))
}

func UpdateBaseShopTopic(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	shopTopic, _ := data("shopTopic")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(shopTopic))
	setShopTopic, b, err := manage.SetShopTopic(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setShopTopic))
}

func DeleteBaseShopTopic(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteShopTopic(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseShopTopicSkuById(c *gin.Context) {
	id := c.Query("id")
	shopTopicSku, err := manage.GetShopTopicSkuById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(shopTopicSku))
	return
}

func GetBaseShopTopicSkuList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	shopTopicSku := domain.ShopTopicSku{}
	err := mapstructure.Decode(param, &shopTopicSku)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetShopTopicSkuList(shopTopicSku, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseShopTopicSkuListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetShopTopicSkuListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseShopTopicSku(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	shopTopicSkuParam, _ := data("shopTopicSku")
	shopTopicSku := domain.ShopTopicSku{}
	err := mapstructure.Decode(shopTopicSkuParam, &shopTopicSku)
	saveShopTopicSku, err := manage.SaveShopTopicSku(&shopTopicSku)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveShopTopicSku))
}

func UpdateBaseShopTopicSku(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	shopTopicSku, _ := data("shopTopicSku")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(shopTopicSku))
	setShopTopicSku, b, err := manage.SetShopTopicSku(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setShopTopicSku))
}

func DeleteBaseShopTopicSku(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteShopTopicSku(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseUserById(c *gin.Context) {
	id := c.Query("id")
	user, err := manage.GetUserById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(user))
	return
}

func GetBaseUserList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	user := domain.User{}
	err := mapstructure.Decode(param, &user)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetUserList(user, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseUserListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetUserListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseUser(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	userParam, _ := data("user")
	user := domain.User{}
	err := mapstructure.Decode(userParam, &user)
	saveUser, err := manage.SaveUser(&user)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveUser))
}

func UpdateBaseUser(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	user, _ := data("user")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(user))
	setUser, b, err := manage.SetUser(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setUser))
}

func DeleteBaseUser(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteUser(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}

func GetBaseUserWalletById(c *gin.Context) {
	id := c.Query("id")
	userWallet, err := manage.GetUserWalletById(cast.ToInt64(id))
	if err != nil {
		c.JSON(200, CreateResultError(500, "用户查询不存在"))
		return
	}
	c.JSON(200, CreateResultData(userWallet))
	return
}

func GetBaseUserWalletList(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	param, _ := data("param")
	pageNum, _ := data("pageNum")
	pageSize, _ := data("pageSize")
	userWallet := domain.UserWallet{}
	err := mapstructure.Decode(param, &userWallet)
	if err != nil {
		c.JSON(200, CreateResultError(500, "json转换错误"))
		return
	}
	list, err := manage.GetUserWalletList(userWallet, cast.ToInt(pageNum), cast.ToInt(pageSize))
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func GetBaseUserWalletListInId(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	idsString, _ := data("ids")
	var ids []int64
	err := mapstructure.Decode([]byte(cast.ToString(idsString)), &ids)
	list, err := manage.GetUserWalletListInId(ids)
	if err != nil {
		c.JSON(200, CreateResultError(500, "查询错误"))
		return
	}
	c.JSON(200, CreateResultData(list))
}

func SaveBaseUserWallet(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	userWalletParam, _ := data("userWallet")
	userWallet := domain.UserWallet{}
	err := mapstructure.Decode(userWalletParam, &userWallet)
	saveUserWallet, err := manage.SaveUserWallet(&userWallet)
	if err != nil {
		c.JSON(200, CreateResultError(500, "保存错误"))
		return
	}
	c.JSON(200, CreateResultData(saveUserWallet))
}

func UpdateBaseUserWallet(c *gin.Context) {
	data := share.GetJsonAnyParam(c)
	userWallet, _ := data("userWallet")
	id, _ := data("id")
	toMap := UtilStructToMap(cast.ToStringMap(userWallet))
	setUserWallet, b, err := manage.SetUserWallet(toMap, cast.ToInt64(id))
	if err != nil || !b {
		c.JSON(200, CreateResultError(500, "修改错误"))
		return
	}
	c.JSON(200, CreateResultData(setUserWallet))
}

func DeleteBaseUserWallet(c *gin.Context) {
	id := c.Query("id")
	res := manage.DeleteUserWallet(cast.ToInt64(id))
	if !res {
		c.JSON(200, CreateResultError(500, "删除错误"))
		return
	}
	c.JSON(200, CreateResult())
}
