|
|
@@ -253,16 +253,6 @@ func BaseUserWalletRouter(group *gin.RouterGroup) {
|
|
|
PushRouter(BaseArticleGroup, "DELETE", "/userWallet", DeleteBaseUserWallet)
|
|
|
}
|
|
|
|
|
|
-func BaseAuthorityRouter(group *gin.RouterGroup) {
|
|
|
- BaseArticleGroup := group.Group("/back/base")
|
|
|
- PushRouter(BaseArticleGroup, "GET", "/authority", GetBaseAuthorityById)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/authority/list", GetBaseAuthorityList)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/authority/in", GetBaseAuthorityListInId)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/authority", SaveBaseAuthority)
|
|
|
- PushRouter(BaseArticleGroup, "PUT", "/authority", UpdateBaseAuthority)
|
|
|
- PushRouter(BaseArticleGroup, "DELETE", "/authority", DeleteBaseAuthority)
|
|
|
-}
|
|
|
-
|
|
|
func BaseDictDataRouter(group *gin.RouterGroup) {
|
|
|
BaseArticleGroup := group.Group("/back/base")
|
|
|
PushRouter(BaseArticleGroup, "GET", "/dictData", GetBaseDictDataById)
|
|
|
@@ -293,16 +283,6 @@ func BaseManageUserRouter(group *gin.RouterGroup) {
|
|
|
PushRouter(BaseArticleGroup, "DELETE", "/manageUser", DeleteBaseManageUser)
|
|
|
}
|
|
|
|
|
|
-func BaseShopAdviceCarouselRouter(group *gin.RouterGroup) {
|
|
|
- BaseArticleGroup := group.Group("/back/base")
|
|
|
- PushRouter(BaseArticleGroup, "GET", "/shopAdviceCarousel", GetBaseShopAdviceCarouselById)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/shopAdviceCarousel/list", GetBaseShopAdviceCarouselList)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/shopAdviceCarousel/in", GetBaseShopAdviceCarouselListInId)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/shopAdviceCarousel", SaveBaseShopAdviceCarousel)
|
|
|
- PushRouter(BaseArticleGroup, "PUT", "/shopAdviceCarousel", UpdateBaseShopAdviceCarousel)
|
|
|
- PushRouter(BaseArticleGroup, "DELETE", "/shopAdviceCarousel", DeleteBaseShopAdviceCarousel)
|
|
|
-}
|
|
|
-
|
|
|
func BaseShopTopicRouter(group *gin.RouterGroup) {
|
|
|
BaseArticleGroup := group.Group("/back/base")
|
|
|
PushRouter(BaseArticleGroup, "GET", "/shopTopic", GetBaseShopTopicById)
|
|
|
@@ -313,16 +293,6 @@ func BaseShopTopicRouter(group *gin.RouterGroup) {
|
|
|
PushRouter(BaseArticleGroup, "DELETE", "/shopTopic", DeleteBaseShopTopic)
|
|
|
}
|
|
|
|
|
|
-func BaseShopTopicSkuRouter(group *gin.RouterGroup) {
|
|
|
- BaseArticleGroup := group.Group("/back/base")
|
|
|
- PushRouter(BaseArticleGroup, "GET", "/shopTopicSku", GetBaseShopTopicSkuById)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/shopTopicSku/list", GetBaseShopTopicSkuList)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/shopTopicSku/in", GetBaseShopTopicSkuListInId)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/shopTopicSku", SaveBaseShopTopicSku)
|
|
|
- PushRouter(BaseArticleGroup, "PUT", "/shopTopicSku", UpdateBaseShopTopicSku)
|
|
|
- PushRouter(BaseArticleGroup, "DELETE", "/shopTopicSku", DeleteBaseShopTopicSku)
|
|
|
-}
|
|
|
-
|
|
|
func BaseShopAdviceCarouselRouter(group *gin.RouterGroup) {
|
|
|
BaseArticleGroup := group.Group("/back/base")
|
|
|
PushRouter(BaseArticleGroup, "GET", "/shopAdviceCarousel", GetBaseShopAdviceCarouselById)
|
|
|
@@ -343,16 +313,6 @@ func BaseShopTopicSkuRouter(group *gin.RouterGroup) {
|
|
|
PushRouter(BaseArticleGroup, "DELETE", "/shopTopicSku", DeleteBaseShopTopicSku)
|
|
|
}
|
|
|
|
|
|
-func BaseAuthorityRouter(group *gin.RouterGroup) {
|
|
|
- BaseArticleGroup := group.Group("/back/base")
|
|
|
- PushRouter(BaseArticleGroup, "GET", "/authority", GetBaseAuthorityById)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/authority/list", GetBaseAuthorityList)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/authority/in", GetBaseAuthorityListInId)
|
|
|
- PushRouter(BaseArticleGroup, "POST", "/authority", SaveBaseAuthority)
|
|
|
- PushRouter(BaseArticleGroup, "PUT", "/authority", UpdateBaseAuthority)
|
|
|
- PushRouter(BaseArticleGroup, "DELETE", "/authority", DeleteBaseAuthority)
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
@@ -373,13 +333,13 @@ func GetBaseArticleList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- article := domain.Article{}
|
|
|
+ article := domain.ArticleQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2ArticleList(article, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -405,8 +365,8 @@ func SaveBaseArticle(c *gin.Context) {
|
|
|
articleParam, _ := data("article")
|
|
|
article := domain.Article{}
|
|
|
err := mapstructure.Decode(articleParam, &article)
|
|
|
- goodsarticle.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
- goodsarticle.CreateTime = time.Now()
|
|
|
+ article.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
+ article.CreateTime = time.Now()
|
|
|
saveArticle, err := manage.SaveArticle(&article)
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "保存错误"))
|
|
|
@@ -459,13 +419,13 @@ func GetBaseArticleTagList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- articleTag := domain.ArticleTag{}
|
|
|
+ articleTag := domain.ArticleTagQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2ArticleTagList(articleTag, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -545,13 +505,13 @@ func GetBaseArticleTopicList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- articleTopic := domain.ArticleTopic{}
|
|
|
+ articleTopic := domain.ArticleTopicQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2ArticleTopicList(articleTopic, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -631,13 +591,13 @@ func GetBaseBackAuthorityList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- backAuthority := domain.BackAuthority{}
|
|
|
+ backAuthority := domain.BackAuthorityQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2BackAuthorityList(backAuthority, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -664,7 +624,7 @@ func SaveBaseBackAuthority(c *gin.Context) {
|
|
|
backAuthority := domain.BackAuthority{}
|
|
|
err := mapstructure.Decode(backAuthorityParam, &backAuthority)
|
|
|
|
|
|
- goodsbackAuthority.CreateTime = time.Now()
|
|
|
+ backAuthority.CreateTime = time.Now()
|
|
|
saveBackAuthority, err := manage.SaveBackAuthority(&backAuthority)
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "保存错误"))
|
|
|
@@ -717,13 +677,13 @@ func GetBaseBackMenuList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- backMenu := domain.BackMenu{}
|
|
|
+ backMenu := domain.BackMenuQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2BackMenuList(backMenu, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -803,13 +763,13 @@ func GetBaseBackRoleList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- backRole := domain.BackRole{}
|
|
|
+ backRole := domain.BackRoleQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2BackRoleList(backRole, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -889,13 +849,13 @@ func GetBaseBackRoleAuthorityList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- backRoleAuthority := domain.BackRoleAuthority{}
|
|
|
+ backRoleAuthority := domain.BackRoleAuthorityQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2BackRoleAuthorityList(backRoleAuthority, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -975,13 +935,13 @@ func GetBaseBackRoleMenuList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- backRoleMenu := domain.BackRoleMenu{}
|
|
|
+ backRoleMenu := domain.BackRoleMenuQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2BackRoleMenuList(backRoleMenu, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1061,13 +1021,13 @@ func GetBaseGenTableList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- genTable := domain.GenTable{}
|
|
|
+ genTable := domain.GenTableQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GenTableList(genTable, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1147,13 +1107,13 @@ func GetBaseGenTableColumnList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- genTableColumn := domain.GenTableColumn{}
|
|
|
+ genTableColumn := domain.GenTableColumnQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GenTableColumnList(genTableColumn, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1233,13 +1193,13 @@ func GetBaseGoodsList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goods := domain.Goods{}
|
|
|
+ goods := domain.GoodsQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsList(goods, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1319,13 +1279,13 @@ func GetBaseGoodsCommodityAreaList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goodsCommodityArea := domain.GoodsCommodityArea{}
|
|
|
+ goodsCommodityArea := domain.GoodsCommodityAreaQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsCommodityAreaList(goodsCommodityArea, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1405,13 +1365,13 @@ func GetBaseGoodsCouponList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goodsCoupon := domain.GoodsCoupon{}
|
|
|
+ goodsCoupon := domain.GoodsCouponQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsCouponList(goodsCoupon, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1491,13 +1451,13 @@ func GetBaseGoodsCouponUserList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goodsCouponUser := domain.GoodsCouponUser{}
|
|
|
+ goodsCouponUser := domain.GoodsCouponUserQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsCouponUserList(goodsCouponUser, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1577,13 +1537,13 @@ func GetBaseGoodsIntroductionList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goodsIntroduction := domain.GoodsIntroduction{}
|
|
|
+ goodsIntroduction := domain.GoodsIntroductionQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsIntroductionList(goodsIntroduction, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1609,8 +1569,8 @@ func SaveBaseGoodsIntroduction(c *gin.Context) {
|
|
|
goodsIntroductionParam, _ := data("goodsIntroduction")
|
|
|
goodsIntroduction := domain.GoodsIntroduction{}
|
|
|
err := mapstructure.Decode(goodsIntroductionParam, &goodsIntroduction)
|
|
|
- goodsgoodsIntroduction.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
- goodsgoodsIntroduction.CreateTime = time.Now()
|
|
|
+ goodsIntroduction.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
+ goodsIntroduction.CreateTime = time.Now()
|
|
|
saveGoodsIntroduction, err := manage.SaveGoodsIntroduction(&goodsIntroduction)
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "保存错误"))
|
|
|
@@ -1663,13 +1623,13 @@ func GetBaseGoodsOrderList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goodsOrder := domain.GoodsOrder{}
|
|
|
+ goodsOrder := domain.GoodsOrderQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsOrderList(goodsOrder, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1695,8 +1655,8 @@ func SaveBaseGoodsOrder(c *gin.Context) {
|
|
|
goodsOrderParam, _ := data("goodsOrder")
|
|
|
goodsOrder := domain.GoodsOrder{}
|
|
|
err := mapstructure.Decode(goodsOrderParam, &goodsOrder)
|
|
|
- goodsgoodsOrder.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
- goodsgoodsOrder.CreateTime = time.Now()
|
|
|
+ goodsOrder.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
+ goodsOrder.CreateTime = time.Now()
|
|
|
saveGoodsOrder, err := manage.SaveGoodsOrder(&goodsOrder)
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "保存错误"))
|
|
|
@@ -1749,13 +1709,13 @@ func GetBaseGoodsSkuList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goodsSku := domain.GoodsSku{}
|
|
|
+ goodsSku := domain.GoodsSkuQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsSkuList(goodsSku, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1781,8 +1741,8 @@ func SaveBaseGoodsSku(c *gin.Context) {
|
|
|
goodsSkuParam, _ := data("goodsSku")
|
|
|
goodsSku := domain.GoodsSku{}
|
|
|
err := mapstructure.Decode(goodsSkuParam, &goodsSku)
|
|
|
- goodsgoodsSku.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
- goodsgoodsSku.CreateTime = time.Now()
|
|
|
+ goodsSku.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
+ goodsSku.CreateTime = time.Now()
|
|
|
saveGoodsSku, err := manage.SaveGoodsSku(&goodsSku)
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "保存错误"))
|
|
|
@@ -1835,13 +1795,13 @@ func GetBaseGoodsSkuCardList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goodsSkuCard := domain.GoodsSkuCard{}
|
|
|
+ goodsSkuCard := domain.GoodsSkuCardQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsSkuCardList(goodsSkuCard, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -1921,13 +1881,13 @@ func GetBaseGoodsTagList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goodsTag := domain.GoodsTag{}
|
|
|
+ goodsTag := domain.GoodsTagQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsTagList(goodsTag, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -2007,13 +1967,13 @@ func GetBaseGoodsTypeList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- goodsType := domain.GoodsType{}
|
|
|
+ goodsType := domain.GoodsTypeQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2GoodsTypeList(goodsType, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -2040,7 +2000,7 @@ func SaveBaseGoodsType(c *gin.Context) {
|
|
|
goodsType := domain.GoodsType{}
|
|
|
err := mapstructure.Decode(goodsTypeParam, &goodsType)
|
|
|
|
|
|
- goodsgoodsType.CreateTime = time.Now()
|
|
|
+ goodsType.CreateTime = time.Now()
|
|
|
saveGoodsType, err := manage.SaveGoodsType(&goodsType)
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "保存错误"))
|
|
|
@@ -2093,13 +2053,13 @@ func GetBaseUserList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- user := domain.User{}
|
|
|
+ user := domain.UserQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2UserList(user, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -2179,13 +2139,13 @@ func GetBaseUserWalletList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- userWallet := domain.UserWallet{}
|
|
|
+ userWallet := domain.UserWalletQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2UserWalletList(userWallet, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -2248,92 +2208,6 @@ func DeleteBaseUserWallet(c *gin.Context) {
|
|
|
c.JSON(200, CreateResult())
|
|
|
}
|
|
|
|
|
|
-//================Authority ==============================
|
|
|
-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())
|
|
|
-}
|
|
|
-
|
|
|
//================DictData 字典数据==============================
|
|
|
func GetBaseDictDataById(c *gin.Context) {
|
|
|
id := c.Query("id")
|
|
|
@@ -2351,13 +2225,13 @@ func GetBaseDictDataList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- dictData := domain.DictData{}
|
|
|
+ dictData := domain.DictDataQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2DictDataList(dictData, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -2437,13 +2311,13 @@ func GetBaseDictTypeList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- dictType := domain.DictType{}
|
|
|
+ dictType := domain.DictTypeQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2DictTypeList(dictType, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -2523,13 +2397,13 @@ func GetBaseManageUserList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- manageUser := domain.ManageUser{}
|
|
|
+ manageUser := domain.ManageUserQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2ManageUserList(manageUser, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -2592,92 +2466,6 @@ func DeleteBaseManageUser(c *gin.Context) {
|
|
|
c.JSON(200, CreateResult())
|
|
|
}
|
|
|
|
|
|
-//================ShopAdviceCarousel ==============================
|
|
|
-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)
|
|
|
- goodsshopAdviceCarousel.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
- goodsshopAdviceCarousel.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())
|
|
|
-}
|
|
|
-
|
|
|
//================ShopTopic 商品主题==============================
|
|
|
func GetBaseShopTopicById(c *gin.Context) {
|
|
|
id := c.Query("id")
|
|
|
@@ -2695,13 +2483,13 @@ func GetBaseShopTopicList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- shopTopic := domain.ShopTopic{}
|
|
|
+ shopTopic := domain.ShopTopicQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2ShopTopicList(shopTopic, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -2764,92 +2552,6 @@ func DeleteBaseShopTopic(c *gin.Context) {
|
|
|
c.JSON(200, CreateResult())
|
|
|
}
|
|
|
|
|
|
-//================ShopTopicSku ==============================
|
|
|
-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())
|
|
|
-}
|
|
|
-
|
|
|
//================ShopAdviceCarousel 商城广告==============================
|
|
|
func GetBaseShopAdviceCarouselById(c *gin.Context) {
|
|
|
id := c.Query("id")
|
|
|
@@ -2867,13 +2569,13 @@ func GetBaseShopAdviceCarouselList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- shopAdviceCarousel := domain.ShopAdviceCarousel{}
|
|
|
+ shopAdviceCarousel := domain.ShopAdviceCarouselQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2ShopAdviceCarouselList(shopAdviceCarousel, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -2899,8 +2601,8 @@ func SaveBaseShopAdviceCarousel(c *gin.Context) {
|
|
|
shopAdviceCarouselParam, _ := data("shopAdviceCarousel")
|
|
|
shopAdviceCarousel := domain.ShopAdviceCarousel{}
|
|
|
err := mapstructure.Decode(shopAdviceCarouselParam, &shopAdviceCarousel)
|
|
|
- goodsshopAdviceCarousel.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
- goodsshopAdviceCarousel.CreateTime = time.Now()
|
|
|
+ shopAdviceCarousel.CreateBy = fmt.Sprint(GetUserIdByToken(c))
|
|
|
+ shopAdviceCarousel.CreateTime = time.Now()
|
|
|
saveShopAdviceCarousel, err := manage.SaveShopAdviceCarousel(&shopAdviceCarousel)
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "保存错误"))
|
|
|
@@ -2953,13 +2655,13 @@ func GetBaseShopTopicSkuList(c *gin.Context) {
|
|
|
param, _ := data("param")
|
|
|
pageNum, _ := data("pageNum")
|
|
|
pageSize, _ := data("pageSize")
|
|
|
- shopTopicSku := domain.ShopTopicSku{}
|
|
|
+ shopTopicSku := domain.ShopTopicSkuQuery{}
|
|
|
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))
|
|
|
+ list, err := manage.Get2ShopTopicSkuList(shopTopicSku, cast.ToInt(pageNum), cast.ToInt(pageSize))
|
|
|
if err != nil {
|
|
|
c.JSON(200, CreateResultError(500, "查询错误"))
|
|
|
return
|
|
|
@@ -3021,89 +2723,3 @@ func DeleteBaseShopTopicSku(c *gin.Context) {
|
|
|
}
|
|
|
c.JSON(200, CreateResult())
|
|
|
}
|
|
|
-
|
|
|
-//================Authority ==============================
|
|
|
-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())
|
|
|
-}
|