Administrator 1 vuosi sitten
vanhempi
commit
d6553034a3
7 muutettua tiedostoa jossa 288 lisäystä ja 452 poistoa
  1. 10 0
      data/dao/GoodsSkuDao.go
  2. 245 301
      data/domain/DoMain.go
  3. 7 6
      data/domain/Query.go
  4. 15 0
      data/domain/ReqVo.go
  5. 1 1
      file/virtual_mall.sql
  6. 9 144
      router/BackGoodsRouter.go
  7. 1 0
      router/Router.go

+ 10 - 0
data/dao/GoodsSkuDao.go

@@ -18,3 +18,13 @@ func DeleteSkuByCommodityAreaId(id int64) error {
 	}
 	return nil
 }
+
+func SortSkuList(list []domain.SkuSort) error {
+	for _, v := range list {
+		_, err := configs.Engine.Where("id = ?", v.Id).Cols("sort").Update(&domain.GoodsSku{Sort: v.Sort})
+		if err != nil {
+			return err
+		}
+	}
+	return nil
+}

+ 245 - 301
data/domain/DoMain.go

@@ -5,447 +5,391 @@ import (
 	"time"
 )
 
-// Article 文章
 type Article struct {
-	Id             int64     `json:"id"`                                      // 11 0 注释:id
-	ArticleTitle   string    `xorm:"article_title"  json:"articleTitle"`      // 255 0 注释:文章名称
-	ArticleDesc    string    `xorm:"article_desc"  json:"articleDesc"`        // 255 0 注释:文章简介
-	ArticleContent string    `xorm:"article_content"  json:"articleContent"`  // 0 0 注释:文章内容
-	State          string    `xorm:"state"  json:"state"`                     // 255 0 注释:状态
-	ArticleTagIds  string    `xorm:"article_tag_ids"  json:"articleTagIds"`   // 255 0 注释:文章标签
-	ArticleTopicId int64     `xorm:"article_topic_id"  json:"articleTopicId"` // 11 0 注释:文章主题id
-	Image          string    `xorm:"image"  json:"image"`                     // 255 0 注释:图片
-	PublishTime    time.Time `xorm:"publish_time"  json:"publishTime"`        // 0 0 注释:发表时间
-	EyeFill        int64     `xorm:"eye_fill"  json:"eyeFill"`                // 11 0 注释:浏览
-	LikeCount      int64     `xorm:"like_count"  json:"likeCount"`            // 255 0 注释:点赞量
-	CreateBy       string    `xorm:"create_by"  json:"createBy"`              // 255 0 注释:创建人
-	CreateTime     time.Time `xorm:"create_time"  json:"createTime"`          // 0 0 注释:创建时间
-	UpdateBy       string    `xorm:"update_by"  json:"updateBy"`              // 255 0 注释:更新人
-	UpdateTime     time.Time `xorm:"update_time"  json:"updateTime"`          // 0 0 注释:更新时间
+	Id             int64     `xorm:"id" json:"id"`                           //注释:id
+	ArticleTitle   string    `xorm:"article_title" json:"articleTitle"`      //注释:文章名称
+	ArticleContent string    `xorm:"article_content" json:"articleContent"`  //注释:文章内容
+	State          string    `xorm:"state" json:"state"`                     //注释:状态
+	ArticleTagIds  string    `xorm:"article_tag_ids" json:"articleTagIds"`   //注释:文章标签
+	ArticleTopicId int64     `xorm:"article_topic_id" json:"articleTopicId"` //注释:文章主题id
+	Image          string    `xorm:"image" json:"image"`                     //注释:图片
+	PublishTime    time.Time `xorm:"publish_time" json:"publishTime"`        //注释:发表时间
+	EyeFill        int64     `xorm:"eye_fill" json:"eyeFill"`                //注释:浏览量
+	LikeCount      int64     `xorm:"like_count" json:"likeCount"`            //注释:点赞
+	CreateBy       string    `xorm:"create_by" json:"createBy"`              //注释:创建人
+	CreateTime     time.Time `xorm:"create_time" json:"createTime"`          //注释:创建时间
+	UpdateBy       string    `xorm:"update_by" json:"updateBy"`              //注释:更新人
+	UpdateTime     time.Time `xorm:"update_time" json:"updateTime"`          //注释:更新时间
+	ArticleDesc    string    `xorm:"article_desc" json:"articleDesc"`        //注释:文章简介
 }
 
 func (receiver Article) String() string {
-	return fmt.Sprint("Article{Id:", receiver.Id, ",ArticleTitle:", receiver.ArticleTitle, ",ArticleDesc:", receiver.ArticleDesc, ",ArticleContent:", receiver.ArticleContent, ",State:", receiver.State, ",ArticleTagIds:", receiver.ArticleTagIds, ",ArticleTopicId:", receiver.ArticleTopicId, ",Image:", receiver.Image, ",PublishTime:", receiver.PublishTime, ",EyeFill:", receiver.EyeFill, ",LikeCount:", receiver.LikeCount, ",CreateBy:", receiver.CreateBy, ",CreateTime:", receiver.CreateTime, ",UpdateBy:", receiver.UpdateBy, ",UpdateTime:", receiver.UpdateTime, "}")
+	return fmt.Sprint("Article{", "Id:", receiver.Id, "ArticleTitle:", receiver.ArticleTitle, "ArticleContent:", receiver.ArticleContent, "State:", receiver.State, "ArticleTagIds:", receiver.ArticleTagIds, "ArticleTopicId:", receiver.ArticleTopicId, "Image:", receiver.Image, "PublishTime:", receiver.PublishTime, "EyeFill:", receiver.EyeFill, "LikeCount:", receiver.LikeCount, "CreateBy:", receiver.CreateBy, "CreateTime:", receiver.CreateTime, "UpdateBy:", receiver.UpdateBy, "UpdateTime:", receiver.UpdateTime, "ArticleDesc:", receiver.ArticleDesc, "}")
 }
 
-// ArticleTag 文章标签
 type ArticleTag struct {
-	Id                 int64  `json:"id"`                                              // 11 0 注释:
-	TagName            string `xorm:"tag_name"  json:"tagName"`                        // 255 0 注释:标签名
-	TagDesc            string `xorm:"tag_desc"  json:"tagDesc"`                        // 255 0 注释:标签描述
-	TagTextColor       string `xorm:"tag_text_color"  json:"tagTextColor"`             // 10 0 注释:标签字体颜色
-	TagBackgroundColor string `xorm:"tag_background_color"  json:"tagBackgroundColor"` // 10 0 注释:标签背景颜色
+	Id                 int64  `xorm:"id" json:"id"`                                   //注释:
+	TagName            string `xorm:"tag_name" json:"tagName"`                        //注释:标签名
+	TagDesc            string `xorm:"tag_desc" json:"tagDesc"`                        //注释:标签描述
+	TagTextColor       string `xorm:"tag_text_color" json:"tagTextColor"`             //注释:标签字体颜色
+	TagBackgroundColor string `xorm:"tag_background_color" json:"tagBackgroundColor"` //注释:标签背景颜色
 }
 
 func (receiver ArticleTag) String() string {
-	return fmt.Sprint("ArticleTag{Id:", receiver.Id, ",TagName:", receiver.TagName, ",TagDesc:", receiver.TagDesc, ",TagTextColor:", receiver.TagTextColor, ",TagBackgroundColor:", receiver.TagBackgroundColor, "}")
+	return fmt.Sprint("ArticleTag{", "Id:", receiver.Id, "TagName:", receiver.TagName, "TagDesc:", receiver.TagDesc, "TagTextColor:", receiver.TagTextColor, "TagBackgroundColor:", receiver.TagBackgroundColor, "}")
 }
 
-// ArticleTopic 文章主题
 type ArticleTopic struct {
-	Id        int64  `json:"id"`                           // 11 0 注释:
-	Image     string `xorm:"image"  json:"image"`          // 255 0 注释:图片
-	TopicName string `xorm:"topic_name"  json:"topicName"` // 255 0 注释:主题名称
-	TopicDesc string `xorm:"topic_desc"  json:"topicDesc"` // 255 0 注释:主题描述
+	Id        int64  `xorm:"id" json:"id"`                //注释:
+	Image     string `xorm:"image" json:"image"`          //注释:图片
+	TopicName string `xorm:"topic_name" json:"topicName"` //注释:主题名称
+	TopicDesc string `xorm:"topic_desc" json:"topicDesc"` //注释:主题描述
 }
 
 func (receiver ArticleTopic) String() string {
-	return fmt.Sprint("ArticleTopic{Id:", receiver.Id, ",Image:", receiver.Image, ",TopicName:", receiver.TopicName, ",TopicDesc:", receiver.TopicDesc, "}")
+	return fmt.Sprint("ArticleTopic{", "Id:", receiver.Id, "Image:", receiver.Image, "TopicName:", receiver.TopicName, "TopicDesc:", receiver.TopicDesc, "}")
 }
 
-// Authority
-type Authority struct {
-	Id            int64  `json:"id"`                                   // 11 0 注释:
-	AuthorityName string `xorm:"authority_name"  json:"authorityName"` // 255 0 注释:
-	AuthorityPath string `xorm:"authority_path"  json:"authorityPath"` // 255 0 注释:
-}
-
-func (receiver Authority) String() string {
-	return fmt.Sprint("Authority{Id:", receiver.Id, ",AuthorityName:", receiver.AuthorityName, ",AuthorityPath:", receiver.AuthorityPath, "}")
-}
-
-// BackAuthority 后台权限校验
 type BackAuthority struct {
-	Id                    int64     `json:"id"`                                                   // 11 0 注释:id
-	AuthorityName         string    `xorm:"authority_name"  json:"authorityName"`                 // 255 0 注释:接口名
-	AuthorityPath         string    `xorm:"authority_path"  json:"authorityPath"`                 // 255 0 注释:接口路径
-	Method                string    `xorm:"method"  json:"method"`                                // 8 0 注释:方法
-	State                 string    `xorm:"state"  json:"state"`                                  // 5 0 注释:接口是否启用(0关闭,1启用)
-	AuthorityVerification string    `xorm:"authority_verification"  json:"authorityVerification"` // 255 0 注释:权限校验
-	CreateTime            time.Time `xorm:"create_time"  json:"createTime"`                       // 0 0 注释:创建时间
+	Id                    int64     `xorm:"id" json:"id"`                                        //注释:id
+	AuthorityName         string    `xorm:"authority_name" json:"authorityName"`                 //注释:接口名
+	AuthorityPath         string    `xorm:"authority_path" json:"authorityPath"`                 //注释:接口路径
+	Method                string    `xorm:"method" json:"method"`                                //注释:方法
+	State                 string    `xorm:"state" json:"state"`                                  //注释:接口是否启用(0关闭,1启用)
+	AuthorityVerification string    `xorm:"authority_verification" json:"authorityVerification"` //注释:权限校验
+	CreateTime            time.Time `xorm:"create_time" json:"createTime"`                       //注释:创建时间
 }
 
 func (receiver BackAuthority) String() string {
-	return fmt.Sprint("BackAuthority{Id:", receiver.Id, ",AuthorityName:", receiver.AuthorityName, ",AuthorityPath:", receiver.AuthorityPath, ",Method:", receiver.Method, ",State:", receiver.State, ",AuthorityVerification:", receiver.AuthorityVerification, ",CreateTime:", receiver.CreateTime, "}")
+	return fmt.Sprint("BackAuthority{", "Id:", receiver.Id, "AuthorityName:", receiver.AuthorityName, "AuthorityPath:", receiver.AuthorityPath, "Method:", receiver.Method, "State:", receiver.State, "AuthorityVerification:", receiver.AuthorityVerification, "CreateTime:", receiver.CreateTime, "}")
 }
 
-// BackMenu 后台菜单
 type BackMenu struct {
-	Id             int64  `json:"id"`                                      // 11 0 注释:id
-	BackMenuName   string `xorm:"back_menu_name"  json:"backMenuName"`     // 255 0 注释:菜单名称
-	BackMenuPater  int64  `xorm:"back_menu_pater"  json:"backMenuPater"`   // 11 0 注释:父级菜单
-	Sort           int64  `xorm:"sort"  json:"sort"`                       // 11 0 注释:排序
-	Icon           string `xorm:"icon"  json:"icon"`                       // 255 0 注释:图标
-	Remark         string `xorm:"remark"  json:"remark"`                   // 255 0 注释:备注
-	BackRouterPath string `xorm:"back_router_path"  json:"backRouterPath"` // 255 0 注释:路由路径
-	State          string `xorm:"state"  json:"state"`                     // 255 0 注释:状态
+	Id             int64  `xorm:"id" json:"id"`                           //注释:id
+	BackMenuName   string `xorm:"back_menu_name" json:"backMenuName"`     //注释:菜单名称
+	BackMenuPater  int64  `xorm:"back_menu_pater" json:"backMenuPater"`   //注释:父级菜单
+	Sort           int64  `xorm:"sort" json:"sort"`                       //注释:排序
+	Icon           string `xorm:"icon" json:"icon"`                       //注释:图标
+	Remark         string `xorm:"remark" json:"remark"`                   //注释:备注
+	BackRouterPath string `xorm:"back_router_path" json:"backRouterPath"` //注释:路由路径
+	State          string `xorm:"state" json:"state"`                     //注释:状态
 }
 
 func (receiver BackMenu) String() string {
-	return fmt.Sprint("BackMenu{Id:", receiver.Id, ",BackMenuName:", receiver.BackMenuName, ",BackMenuPater:", receiver.BackMenuPater, ",Sort:", receiver.Sort, ",Icon:", receiver.Icon, ",Remark:", receiver.Remark, ",BackRouterPath:", receiver.BackRouterPath, ",State:", receiver.State, "}")
+	return fmt.Sprint("BackMenu{", "Id:", receiver.Id, "BackMenuName:", receiver.BackMenuName, "BackMenuPater:", receiver.BackMenuPater, "Sort:", receiver.Sort, "Icon:", receiver.Icon, "Remark:", receiver.Remark, "BackRouterPath:", receiver.BackRouterPath, "State:", receiver.State, "}")
 }
 
-// BackRole 后台角色
 type BackRole struct {
-	Id       int64  `json:"id"`                         // 11 0 注释:
-	RoleName string `xorm:"role_name"  json:"roleName"` // 255 0 注释:
+	Id       int64  `xorm:"id" json:"id"`              //注释:
+	RoleName string `xorm:"role_name" json:"roleName"` //注释:
 }
 
 func (receiver BackRole) String() string {
-	return fmt.Sprint("BackRole{Id:", receiver.Id, ",RoleName:", receiver.RoleName, "}")
+	return fmt.Sprint("BackRole{", "Id:", receiver.Id, "RoleName:", receiver.RoleName, "}")
 }
 
-// BackRoleAuthority 后台角色权限表
 type BackRoleAuthority struct {
-	Id          int64 `json:"id"`                               // 11 0 注释:
-	RoleId      int64 `xorm:"role_id"  json:"roleId"`           // 11 0 注释:角色id
-	AuthorityId int64 `xorm:"authority_id"  json:"authorityId"` // 11 0 注释:权限id
+	Id          int64 `xorm:"id" json:"id"`                    //注释:
+	RoleId      int64 `xorm:"role_id" json:"roleId"`           //注释:角色id
+	AuthorityId int64 `xorm:"authority_id" json:"authorityId"` //注释:权限id
 }
 
 func (receiver BackRoleAuthority) String() string {
-	return fmt.Sprint("BackRoleAuthority{Id:", receiver.Id, ",RoleId:", receiver.RoleId, ",AuthorityId:", receiver.AuthorityId, "}")
+	return fmt.Sprint("BackRoleAuthority{", "Id:", receiver.Id, "RoleId:", receiver.RoleId, "AuthorityId:", receiver.AuthorityId, "}")
 }
 
-// BackRoleMenu 后台角色菜单表
 type BackRoleMenu struct {
-	Id     int64 `json:"id"`                     // 11 0 注释:
-	RoleId int64 `xorm:"role_id"  json:"roleId"` // 11 0 注释:角色id
-	MenuId int64 `xorm:"menu_id"  json:"menuId"` // 11 0 注释:枚舉id
+	Id     int64 `xorm:"id" json:"id"`          //注释:
+	RoleId int64 `xorm:"role_id" json:"roleId"` //注释:角色id
+	MenuId int64 `xorm:"menu_id" json:"menuId"` //注释:枚舉id
 }
 
 func (receiver BackRoleMenu) String() string {
-	return fmt.Sprint("BackRoleMenu{Id:", receiver.Id, ",RoleId:", receiver.RoleId, ",MenuId:", receiver.MenuId, "}")
-}
-
-// DictData 字典数据
-type DictData struct {
-	Id        int64  `json:"id"`                           // 11 0 注释:字典编码
-	Sort      int64  `xorm:"sort"  json:"sort"`            // 11 0 注释:排序
-	DictLabel string `xorm:"dict_label"  json:"dictLabel"` // 255 0 注释:字典标签
-	DictValue string `xorm:"dict_value"  json:"dictValue"` // 255 0 注释:字典键值
-	DictType  string `xorm:"dict_type"  json:"dictType"`   // 255 0 注释:字典类型
-	Status    string `xorm:"status"  json:"status"`        // 5 0 注释:状态
-	CssStyle  string `xorm:"css_style"  json:"cssStyle"`   // 50 0 注释:样式
-	IsDefault string `xorm:"is_default"  json:"isDefault"` // 5 0 注释:是否默认
-	Remark    string `xorm:"remark"  json:"remark"`        // 255 0 注释:备注
-}
-
-func (receiver DictData) String() string {
-	return fmt.Sprint("DictData{Id:", receiver.Id, ",Sort:", receiver.Sort, ",DictLabel:", receiver.DictLabel, ",DictValue:", receiver.DictValue, ",DictType:", receiver.DictType, ",Status:", receiver.Status, ",CssStyle:", receiver.CssStyle, ",IsDefault:", receiver.IsDefault, ",Remark:", receiver.Remark, "}")
-}
-
-// DictType 字典类型
-type DictType struct {
-	Id       int64  `json:"id"`                         // 11 0 注释:
-	DictName string `xorm:"dict_name"  json:"dictName"` // 50 0 注释:字典名称
-	DictType string `xorm:"dict_type"  json:"dictType"` // 50 0 注释:字典类型
-	Status   string `xorm:"status"  json:"status"`      // 5 0 注释:状态(1正常/0停用)
-	Remark   string `xorm:"remark"  json:"remark"`      // 255 0 注释:备注
-}
-
-func (receiver DictType) String() string {
-	return fmt.Sprint("DictType{Id:", receiver.Id, ",DictName:", receiver.DictName, ",DictType:", receiver.DictType, ",Status:", receiver.Status, ",Remark:", receiver.Remark, "}")
+	return fmt.Sprint("BackRoleMenu{", "Id:", receiver.Id, "RoleId:", receiver.RoleId, "MenuId:", receiver.MenuId, "}")
 }
 
-// GenTable
 type GenTable struct {
-	Id           int64  `json:"id"`                                 // 11 0 注释:id
-	TableName    string `xorm:"table_name"  json:"tableName"`       // 255 0 注释:数据库名
-	TableComment string `xorm:"table_comment"  json:"tableComment"` // 255 0 注释:数据库注释
-	Name         string `xorm:"name"  json:"name"`                  // 255 0 注释:名字
-	RouterName   string `xorm:"router_name"  json:"routerName"`     // 255 0 注释:路由名
-	Remark       string `xorm:"remark"  json:"remark"`              // 255 0 注释:备注
+	Id           int64  `xorm:"id" json:"id"`                      //注释:id
+	TableName    string `xorm:"table_name" json:"tableName"`       //注释:数据库名
+	TableComment string `xorm:"table_comment" json:"tableComment"` //注释:数据库注释
+	Name         string `xorm:"name" json:"name"`                  //注释:名字
+	RouterName   string `xorm:"router_name" json:"routerName"`     //注释:路由名
+	Remark       string `xorm:"remark" json:"remark"`              //注释:备注
 }
 
 func (receiver GenTable) String() string {
-	return fmt.Sprint("GenTable{Id:", receiver.Id, ",TableName:", receiver.TableName, ",TableComment:", receiver.TableComment, ",Name:", receiver.Name, ",RouterName:", receiver.RouterName, ",Remark:", receiver.Remark, "}")
+	return fmt.Sprint("GenTable{", "Id:", receiver.Id, "TableName:", receiver.TableName, "TableComment:", receiver.TableComment, "Name:", receiver.Name, "RouterName:", receiver.RouterName, "Remark:", receiver.Remark, "}")
 }
 
-// GenTableColumn
 type GenTableColumn struct {
-	Id            int64  `json:"id"`                                   // 11 0 注释:id
-	TableId       int64  `xorm:"table_id"  json:"tableId"`             // 11 0 注释:表格id
-	Sort          int64  `xorm:"sort"  json:"sort"`                    // 255 0 注释:排序
-	ColumnName    string `xorm:"column_name"  json:"columnName"`       // 255 0 注释:字段名
-	ColumnComment string `xorm:"column_comment"  json:"columnComment"` // 255 0 注释:字段注释
-	ColumnType    string `xorm:"column_type"  json:"columnType"`       // 255 0 注释:字段类型
-	GoType        string `xorm:"go_type"  json:"goType"`               // 255 0 注释:go类型
-	GoField       string `xorm:"go_field"  json:"goField"`             // 255 0 注释:go字段名
-	IsKey         string `xorm:"is_key"  json:"isKey"`                 // 1 0 注释:是否主键
-	IsIncrement   string `xorm:"is_increment"  json:"isIncrement"`     // 1 0 注释:是否自增
-	IsRequired    string `xorm:"is_required"  json:"isRequired"`       // 1 0 注释:是否未必填
-	QueryType     string `xorm:"query_type"  json:"queryType"`         // 255 0 注释:查询方式
-	VueShowType   string `xorm:"vue_show_type"  json:"vueShowType"`    // 255 0 注释:前端显示类型
-	DictType      string `xorm:"dict_type"  json:"dictType"`           // 255 0 注释:字典类型
+	Id            int64  `xorm:"id" json:"id"`                        //注释:id
+	TableId       int64  `xorm:"table_id" json:"tableId"`             //注释:表格id
+	Sort          int64  `xorm:"sort" json:"sort"`                    //注释:排序
+	ColumnComment string `xorm:"column_comment" json:"columnComment"` //注释:字段注释
+	ColumnType    string `xorm:"column_type" json:"columnType"`       //注释:字段类型
+	GoType        string `xorm:"go_type" json:"goType"`               //注释:go类型
+	GoField       string `xorm:"go_field" json:"goField"`             //注释:go字段名
+	IsKey         string `xorm:"is_key" json:"isKey"`                 //注释:是否主键
+	IsIncrement   string `xorm:"is_increment" json:"isIncrement"`     //注释:是否自增
+	IsRequired    string `xorm:"is_required" json:"isRequired"`       //注释:是否未必填
+	QueryType     string `xorm:"query_type" json:"queryType"`         //注释:查询方式
+	VueShowType   string `xorm:"vue_show_type" json:"vueShowType"`    //注释:前端显示类型
+	DictType      string `xorm:"dict_type" json:"dictType"`           //注释:字典类型
+	ColumnName    string `xorm:"column_name" json:"columnName"`       //注释:字段名
 }
 
 func (receiver GenTableColumn) String() string {
-	return fmt.Sprint("GenTableColumn{Id:", receiver.Id, ",TableId:", receiver.TableId, ",Sort:", receiver.Sort, ",ColumnName:", receiver.ColumnName, ",ColumnComment:", receiver.ColumnComment, ",ColumnType:", receiver.ColumnType, ",GoType:", receiver.GoType, ",GoField:", receiver.GoField, ",IsKey:", receiver.IsKey, ",IsIncrement:", receiver.IsIncrement, ",IsRequired:", receiver.IsRequired, ",QueryType:", receiver.QueryType, ",VueShowType:", receiver.VueShowType, ",DictType:", receiver.DictType, "}")
+	return fmt.Sprint("GenTableColumn{", "Id:", receiver.Id, "TableId:", receiver.TableId, "Sort:", receiver.Sort, "ColumnComment:", receiver.ColumnComment, "ColumnType:", receiver.ColumnType, "GoType:", receiver.GoType, "GoField:", receiver.GoField, "IsKey:", receiver.IsKey, "IsIncrement:", receiver.IsIncrement, "IsRequired:", receiver.IsRequired, "QueryType:", receiver.QueryType, "VueShowType:", receiver.VueShowType, "DictType:", receiver.DictType, "ColumnName:", receiver.ColumnName, "}")
 }
 
-// Goods 商品表
 type Goods struct {
-	Id             int64  `json:"id"`                                     // 11 0 注释:id
-	TypeId         int64  `xorm:"type_id"  json:"typeId"`                 // 11 0 注释:分类id
-	GoodsName      string `xorm:"goods_name"  json:"goodsName"`           // 255 0 注释:商品名字
-	IntroductionId int64  `xorm:"introduction_id"  json:"introductionId"` // 11 0 注释:商品介绍id
-	SalesVolume    int64  `xorm:"sales_volume"  json:"salesVolume"`       // 255 0 注释:近30天销量
-	TagIds         string `xorm:"tag_ids"  json:"tagIds"`                 // 255 0 注释:商品标签
+	Id             int64  `xorm:"id" json:"id"`                          //注释:id
+	TypeId         int64  `xorm:"type_id" json:"typeId"`                 //注释:分类id
+	GoodsName      string `xorm:"goods_name" json:"goodsName"`           //注释:商品名字
+	IntroductionId int64  `xorm:"introduction_id" json:"introductionId"` //注释:商品介绍id
+	SalesVolume    int64  `xorm:"sales_volume" json:"salesVolume"`       //注释:近30天销量
+	TagIds         string `xorm:"tag_ids" json:"tagIds"`                 //注释:商品标签
 }
 
 func (receiver Goods) String() string {
-	return fmt.Sprint("Goods{Id:", receiver.Id, ",TypeId:", receiver.TypeId, ",GoodsName:", receiver.GoodsName, ",IntroductionId:", receiver.IntroductionId, ",SalesVolume:", receiver.SalesVolume, ",TagIds:", receiver.TagIds, "}")
+	return fmt.Sprint("Goods{", "Id:", receiver.Id, "TypeId:", receiver.TypeId, "GoodsName:", receiver.GoodsName, "IntroductionId:", receiver.IntroductionId, "SalesVolume:", receiver.SalesVolume, "TagIds:", receiver.TagIds, "}")
 }
 
-// GoodsCommodityArea 商品属性
 type GoodsCommodityArea struct {
-	Id                   int64  `json:"id"`                                                  // 11 0 注释:id
-	GoodsId              int64  `xorm:"goods_id"  json:"goodsId"`                            // 11 0 注释:商品id
-	CommodityAreaName    string `xorm:"commodity_area_name"  json:"commodityAreaName"`       // 255 0 注释:商品属地名称
-	DetailImage          string `xorm:"detail_image"  json:"detailImage"`                    // 255 0 注释:详情图片
-	DetailIntroductionId int64  `xorm:"detail_introduction_id"  json:"detailIntroductionId"` // 11 0 注释:相关文本详情id
+	Id                   int64  `xorm:"id" json:"id"`                                       //注释:id
+	GoodsId              int64  `xorm:"goods_id" json:"goodsId"`                            //注释:商品id
+	CommodityAreaName    string `xorm:"commodity_area_name" json:"commodityAreaName"`       //注释:商品属地名称
+	DetailImage          string `xorm:"detail_image" json:"detailImage"`                    //注释:详情图片
+	DetailIntroductionId int64  `xorm:"detail_introduction_id" json:"detailIntroductionId"` //注释:相关文本详情id
 }
 
 func (receiver GoodsCommodityArea) String() string {
-	return fmt.Sprint("GoodsCommodityArea{Id:", receiver.Id, ",GoodsId:", receiver.GoodsId, ",CommodityAreaName:", receiver.CommodityAreaName, ",DetailImage:", receiver.DetailImage, ",DetailIntroductionId:", receiver.DetailIntroductionId, "}")
+	return fmt.Sprint("GoodsCommodityArea{", "Id:", receiver.Id, "GoodsId:", receiver.GoodsId, "CommodityAreaName:", receiver.CommodityAreaName, "DetailImage:", receiver.DetailImage, "DetailIntroductionId:", receiver.DetailIntroductionId, "}")
 }
 
-// GoodsCoupon 优惠券
 type GoodsCoupon struct {
-	Id               int64     `json:"id"`                                          // 11 0 注释:id
-	CouponName       string    `xorm:"coupon_name"  json:"couponName"`              // 255 0 注释:优惠券名称
-	CouponDesc       string    `xorm:"coupon_desc"  json:"couponDesc"`              // 255 0 注释:优惠券描述
-	CashBackPoint    float64   `xorm:"cash_back_point"  json:"cashBackPoint"`       // 11 2 注释:满x
-	CashBackPrice    float64   `xorm:"cash_back_price"  json:"cashBackPrice"`       // 11 2 注释:减x
-	ConditionByTopic string    `xorm:"condition_by_topic"  json:"conditionByTopic"` // 255 0 注释:主题可用,id
-	ConditionByType  string    `xorm:"condition_by_type"  json:"conditionByType"`   // 255 0 注释:类型可用,id
-	ConditionByGoods string    `xorm:"condition_by_goods"  json:"conditionByGoods"` // 255 0 注释:商品可用,id
-	GrantCount       string    `xorm:"grant_count"  json:"grantCount"`              // 255 0 注释:发放数量
-	Count            int64     `xorm:"count"  json:"count"`                         // 255 0 注释:优惠券余量
-	ReceiveType      string    `xorm:"receive_type"  json:"receiveType"`            // 255 0 注释:领取条件
-	Validity         string    `xorm:"validity"  json:"validity"`                   // 255 0 注释:有效性,领取开始计时(ClaimTiming),固定时间(FixedTime)
-	ValidityPeriod   time.Time `xorm:"validity_period"  json:"validityPeriod"`      // 0 0 注释:有效期
+	Id               int64     `xorm:"id" json:"id"`                               //注释:id
+	CouponName       string    `xorm:"coupon_name" json:"couponName"`              //注释:优惠券名称
+	CouponDesc       string    `xorm:"coupon_desc" json:"couponDesc"`              //注释:优惠券描述
+	CashBackPoint    float64   `xorm:"cash_back_point" json:"cashBackPoint"`       //注释:满x
+	CashBackPrice    float64   `xorm:"cash_back_price" json:"cashBackPrice"`       //注释:减x
+	ConditionByTopic string    `xorm:"condition_by_topic" json:"conditionByTopic"` //注释:主题可用,id
+	ConditionByType  string    `xorm:"condition_by_type" json:"conditionByType"`   //注释:类型可用,id
+	ConditionByGoods string    `xorm:"condition_by_goods" json:"conditionByGoods"` //注释:商品可用,id
+	GrantCount       string    `xorm:"grant_count" json:"grantCount"`              //注释:发放数量
+	Count            int64     `xorm:"count" json:"count"`                         //注释:优惠券余量
+	ReceiveType      string    `xorm:"receive_type" json:"receiveType"`            //注释:领取条件
+	Validity         string    `xorm:"validity" json:"validity"`                   //注释:有效性,领取开始计时(ClaimTiming),固定时间(FixedTime)
+	ValidityPeriod   time.Time `xorm:"validity_period" json:"validityPeriod"`      //注释:有效期
 }
 
 func (receiver GoodsCoupon) String() string {
-	return fmt.Sprint("GoodsCoupon{Id:", receiver.Id, ",CouponName:", receiver.CouponName, ",CouponDesc:", receiver.CouponDesc, ",CashBackPoint:", receiver.CashBackPoint, ",CashBackPrice:", receiver.CashBackPrice, ",ConditionByTopic:", receiver.ConditionByTopic, ",ConditionByType:", receiver.ConditionByType, ",ConditionByGoods:", receiver.ConditionByGoods, ",GrantCount:", receiver.GrantCount, ",Count:", receiver.Count, ",ReceiveType:", receiver.ReceiveType, ",Validity:", receiver.Validity, ",ValidityPeriod:", receiver.ValidityPeriod, "}")
+	return fmt.Sprint("GoodsCoupon{", "Id:", receiver.Id, "CouponName:", receiver.CouponName, "CouponDesc:", receiver.CouponDesc, "CashBackPoint:", receiver.CashBackPoint, "CashBackPrice:", receiver.CashBackPrice, "ConditionByTopic:", receiver.ConditionByTopic, "ConditionByType:", receiver.ConditionByType, "ConditionByGoods:", receiver.ConditionByGoods, "GrantCount:", receiver.GrantCount, "Count:", receiver.Count, "ReceiveType:", receiver.ReceiveType, "Validity:", receiver.Validity, "ValidityPeriod:", receiver.ValidityPeriod, "}")
 }
 
-// GoodsCouponUser 优惠券领取
 type GoodsCouponUser struct {
-	Id             int64     `json:"id"`                                     // 11 0 注释:id
-	UserId         int64     `xorm:"user_id"  json:"userId"`                 // 11 0 注释:用户id
-	CouponId       int64     `xorm:"coupon_id"  json:"couponId"`             // 11 0 注释:优惠券id
-	CollectionTime time.Time `xorm:"collection_time"  json:"collectionTime"` // 0 0 注释:领取时间
-	State          string    `xorm:"state"  json:"state"`                    // 255 0 注释:状态,已使用2,未使用1,已过期0
+	Id             int64     `xorm:"id" json:"id"`                          //注释:id
+	UserId         int64     `xorm:"user_id" json:"userId"`                 //注释:用户id
+	CouponId       int64     `xorm:"coupon_id" json:"couponId"`             //注释:优惠券id
+	CollectionTime time.Time `xorm:"collection_time" json:"collectionTime"` //注释:领取时间
+	State          string    `xorm:"state" json:"state"`                    //注释:状态,已使用2,未使用1,已过期0
 }
 
 func (receiver GoodsCouponUser) String() string {
-	return fmt.Sprint("GoodsCouponUser{Id:", receiver.Id, ",UserId:", receiver.UserId, ",CouponId:", receiver.CouponId, ",CollectionTime:", receiver.CollectionTime, ",State:", receiver.State, "}")
+	return fmt.Sprint("GoodsCouponUser{", "Id:", receiver.Id, "UserId:", receiver.UserId, "CouponId:", receiver.CouponId, "CollectionTime:", receiver.CollectionTime, "State:", receiver.State, "}")
 }
 
-// GoodsIntroduction 商品介绍
 type GoodsIntroduction struct {
-	Id               int64     `json:"id"`                                          // 11 0 注释:文章id
-	GoodsArticleName string    `xorm:"goods_article_name"  json:"goodsArticleName"` // 255 0 注释:商品文章名
-	GoodsArticle     string    `xorm:"goods_article"  json:"goodsArticle"`          // 0 0 注释:商品文章
-	CreateBy         string    `xorm:"create_by"  json:"createBy"`                  // 0 0 注释:创建人
-	CreateTime       time.Time `xorm:"create_time"  json:"createTime"`              // 0 0 注释:创建时间
-	UpdateBy         string    `xorm:"update_by"  json:"updateBy"`                  // 255 0 注释:更新人
-	UpdateTime       time.Time `xorm:"update_time"  json:"updateTime"`              // 0 0 注释:更新时间
+	Id               int64     `xorm:"id" json:"id"`                               //注释:文章id
+	GoodsArticleName string    `xorm:"goods_article_name" json:"goodsArticleName"` //注释:商品文章名
+	GoodsArticle     string    `xorm:"goods_article" json:"goodsArticle"`          //注释:商品文章
+	CreateBy         string    `xorm:"create_by" json:"createBy"`                  //注释:创建人
+	CreateTime       time.Time `xorm:"create_time" json:"createTime"`              //注释:创建时间
+	UpdateBy         string    `xorm:"update_by" json:"updateBy"`                  //注释:更新人
+	UpdateTime       time.Time `xorm:"update_time" json:"updateTime"`              //注释:更新时间
 }
 
 func (receiver GoodsIntroduction) String() string {
-	return fmt.Sprint("GoodsIntroduction{Id:", receiver.Id, ",GoodsArticleName:", receiver.GoodsArticleName, ",GoodsArticle:", receiver.GoodsArticle, ",CreateBy:", receiver.CreateBy, ",CreateTime:", receiver.CreateTime, ",UpdateBy:", receiver.UpdateBy, ",UpdateTime:", receiver.UpdateTime, "}")
+	return fmt.Sprint("GoodsIntroduction{", "Id:", receiver.Id, "GoodsArticleName:", receiver.GoodsArticleName, "GoodsArticle:", receiver.GoodsArticle, "CreateBy:", receiver.CreateBy, "CreateTime:", receiver.CreateTime, "UpdateBy:", receiver.UpdateBy, "UpdateTime:", receiver.UpdateTime, "}")
 }
 
-// GoodsOrder 商品订单
 type GoodsOrder struct {
-	Id                 int64     `json:"id"`                                             // 11 0 注释:id
-	OrderName          string    `xorm:"order_name"  json:"orderName"`                   // 255 0 注释:订单名
-	SkuId              int64     `xorm:"sku_id"  json:"skuId"`                           // 11 0 注释:skuid
-	Count              int64     `xorm:"count"  json:"count"`                            // 11 0 注释:购买数量
-	Price              float64   `xorm:"price"  json:"price"`                            // 10 2 注释:单价
-	TotalPrice         float64   `xorm:"total_price"  json:"totalPrice"`                 // 10 2 注释:总价
-	ContactInformation string    `xorm:"contact_information"  json:"contactInformation"` // 255 0 注释:联系方式
-	CouponUserId       int64     `xorm:"coupon_user_id"  json:"couponUserId"`            // 11 0 注释:使用的优惠券
-	State              string    `xorm:"state"  json:"state"`                            // 10 0 注释:支付状态,0待支付,1待发货,2已发货,3订单完成,4订单异常
-	OtherData          string    `xorm:"other_data"  json:"otherData"`                   // 0 0 注释:其他数据
-	CreateBy           int64     `xorm:"create_by"  json:"createBy"`                     // 255 0 注释:用户id
-	CreateTime         time.Time `xorm:"create_time"  json:"createTime"`                 // 0 0 注释:订单创建时间
+	Id                 int64     `xorm:"id" json:"id"`                                  //注释:id
+	OrderName          string    `xorm:"order_name" json:"orderName"`                   //注释:订单名
+	SkuId              int64     `xorm:"sku_id" json:"skuId"`                           //注释:skuid
+	Count              int64     `xorm:"count" json:"count"`                            //注释:购买数量
+	Price              float64   `xorm:"price" json:"price"`                            //注释:单价
+	TotalPrice         float64   `xorm:"total_price" json:"totalPrice"`                 //注释:总价
+	ContactInformation string    `xorm:"contact_information" json:"contactInformation"` //注释:联系方式
+	CouponUserId       int64     `xorm:"coupon_user_id" json:"couponUserId"`            //注释:使用的优惠券
+	State              string    `xorm:"state" json:"state"`                            //注释:支付状态,0待支付,1待发货,2已发货,3订单完成,4订单异常
+	CreateBy           int64     `xorm:"create_by" json:"createBy"`                     //注释:用户id
+	CreateTime         time.Time `xorm:"create_time" json:"createTime"`                 //注释:订单创建时间
+	OtherData          string    `xorm:"other_data" json:"otherData"`                   //注释:其他数据
 }
 
 func (receiver GoodsOrder) String() string {
-	return fmt.Sprint("GoodsOrder{Id:", receiver.Id, ",OrderName:", receiver.OrderName, ",SkuId:", receiver.SkuId, ",Count:", receiver.Count, ",Price:", receiver.Price, ",TotalPrice:", receiver.TotalPrice, ",ContactInformation:", receiver.ContactInformation, ",CouponUserId:", receiver.CouponUserId, ",State:", receiver.State, ",OtherData:", receiver.OtherData, ",CreateBy:", receiver.CreateBy, ",CreateTime:", receiver.CreateTime, "}")
+	return fmt.Sprint("GoodsOrder{", "Id:", receiver.Id, "OrderName:", receiver.OrderName, "SkuId:", receiver.SkuId, "Count:", receiver.Count, "Price:", receiver.Price, "TotalPrice:", receiver.TotalPrice, "ContactInformation:", receiver.ContactInformation, "CouponUserId:", receiver.CouponUserId, "State:", receiver.State, "CreateBy:", receiver.CreateBy, "CreateTime:", receiver.CreateTime, "OtherData:", receiver.OtherData, "}")
 }
 
-// GoodsSku 商品规格
 type GoodsSku struct {
-	Id               int64     `json:"id"`                                         // 11 0 注释:
-	SkuImage         string    `xorm:"sku_image"  json:"skuImage"`                 // 255 0 注释:sku图片
-	SkuName          string    `xorm:"sku_name"  json:"skuName"`                   // 255 0 注释:商品sku名字
-	Price            float64   `xorm:"price"  json:"price"`                        // 10 2 注释:现在价格
-	HistoricalPrices float64   `xorm:"historical_prices"  json:"historicalPrices"` // 10 2 注释:历史价格
-	InventoryNumber  int64     `xorm:"inventory_number"  json:"inventoryNumber"`   // 11 0 注释:库存
-	CommodityAreaId  int64     `xorm:"commodity_area_id"  json:"commodityAreaId"`  // 11 0 注释:属地id
-	GoodsId          int64     `xorm:"goods_id"  json:"goodsId"`                   // 11 0 注释:商品id
-	CreateBy         string    `xorm:"create_by"  json:"createBy"`                 // 255 0 注释:创建人
-	CreateTime       time.Time `xorm:"create_time"  json:"createTime"`             // 0 0 注释:创建时间
+	Id               int64     `xorm:"id" json:"id"`                              //注释:
+	SkuImage         string    `xorm:"sku_image" json:"skuImage"`                 //注释:sku图片
+	SkuName          string    `xorm:"sku_name" json:"skuName"`                   //注释:商品sku名字
+	Price            float64   `xorm:"price" json:"price"`                        //注释:现在价格
+	HistoricalPrices float64   `xorm:"historical_prices" json:"historicalPrices"` //注释:历史价格
+	InventoryNumber  int64     `xorm:"inventory_number" json:"inventoryNumber"`   //注释:库存
+	CommodityAreaId  int64     `xorm:"commodity_area_id" json:"commodityAreaId"`  //注释:属地id
+	GoodsId          int64     `xorm:"goods_id" json:"goodsId"`                   //注释:商品id
+	CreateBy         string    `xorm:"create_by" json:"createBy"`                 //注释:创建人
+	CreateTime       time.Time `xorm:"create_time" json:"createTime"`             //注释:创建时间
+	Sort             int64     `xorm:"sort" json:"sort"`                          //注释:排序
 }
 
 func (receiver GoodsSku) String() string {
-	return fmt.Sprint("GoodsSku{Id:", receiver.Id, ",SkuImage:", receiver.SkuImage, ",SkuName:", receiver.SkuName, ",Price:", receiver.Price, ",HistoricalPrices:", receiver.HistoricalPrices, ",InventoryNumber:", receiver.InventoryNumber, ",CommodityAreaId:", receiver.CommodityAreaId, ",GoodsId:", receiver.GoodsId, ",CreateBy:", receiver.CreateBy, ",CreateTime:", receiver.CreateTime, "}")
+	return fmt.Sprint("GoodsSku{", "Id:", receiver.Id, "SkuImage:", receiver.SkuImage, "SkuName:", receiver.SkuName, "Price:", receiver.Price, "HistoricalPrices:", receiver.HistoricalPrices, "InventoryNumber:", receiver.InventoryNumber, "CommodityAreaId:", receiver.CommodityAreaId, "GoodsId:", receiver.GoodsId, "CreateBy:", receiver.CreateBy, "CreateTime:", receiver.CreateTime, "Sort:", receiver.Sort, "}")
 }
 
-// GoodsSkuCard 商品卡号
 type GoodsSkuCard struct {
-	Id         int64     `json:"id"`                             // 11 0 注释:id
-	CardName   string    `xorm:"card_name"  json:"cardName"`     // 255 0 注释:卡种名称
-	State      string    `xorm:"state"  json:"state"`            // 255 0 注释:状态,0未使用,1已用,2过期
-	Count      int64     `xorm:"count"  json:"count"`            // 11 0 注释:库存
-	TotalCount string    `xorm:"total_count"  json:"totalCount"` // 255 0 注释:总数
-	CardKey    string    `xorm:"card_key"  json:"cardKey"`       // 255 0 注释:卡密
-	Use        string    `xorm:"use"  json:"use"`                // 5 0 注释:是否已用
-	UploadTime time.Time `xorm:"upload_time"  json:"uploadTime"` // 0 0 注释:入库时间
-	SkuId      int64     `xorm:"sku_id"  json:"skuId"`           // 11 0 注释:商品规格绑定
-	Sort       string    `xorm:"sort"  json:"sort"`              // 255 0 注释:排序,出售优先级
+	Id         int64     `xorm:"id" json:"id"`                  //注释:id
+	CardName   string    `xorm:"card_name" json:"cardName"`     //注释:卡种名称
+	State      string    `xorm:"state" json:"state"`            //注释:状态,0未使用,1已用,2过期
+	Count      int64     `xorm:"count" json:"count"`            //注释:库存
+	TotalCount string    `xorm:"total_count" json:"totalCount"` //注释:总数
+	CardKey    string    `xorm:"card_key" json:"cardKey"`       //注释:卡密
+	Use        string    `xorm:"use" json:"use"`                //注释:是否已用
+	UploadTime time.Time `xorm:"upload_time" json:"uploadTime"` //注释:入库时间
+	SkuId      int64     `xorm:"sku_id" json:"skuId"`           //注释:商品规格绑定
+	Sort       string    `xorm:"sort" json:"sort"`              //注释:排序,出售优先级
 }
 
 func (receiver GoodsSkuCard) String() string {
-	return fmt.Sprint("GoodsSkuCard{Id:", receiver.Id, ",CardName:", receiver.CardName, ",State:", receiver.State, ",Count:", receiver.Count, ",TotalCount:", receiver.TotalCount, ",CardKey:", receiver.CardKey, ",Use:", receiver.Use, ",UploadTime:", receiver.UploadTime, ",SkuId:", receiver.SkuId, ",Sort:", receiver.Sort, "}")
+	return fmt.Sprint("GoodsSkuCard{", "Id:", receiver.Id, "CardName:", receiver.CardName, "State:", receiver.State, "Count:", receiver.Count, "TotalCount:", receiver.TotalCount, "CardKey:", receiver.CardKey, "Use:", receiver.Use, "UploadTime:", receiver.UploadTime, "SkuId:", receiver.SkuId, "Sort:", receiver.Sort, "}")
 }
 
-// GoodsTag 商品标签
 type GoodsTag struct {
-	Id      int64  `json:"id"`                       // 11 0 注释:id
-	Name    string `xorm:"name"  json:"name"`        // 255 0 注释:名字
-	IconUrl string `xorm:"icon_url"  json:"iconUrl"` // 255 0 注释:图标路径
-	Tag     string `xorm:"tag"  json:"tag"`          // 255 0 注释:标签
+	Id      int64  `xorm:"id" json:"id"`            //注释:id
+	Name    string `xorm:"name" json:"name"`        //注释:名字
+	IconUrl string `xorm:"icon_url" json:"iconUrl"` //注释:图标路径
+	Tag     string `xorm:"tag" json:"tag"`          //注释:标签
 }
 
 func (receiver GoodsTag) String() string {
-	return fmt.Sprint("GoodsTag{Id:", receiver.Id, ",Name:", receiver.Name, ",IconUrl:", receiver.IconUrl, ",Tag:", receiver.Tag, "}")
+	return fmt.Sprint("GoodsTag{", "Id:", receiver.Id, "Name:", receiver.Name, "IconUrl:", receiver.IconUrl, "Tag:", receiver.Tag, "}")
 }
 
-// GoodsType 商品分类
 type GoodsType struct {
-	Id         int64     `json:"id"`                             // 11 0 注释:
-	Sort       int64     `xorm:"sort"  json:"sort"`              // 11 0 注释:排序
-	TypeImage  string    `xorm:"type_image"  json:"typeImage"`   // 50 0 注释:类型图片
-	TypeName   string    `xorm:"type_name"  json:"typeName"`     // 255 0 注释:商品类别名称
-	CreateTime time.Time `xorm:"create_time"  json:"createTime"` // 0 0 注释:创建时间
+	Id         int64     `xorm:"id" json:"id"`                  //注释:
+	Sort       int64     `xorm:"sort" json:"sort"`              //注释:排序
+	TypeImage  string    `xorm:"type_image" json:"typeImage"`   //注释:类型图片
+	TypeName   string    `xorm:"type_name" json:"typeName"`     //注释:商品类别名称
+	CreateTime time.Time `xorm:"create_time" json:"createTime"` //注释:创建时间
 }
 
 func (receiver GoodsType) String() string {
-	return fmt.Sprint("GoodsType{Id:", receiver.Id, ",Sort:", receiver.Sort, ",TypeImage:", receiver.TypeImage, ",TypeName:", receiver.TypeName, ",CreateTime:", receiver.CreateTime, "}")
+	return fmt.Sprint("GoodsType{", "Id:", receiver.Id, "Sort:", receiver.Sort, "TypeImage:", receiver.TypeImage, "TypeName:", receiver.TypeName, "CreateTime:", receiver.CreateTime, "}")
 }
 
-// ManageUser
-type ManageUser struct {
-	Id           int64  `json:"id"`                                 // 11 0 注释:
-	Name         string `xorm:"name"  json:"name"`                  // 255 0 注释:名称
-	Username     string `xorm:"username"  json:"username"`          // 255 0 注释:账号
-	Password     string `xorm:"password"  json:"password"`          // 255 0 注释:密码
-	CreationTime int64  `xorm:"creation_time"  json:"creationTime"` // 11 0 注释:账号创建时间
-	LoginTime    int64  `xorm:"login_time"  json:"loginTime"`       // 11 0 注释:登录时间
-	Status       string `xorm:"status"  json:"status"`              // 255 0 注释:账号状态
-	RoleId       int64  `xorm:"role_id"  json:"roleId"`             // 11 0 注释:角色id
-	Phone        string `xorm:"phone"  json:"phone"`                // 255 0 注释:手机
-	Email        string `xorm:"email"  json:"email"`                // 255 0 注释:邮箱
-	Avatar       string `xorm:"avatar"  json:"avatar"`              // 255 0 注释:头像
+type User struct {
+	Id            int64  `xorm:"id" json:"id"`                        //注释:
+	Username      string `xorm:"username" json:"username"`            //注释:账号
+	Password      string `xorm:"password" json:"password"`            //注释:密码
+	CreationTime  int64  `xorm:"creation_time" json:"creationTime"`   //注释:账号创建时间
+	LoginTime     int64  `xorm:"login_time" json:"loginTime"`         //注释:登录时间
+	Status        string `xorm:"status" json:"status"`                //注释:账号状态
+	RoleId        int64  `xorm:"role_id" json:"roleId"`               //注释:角色id
+	Phone         string `xorm:"phone" json:"phone"`                  //注释:手机
+	Email         string `xorm:"email" json:"email"`                  //注释:邮箱
+	Name          string `xorm:"name" json:"name"`                    //注释:用户名
+	Avatar        string `xorm:"avatar" json:"avatar"`                //注释:头像
+	RecommendCode string `xorm:"recommend_code" json:"recommendCode"` //注释:推荐码
+	InviterBy     int64  `xorm:"inviter_by" json:"inviterBy"`         //注释:邀请人
 }
 
-func (receiver ManageUser) String() string {
-	return fmt.Sprint("ManageUser{Id:", receiver.Id, ",Name:", receiver.Name, ",Username:", receiver.Username, ",Password:", receiver.Password, ",CreationTime:", receiver.CreationTime, ",LoginTime:", receiver.LoginTime, ",Status:", receiver.Status, ",RoleId:", receiver.RoleId, ",Phone:", receiver.Phone, ",Email:", receiver.Email, ",Avatar:", receiver.Avatar, "}")
+func (receiver User) String() string {
+	return fmt.Sprint("User{", "Id:", receiver.Id, "Username:", receiver.Username, "Password:", receiver.Password, "CreationTime:", receiver.CreationTime, "LoginTime:", receiver.LoginTime, "Status:", receiver.Status, "RoleId:", receiver.RoleId, "Phone:", receiver.Phone, "Email:", receiver.Email, "Name:", receiver.Name, "Avatar:", receiver.Avatar, "RecommendCode:", receiver.RecommendCode, "InviterBy:", receiver.InviterBy, "}")
 }
 
-// ShopAdviceCarousel 商城广告
-type ShopAdviceCarousel struct {
-	Id         int64     `json:"id"`                             // 11 0 注释:目标id
-	Name       string    `xorm:"name"  json:"name"`              // 255 0 注释:广告名称
-	ImageUrl   string    `xorm:"image_url"  json:"imageUrl"`     // 255 0 注释:图片
-	ToId       int64     `xorm:"to_id"  json:"toId"`             // 11 0 注释:目标id
-	ToType     string    `xorm:"to_type"  json:"toType"`         // 255 0 注释:目标类型
-	AdviceType string    `xorm:"advice_type"  json:"adviceType"` // 255 0 注释:广告类型,用于跳转到对应的页面
-	Sort       string    `xorm:"sort"  json:"sort"`              // 255 0 注释:排序
-	State      string    `xorm:"state"  json:"state"`            // 255 0 注释:状态
-	ShowType   string    `xorm:"show_type"  json:"showType"`     // 50 0 注释:显示类型,carousel轮播图,package,礼包
-	CreateBy   string    `xorm:"create_by"  json:"createBy"`     // 255 0 注释:创建人
-	CreateTime time.Time `xorm:"create_time"  json:"createTime"` // 0 0 注释:创建时间
-	UpdateBy   string    `xorm:"update_by"  json:"updateBy"`     // 255 0 注释:更新人
-	UpdateTime time.Time `xorm:"update_time"  json:"updateTime"` // 0 0 注释:更新时间
+type UserWallet struct {
+	Id              int64   `xorm:"id" json:"id"`                            //注释:id
+	UserId          int64   `xorm:"user_id" json:"userId"`                   //注释:用户id
+	Balance         float64 `xorm:"balance" json:"balance"`                  //注释:余额
+	PromotionAmount float64 `xorm:"promotion_amount" json:"promotionAmount"` //注释:推广获取总金额
+	RechargeAmount  float64 `xorm:"recharge_amount" json:"rechargeAmount"`   //注释:充值金额
 }
 
-func (receiver ShopAdviceCarousel) String() string {
-	return fmt.Sprint("ShopAdviceCarousel{Id:", receiver.Id, ",Name:", receiver.Name, ",ImageUrl:", receiver.ImageUrl, ",ToId:", receiver.ToId, ",ToType:", receiver.ToType, ",AdviceType:", receiver.AdviceType, ",Sort:", receiver.Sort, ",State:", receiver.State, ",ShowType:", receiver.ShowType, ",CreateBy:", receiver.CreateBy, ",CreateTime:", receiver.CreateTime, ",UpdateBy:", receiver.UpdateBy, ",UpdateTime:", receiver.UpdateTime, "}")
+func (receiver UserWallet) String() string {
+	return fmt.Sprint("UserWallet{", "Id:", receiver.Id, "UserId:", receiver.UserId, "Balance:", receiver.Balance, "PromotionAmount:", receiver.PromotionAmount, "RechargeAmount:", receiver.RechargeAmount, "}")
 }
 
-// ShopTopic 商品主题
-type ShopTopic struct {
-	Id             int64  `json:"id"`                                      // 11 0 注释:
-	Sort           string `xorm:"sort"  json:"sort"`                       // 255 0 注释:
-	ParentId       int64  `xorm:"parent_id"  json:"parentId"`              // 11 0 注释:父级id
-	TopicPageImage string `xorm:"topic_page_image"  json:"topicPageImage"` // 255 0 注释:主题首页图片
-	TopicName      string `xorm:"topic_name"  json:"topicName"`            // 255 0 注释:主题名称
-	TopicDesc      string `xorm:"topic_desc"  json:"topicDesc"`            // 255 0 注释:主题描述
-	TypeIds        string `xorm:"type_ids"  json:"typeIds"`                // 255 0 注释:商品类型id
+type DictData struct {
+	Id        int64  `xorm:"id" json:"id"`                //注释:字典编码
+	Sort      int64  `xorm:"sort" json:"sort"`            //注释:排序
+	DictLabel string `xorm:"dict_label" json:"dictLabel"` //注释:字典标签
+	DictValue string `xorm:"dict_value" json:"dictValue"` //注释:字典键值
+	DictType  string `xorm:"dict_type" json:"dictType"`   //注释:字典类型
+	Status    string `xorm:"status" json:"status"`        //注释:状态
+	CssStyle  string `xorm:"css_style" json:"cssStyle"`   //注释:样式
+	IsDefault string `xorm:"is_default" json:"isDefault"` //注释:是否默认
+	Remark    string `xorm:"remark" json:"remark"`        //注释:备注
 }
 
-func (receiver ShopTopic) String() string {
-	return fmt.Sprint("ShopTopic{Id:", receiver.Id, ",Sort:", receiver.Sort, ",ParentId:", receiver.ParentId, ",TopicPageImage:", receiver.TopicPageImage, ",TopicName:", receiver.TopicName, ",TopicDesc:", receiver.TopicDesc, ",TypeIds:", receiver.TypeIds, "}")
+func (receiver DictData) String() string {
+	return fmt.Sprint("DictData{", "Id:", receiver.Id, "Sort:", receiver.Sort, "DictLabel:", receiver.DictLabel, "DictValue:", receiver.DictValue, "DictType:", receiver.DictType, "Status:", receiver.Status, "CssStyle:", receiver.CssStyle, "IsDefault:", receiver.IsDefault, "Remark:", receiver.Remark, "}")
 }
 
-// ShopTopicSku 商城主题商品
-type ShopTopicSku struct {
-	Id      int64 `json:"id"`                       // 11 0 注释:
-	TopicId int64 `xorm:"topic_id"  json:"topicId"` // 11 0 注释:
-	SkuId   int64 `xorm:"sku_id"  json:"skuId"`     // 11 0 注释:
+type DictType struct {
+	Id       int64  `xorm:"id" json:"id"`              //注释:
+	DictName string `xorm:"dict_name" json:"dictName"` //注释:字典名称
+	DictType string `xorm:"dict_type" json:"dictType"` //注释:字典类型
+	Status   string `xorm:"status" json:"status"`      //注释:状态(1正常/0停用)
+	Remark   string `xorm:"remark" json:"remark"`      //注释:备注
 }
 
-func (receiver ShopTopicSku) String() string {
-	return fmt.Sprint("ShopTopicSku{Id:", receiver.Id, ",TopicId:", receiver.TopicId, ",SkuId:", receiver.SkuId, "}")
+func (receiver DictType) String() string {
+	return fmt.Sprint("DictType{", "Id:", receiver.Id, "DictName:", receiver.DictName, "DictType:", receiver.DictType, "Status:", receiver.Status, "Remark:", receiver.Remark, "}")
 }
 
-// User 用户表
-type User struct {
-	Id            int64  `json:"id"`                                   // 11 0 注释:
-	Username      string `xorm:"username"  json:"username"`            // 255 0 注释:账号
-	Password      string `xorm:"password"  json:"password"`            // 255 0 注释:密码
-	CreationTime  int64  `xorm:"creation_time"  json:"creationTime"`   // 11 0 注释:账号创建时间
-	LoginTime     int64  `xorm:"login_time"  json:"loginTime"`         // 11 0 注释:登录时间
-	Status        string `xorm:"status"  json:"status"`                // 255 0 注释:账号状态
-	RoleId        int64  `xorm:"role_id"  json:"roleId"`               // 11 0 注释:角色id
-	Phone         string `xorm:"phone"  json:"phone"`                  // 255 0 注释:手机
-	Email         string `xorm:"email"  json:"email"`                  // 255 0 注释:邮箱
-	Name          string `xorm:"name"  json:"name"`                    // 255 0 注释:用户名
-	Avatar        string `xorm:"avatar"  json:"avatar"`                // 255 0 注释:头像
-	InviterBy     int64  `xorm:"inviter_by"  json:"inviterBy"`         // 11 0 注释:邀请人
-	RecommendCode string `xorm:"recommend_code"  json:"recommendCode"` // 255 0 注释:推荐码
+type ShopTopic struct {
+	Id             int64  `xorm:"id" json:"id"`                           //注释:
+	Sort           string `xorm:"sort" json:"sort"`                       //注释:排序
+	ParentId       int64  `xorm:"parent_id" json:"parentId"`              //注释:父级id
+	TopicPageImage string `xorm:"topic_page_image" json:"topicPageImage"` //注释:主题首页图片
+	TopicName      string `xorm:"topic_name" json:"topicName"`            //注释:主题名称
+	TopicDesc      string `xorm:"topic_desc" json:"topicDesc"`            //注释:主题描述
+	TypeIds        string `xorm:"type_ids" json:"typeIds"`                //注释:商品类型id
 }
 
-func (receiver User) String() string {
-	return fmt.Sprint("User{Id:", receiver.Id, ",Username:", receiver.Username, ",Password:", receiver.Password, ",CreationTime:", receiver.CreationTime, ",LoginTime:", receiver.LoginTime, ",Status:", receiver.Status, ",RoleId:", receiver.RoleId, ",Phone:", receiver.Phone, ",Email:", receiver.Email, ",Name:", receiver.Name, ",Avatar:", receiver.Avatar, ",InviterBy:", receiver.InviterBy, ",RecommendCode:", receiver.RecommendCode, "}")
+func (receiver ShopTopic) String() string {
+	return fmt.Sprint("ShopTopic{", "Id:", receiver.Id, "Sort:", receiver.Sort, "ParentId:", receiver.ParentId, "TopicPageImage:", receiver.TopicPageImage, "TopicName:", receiver.TopicName, "TopicDesc:", receiver.TopicDesc, "TypeIds:", receiver.TypeIds, "}")
 }
 
-// UserWallet 用户钱包
-type UserWallet struct {
-	Id              int64   `json:"id"`                                       // 11 0 注释:id
-	UserId          int64   `xorm:"user_id"  json:"userId"`                   // 11 0 注释:用户id
-	Balance         float64 `xorm:"balance"  json:"balance"`                  // 65 0 注释:余额
-	PromotionAmount float64 `xorm:"promotion_amount"  json:"promotionAmount"` // 20 2 注释:推广获取总金额
-	RechargeAmount  float64 `xorm:"recharge_amount"  json:"rechargeAmount"`   // 20 2 注释:充值金额
+type ShopAdviceCarousel struct {
+	Id         int64     `xorm:"id" json:"id"`                  //注释:
+	Name       string    `xorm:"name" json:"name"`              //注释:广告名称
+	ToId       int64     `xorm:"to_id" json:"toId"`             //注释:目标id
+	AdviceType string    `xorm:"advice_type" json:"adviceType"` //注释:广告类型,用于跳转到对应的页面
+	Sort       string    `xorm:"sort" json:"sort"`              //注释:排序
+	State      string    `xorm:"state" json:"state"`            //注释:状态
+	ShowType   string    `xorm:"show_type" json:"showType"`     //注释:显示类型,carousel轮播图,package,礼包
+	CreateBy   string    `xorm:"create_by" json:"createBy"`     //注释:创建人
+	CreateTime time.Time `xorm:"create_time" json:"createTime"` //注释:创建时间
+	UpdateBy   string    `xorm:"update_by" json:"updateBy"`     //注释:更新人
+	UpdateTime time.Time `xorm:"update_time" json:"updateTime"` //注释:更新时间
+	ImageUrl   string    `xorm:"image_url" json:"imageUrl"`     //注释:图片
+	ToType     string    `xorm:"to_type" json:"toType"`         //注释:目标类型
 }
 
-func (receiver UserWallet) String() string {
-	return fmt.Sprint("UserWallet{Id:", receiver.Id, ",UserId:", receiver.UserId, ",Balance:", receiver.Balance, ",PromotionAmount:", receiver.PromotionAmount, ",RechargeAmount:", receiver.RechargeAmount, "}")
+func (receiver ShopAdviceCarousel) String() string {
+	return fmt.Sprint("ShopAdviceCarousel{", "Id:", receiver.Id, "Name:", receiver.Name, "ToId:", receiver.ToId, "AdviceType:", receiver.AdviceType, "Sort:", receiver.Sort, "State:", receiver.State, "ShowType:", receiver.ShowType, "CreateBy:", receiver.CreateBy, "CreateTime:", receiver.CreateTime, "UpdateBy:", receiver.UpdateBy, "UpdateTime:", receiver.UpdateTime, "ImageUrl:", receiver.ImageUrl, "ToType:", receiver.ToType, "}")
+}
+
+type ShopTopicSku struct {
+	Id      int64 `xorm:"id" json:"id"`            //注释:
+	TopicId int64 `xorm:"topic_id" json:"topicId"` //注释:
+	SkuId   int64 `xorm:"sku_id" json:"skuId"`     //注释:
+}
+
+func (receiver ShopTopicSku) String() string {
+	return fmt.Sprint("ShopTopicSku{", "Id:", receiver.Id, "TopicId:", receiver.TopicId, "SkuId:", receiver.SkuId, "}")
 }

+ 7 - 6
data/domain/Query.go

@@ -9,7 +9,7 @@ type ArticleQuery struct {
 	ArticleTopicId   int64  `xorm:"article_topic_id"  json:"articleTopicId"` // 文章主题id
 	Image            string `xorm:"image"  json:"image"`                     // 图片
 	PublishTimeStart string `xorm:"publish_time"  json:"publishTime"`        // 发表时间
-	PublishTimeEnd   string `xorm:"publish_time"  json:publishTime"`         // 发表时间
+	PublishTimeEnd   string `xorm:"publish_time"  json:"publishTime"`        // 发表时间
 	EyeFillStart     int64  `xorm:"eye_fill"  json:"eyeFill"`                // 浏览量
 	EyeFillEnd       int64  `xorm:"eye_fill"  json:"eyeFill"`                // 浏览量
 	LikeCountStart   int64  `xorm:"like_count"  json:"likeCount"`            // 点赞量
@@ -44,7 +44,7 @@ type BackAuthorityQuery struct {
 	State                 string `xorm:"state"  json:"state"`                                  // 接口是否启用(0关闭,1启用)
 	AuthorityVerification string `xorm:"authority_verification"  json:"authorityVerification"` // 权限校验
 	CreateTimeStart       string `xorm:"create_time"  json:"createTime"`                       // 创建时间
-	CreateTimeEnd         string `xorm:"create_time"  json:createTime"`                        // 创建时间
+	CreateTimeEnd         string `xorm:"create_time"  json:"createTime"`                       // 创建时间
 }
 
 type BackMenuQuery struct {
@@ -133,7 +133,7 @@ type GoodsCouponQuery struct {
 	ReceiveType         string  `xorm:"receive_type"  json:"receiveType"`            // 领取条件
 	Validity            string  `xorm:"validity"  json:"validity"`                   // 有效性,领取开始计时(ClaimTiming),固定时间(FixedTime)
 	ValidityPeriodStart string  `xorm:"validity_period"  json:"validityPeriod"`      // 有效期
-	ValidityPeriodEnd   string  `xorm:"validity_period"  json:validityPeriod"`       // 有效期
+	ValidityPeriodEnd   string  `xorm:"validity_period"  json:"validityPeriod"`      // 有效期
 }
 
 type GoodsCouponUserQuery struct {
@@ -183,7 +183,8 @@ type GoodsSkuQuery struct {
 	GoodsId          int64   `xorm:"goods_id"  json:"goodsId"`                   // 商品id
 	CreateBy         string  `xorm:"create_by"  json:"createBy"`                 // 创建人
 	CreateTimeStart  string  `xorm:"create_time"  json:"createTime"`             // 创建时间
-	CreateTimeEnd    string  `xorm:"create_time"  json:createTime"`              // 创建时间
+	CreateTimeEnd    string  `xorm:"create_time"  json:"createTime"`             // 创建时间
+	Sort             int64   `xorm:"sort"  json:"sort"`                          // 排序
 }
 
 type GoodsSkuCardQuery struct {
@@ -195,7 +196,7 @@ type GoodsSkuCardQuery struct {
 	CardKey         string `xorm:"card_key"  json:"cardKey"`       // 卡密
 	Use             string `xorm:"use"  json:"use"`                // 是否已用
 	UploadTimeStart string `xorm:"upload_time"  json:"uploadTime"` // 入库时间
-	UploadTimeEnd   string `xorm:"upload_time"  json:uploadTime"`  // 入库时间
+	UploadTimeEnd   string `xorm:"upload_time"  json:"uploadTime"` // 入库时间
 	SkuId           int64  `xorm:"sku_id"  json:"skuId"`           // 商品规格绑定
 	Sort            string `xorm:"sort"  json:"sort"`              // 排序,出售优先级
 }
@@ -213,7 +214,7 @@ type GoodsTypeQuery struct {
 	TypeImage       string `xorm:"type_image"  json:"typeImage"`   // 类型图片
 	TypeName        string `xorm:"type_name"  json:"typeName"`     // 商品类别名称
 	CreateTimeStart string `xorm:"create_time"  json:"createTime"` // 创建时间
-	CreateTimeEnd   string `xorm:"create_time"  json:createTime"`  // 创建时间
+	CreateTimeEnd   string `xorm:"create_time"  json:"createTime"` // 创建时间
 }
 
 type UserQuery struct {

+ 15 - 0
data/domain/ReqVo.go

@@ -0,0 +1,15 @@
+package domain
+
+import "strconv"
+
+type SkuSort struct {
+	Id   int64 `xorm:"id" json:"id"`
+	Sort int64 `xorm:"sort" json:"sort"`
+}
+
+func (s SkuSort) String() string {
+	return "SkuSort{" +
+		"id=" + strconv.FormatInt(s.Id, 10) +
+		", sort=" + strconv.FormatInt(s.Sort, 10) +
+		"}"
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
file/virtual_mall.sql


+ 9 - 144
router/BackGoodsRouter.go

@@ -1,169 +1,34 @@
 package router
 
 import (
-	"demo/data/dao/manage"
+	"demo/data/dao"
 	"demo/data/domain"
-	"demo/data/domain/vo"
 	"demo/share"
-	"fmt"
 	"github.com/gin-gonic/gin"
 	"github.com/mitchellh/mapstructure"
-	"github.com/spf13/cast"
-	"time"
 )
 
 // BackGoodsRouter 废弃
 func BackGoodsRouter(engine *gin.RouterGroup) {
 	user := engine.Group("/back/goods")
-	PushRouter(user, "GET", "/introduction", GetIntroductionByGoodsId)
-	PushRouter(user, "POST", "list", GetGoodsAndIntroductionList)
-	PushRouter(user, "POST", "", SaveGoods)
-	PushRouter(user, "PUT", "", UpdateGoods)
-	PushRouter(user, "DELETE", "/:id", DeleteGoodsById)
-
-}
-
-func GetIntroductionByGoodsId(c *gin.Context) {
-	id := c.Query("id")
-	byId, err := manage.GetGoodsById(cast.ToInt64(id))
-	if err != nil {
-		c.JSON(200, CreateResultError(500, "商品不存在"))
-		return
-	}
-	introductionById, err := manage.GetGoodsIntroductionById(byId.IntroductionId)
-	if err != nil {
-		c.JSON(200, CreateResultError(500, "商品介绍不存在"))
-		return
-	}
-	c.JSON(200, CreateResultData(introductionById))
+	PushRouter(user, "POST", "/sort", SortSku)
 }
 
-// GetGoodsAndIntroductionList 根据商品id获取商品及商品相关文章
-func GetGoodsAndIntroductionList(c *gin.Context) {
+func SortSku(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
-	}
-	intrIds := make([]int64, 0)
-	for i := range list.List {
-		///类型判断
-		item, ok := list.List[i].(domain.Goods)
-		if ok {
-			intrIds = append(intrIds, item.IntroductionId)
-		}
-	}
-	intrs, err := manage.GetGoodsIntroductionListInId(intrIds)
-	if err != nil {
-		c.JSON(200, CreateResultError(500, "查询错误"))
-		return
-	}
+	list, _ := data("sortList")
+	sorts := make([]domain.SkuSort, 0)
 
-	dataMap := make(map[int64]vo.GoodsVo)
-	for i := 0; i < len(list.List); i++ {
-		dataMap[list.List[i].(domain.Goods).IntroductionId] = vo.GoodsVo{Goods: list.List[i].(domain.Goods)}
-	}
-	for i := 0; i < len(intrs); i++ {
-		voData, ok := dataMap[intrs[i].Id]
-		if ok {
-			voData.Introduction = intrs[i]
-		}
-	}
-	//取出values
-	resArr := make([]any, 0)
-	for _, v := range dataMap {
-		resArr = append(resArr, v)
-	}
-	list.List = resArr
-	c.JSON(200, CreateResultData(list))
-}
-
-func SaveGoods(c *gin.Context) {
-	data := share.GetJsonAnyParam(c)
-	goodsParam, _ := data("goods")
-	//typeId, _ := data("typeId")
-	//tagIds, _ := data("tagIds")
-
-	goods := domain.Goods{}
-	err := mapstructure.Decode(goodsParam, &goods)
-	saveGoods, err := manage.SaveGoods(&goods)
-	if err != nil {
-		c.JSON(200, CreateResultError(500, "商品保存错误"))
-		return
-	}
-	goodsIntroductionParam, _ := data("introduction")
-	goodsIntroduction := domain.GoodsIntroduction{}
-	err = mapstructure.Decode(goodsIntroductionParam, &goodsIntroduction)
-	goodsIntroduction.CreateBy = fmt.Sprint(GetUserIdByToken(c))
-	goodsIntroduction.CreateTime = time.Now()
-	saveGoodsIntroduction, err := manage.SaveGoodsIntroduction(&goodsIntroduction)
+	err := mapstructure.Decode(list, &sorts)
 	if err != nil {
-		c.JSON(200, CreateResultError(500, "商品介绍保存错误"))
-		return
-	}
-	m := make(map[string]interface{})
-	m["goods"] = saveGoods
-	m["introduction"] = saveGoodsIntroduction
-	c.JSON(200, CreateResultData(m))
-}
-
-func UpdateGoods(c *gin.Context) {
-	data := share.GetJsonAnyParam(c)
-	goodsIntroduction, _ := data("introduction")
-	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, CreateResultError(400, "参数解析错误"))
 
-	intrId := setGoods.IntroductionId
-	toIntrMap := UtilStructToMap(cast.ToStringMap(goodsIntroduction))
-	toIntrMap["create_by"] = "fmt.Sprint(GetUserIdByToken(c))"
-	setGoodsIntroduction, b, err := manage.SetGoodsIntroduction(toIntrMap, cast.ToInt64(intrId))
-	if err != nil || !b {
-		c.JSON(200, CreateResultError(500, "修改错误"))
 		return
 	}
-	m := make(map[string]interface{})
-	m["goods"] = setGoods
-	m["introduction"] = setGoodsIntroduction
-	c.JSON(200, CreateResultData(m))
-}
-func DeleteGoodsById(c *gin.Context) {
-	id := c.Query("id")
-	byId, err := manage.GetGoodsById(cast.ToInt64(id))
-
+	err = dao.SortSkuList(sorts)
 	if err != nil {
-		c.JSON(200, CreateResultError(500, "删除失败"))
-		return
-	}
-	if byId.Id == 0 || byId.Id > 0 {
-		c.JSON(200, CreateResultError(500, "商品不存在删除失败"))
+		c.JSON(200, CreateResultError(400, "排序失败"))
 		return
 	}
-	res := manage.DeleteGoods(cast.ToInt64(id))
-	if !res {
-		c.JSON(200, CreateResultError(500, "删除错误"))
-		return
-	}
-	res = manage.DeleteGoodsIntroduction(cast.ToInt64(byId.IntroductionId))
-	if !res {
-		c.JSON(200, CreateResultError(500, "文章删除错误"))
-		return
-	}
-
 	c.JSON(200, CreateResult())
 }

+ 1 - 0
router/Router.go

@@ -33,6 +33,7 @@ func InitRouter(apiGroup *gin.RouterGroup) {
 	//-------------------
 	//后台管理系统
 	BackRouter(apiGroup)
+	BackGoodsRouter(apiGroup)
 
 	//首页
 	HomeRouter(apiGroup)

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä