DoMain.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. package domain
  2. import (
  3. "fmt"
  4. "time"
  5. )
  6. // Article
  7. type Article struct {
  8. Id int64 `json:"id"` // 11 0 注释:id
  9. ArticleTitle string `xorm:"article_title" json:"articleTitle"` // 255 0 注释:文章名称
  10. ArticeContent string `xorm:"artice_content" json:"articeContent"` // 0 0 注释:文章内容
  11. State string `xorm:"state" json:"state"` // 255 0 注释:状态
  12. ArticeTagIds string `xorm:"artice_tag_ids" json:"articeTagIds"` // 255 0 注释:文章标签
  13. ArticeTopicId int `xorm:"artice_topic_id" json:"articeTopicId"` // 11 0 注释:文章主题id
  14. Image string `xorm:"image" json:"image"` // 255 0 注释:图片
  15. PublishTime time.Time `xorm:"publish_time" json:"publishTime"` // 0 0 注释:发表时间
  16. EyeFill int `xorm:"eye_fill" json:"eyeFill"` // 11 0 注释:浏览量
  17. LikeCount int `xorm:"like_count" json:"likeCount"` // 255 0 注释:点赞量
  18. CreateBy string `xorm:"create_by" json:"createBy"` // 255 0 注释:创建人
  19. CreateTime time.Time `xorm:"create_time" json:"createTime"` // 0 0 注释:创建时间
  20. UpdateBy string `xorm:"update_by" json:"updateBy"` // 255 0 注释:更新人
  21. UpdateTime time.Time `xorm:"update_time" json:"updateTime"` // 0 0 注释:更新时间
  22. }
  23. func (receiver Article) String() string {
  24. return fmt.Sprint("Article{Id:", receiver.Id, ",ArticleTitle:", receiver.ArticleTitle, ",ArticeContent:", receiver.ArticeContent, ",State:", receiver.State, ",ArticeTagIds:", receiver.ArticeTagIds, ",ArticeTopicId:", receiver.ArticeTopicId, ",Image:", receiver.Image, ",PublishTime:", receiver.PublishTime, ",EyeFill:", receiver.EyeFill, ",LikeCount:", receiver.LikeCount, ",CreateBy:", receiver.CreateBy, ",CreateTime:", receiver.CreateTime, ",UpdateBy:", receiver.UpdateBy, ",UpdateTime:", receiver.UpdateTime, "}")
  25. }
  26. // ArticleTag
  27. type ArticleTag struct {
  28. Id int64 `json:"id"` // 11 0 注释:
  29. TagName string `xorm:"tag_name" json:"tagName"` // 255 0 注释:标签名
  30. TagDesc string `xorm:"tag_desc" json:"tagDesc"` // 255 0 注释:标签描述
  31. }
  32. func (receiver ArticleTag) String() string {
  33. return fmt.Sprint("ArticleTag{Id:", receiver.Id, ",TagName:", receiver.TagName, ",TagDesc:", receiver.TagDesc, "}")
  34. }
  35. // ArticleTopic
  36. type ArticleTopic struct {
  37. Id int64 `json:"id"` // 11 0 注释:
  38. Image string `xorm:"image" json:"image"` // 255 0 注释:图片
  39. TopicName string `xorm:"topic_name" json:"topicName"` // 255 0 注释:主题名称
  40. TopicDesc string `xorm:"topic_desc" json:"topicDesc"` // 255 0 注释:主题描述
  41. }
  42. func (receiver ArticleTopic) String() string {
  43. return fmt.Sprint("ArticleTopic{Id:", receiver.Id, ",Image:", receiver.Image, ",TopicName:", receiver.TopicName, ",TopicDesc:", receiver.TopicDesc, "}")
  44. }
  45. // Authority
  46. type Authority struct {
  47. Id int64 `json:"id"` // 11 0 注释:
  48. AuthorityName string `xorm:"authority_name" json:"authorityName"` // 255 0 注释:
  49. AuthorityPath string `xorm:"authority_path" json:"authorityPath"` // 255 0 注释:
  50. }
  51. func (receiver Authority) String() string {
  52. return fmt.Sprint("Authority{Id:", receiver.Id, ",AuthorityName:", receiver.AuthorityName, ",AuthorityPath:", receiver.AuthorityPath, "}")
  53. }
  54. // Goods
  55. type Goods struct {
  56. Id int64 `json:"id"` // 11 0 注释:id
  57. TypeId int `xorm:"type_id" json:"typeId"` // 11 0 注释:分类id
  58. GoodsName string `xorm:"goods_name" json:"goodsName"` // 255 0 注释:商品名字
  59. IntroductionId int `xorm:"introduction_id" json:"introductionId"` // 11 0 注释:商品介绍id
  60. SalesVolume int `xorm:"sales_volume" json:"salesVolume"` // 255 0 注释:近30天销量
  61. TagIds string `xorm:"tag_ids" json:"tagIds"` // 255 0 注释:商品标签
  62. }
  63. func (receiver Goods) String() string {
  64. return fmt.Sprint("Goods{Id:", receiver.Id, ",TypeId:", receiver.TypeId, ",GoodsName:", receiver.GoodsName, ",IntroductionId:", receiver.IntroductionId, ",SalesVolume:", receiver.SalesVolume, ",TagIds:", receiver.TagIds, "}")
  65. }
  66. // GoodsCommodityArea
  67. type GoodsCommodityArea struct {
  68. Id int64 `json:"id"` // 11 0 注释:id
  69. GoodsId int `xorm:"goods_id" json:"goodsId"` // 11 0 注释:商品id
  70. CommodityAreaName string `xorm:"commodity_area_name" json:"commodityAreaName"` // 255 0 注释:商品属地名称
  71. DetailImage string `xorm:"detail_image" json:"detailImage"` // 255 0 注释:详情图片
  72. DetailIntroductionId int `xorm:"detail_introduction_id" json:"detailIntroductionId"` // 11 0 注释:相关文本详情id
  73. }
  74. func (receiver GoodsCommodityArea) String() string {
  75. return fmt.Sprint("GoodsCommodityArea{Id:", receiver.Id, ",GoodsId:", receiver.GoodsId, ",CommodityAreaName:", receiver.CommodityAreaName, ",DetailImage:", receiver.DetailImage, ",DetailIntroductionId:", receiver.DetailIntroductionId, "}")
  76. }
  77. // GoodsCoupon 优惠券
  78. type GoodsCoupon struct {
  79. Id int64 `json:"id"` // 11 0 注释:id
  80. CouponName string `xorm:"coupon_name" json:"couponName"` // 255 0 注释:优惠券名称
  81. CouponDesc string `xorm:"coupon_desc" json:"couponDesc"` // 255 0 注释:优惠券描述
  82. CashBackPoint float64 `xorm:"cash_back_point" json:"cashBackPoint"` // 11 2 注释:满x
  83. CashBackPrice float64 `xorm:"cash_back_price" json:"cashBackPrice"` // 11 2 注释:减x
  84. ConditionByTopic string `xorm:"condition_by_topic" json:"conditionByTopic"` // 255 0 注释:主题可用,id
  85. ConditionByType string `xorm:"condition_by_type" json:"conditionByType"` // 255 0 注释:类型可用,id
  86. ConditionByGoods string `xorm:"condition_by_goods" json:"conditionByGoods"` // 255 0 注释:商品可用,id
  87. GrantCount string `xorm:"grant_count" json:"grantCount"` // 255 0 注释:发放数量
  88. Count int `xorm:"count" json:"count"` // 255 0 注释:优惠券余量
  89. ReceiveType string `xorm:"receive_type" json:"receiveType"` // 255 0 注释:领取条件
  90. Validity string `xorm:"validity" json:"validity"` // 255 0 注释:有效性,领取开始计时(ClaimTiming),固定时间(FixedTime)
  91. ValidityPeriod time.Time `xorm:"validity_period" json:"validityPeriod"` // 0 0 注释:有效期
  92. }
  93. func (receiver GoodsCoupon) String() string {
  94. 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, "}")
  95. }
  96. // GoodsCouponUser 优惠券领取
  97. type GoodsCouponUser struct {
  98. Id int64 `json:"id"` // 11 0 注释:id
  99. UserId int `xorm:"user_id" json:"userId"` // 11 0 注释:用户id
  100. CouponId int `xorm:"coupon_id" json:"couponId"` // 11 0 注释:优惠券id
  101. CollectionTime time.Time `xorm:"collection_time" json:"collectionTime"` // 0 0 注释:领取时间
  102. State string `xorm:"state" json:"state"` // 255 0 注释:状态,已使用2,未使用1,已过期0
  103. }
  104. func (receiver GoodsCouponUser) String() string {
  105. return fmt.Sprint("GoodsCouponUser{Id:", receiver.Id, ",UserId:", receiver.UserId, ",CouponId:", receiver.CouponId, ",CollectionTime:", receiver.CollectionTime, ",State:", receiver.State, "}")
  106. }
  107. // GoodsIntroduction 商品介绍
  108. type GoodsIntroduction struct {
  109. Id int64 `json:"id"` // 11 0 注释:文章id
  110. GoodsArticleName string `xorm:"goods_article_name" json:"goodsArticleName"` // 255 0 注释:商品文章名
  111. GoodsArticle string `xorm:"goods_article" json:"goodsArticle"` // 0 0 注释:商品文章
  112. CreateBy string `xorm:"create_by" json:"createBy"` // 0 0 注释:创建人
  113. CreateTime time.Time `xorm:"create_time" json:"createTime"` // 0 0 注释:创建时间
  114. UpdateBy string `xorm:"update_by" json:"updateBy"` // 255 0 注释:更新人
  115. UpdateTime time.Time `xorm:"update_time" json:"updateTime"` // 0 0 注释:更新时间
  116. }
  117. func (receiver GoodsIntroduction) String() string {
  118. 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, "}")
  119. }
  120. // GoodsOrder
  121. type GoodsOrder struct {
  122. Id int64 `json:"id"` // 11 0 注释:id
  123. OrderName string `xorm:"order_name" json:"orderName"` // 255 0 注释:订单名
  124. SkuId int `xorm:"sku_id" json:"skuId"` // 11 0 注释:skuid
  125. Count int `xorm:"count" json:"count"` // 11 0 注释:购买数量
  126. Price float64 `xorm:"price" json:"price"` // 10 2 注释:单价
  127. TotalPrice float64 `xorm:"total_price" json:"totalPrice"` // 10 2 注释:总价
  128. ContactInformation string `xorm:"contact_information" json:"contactInformation"` // 255 0 注释:联系方式
  129. CouponUserId int64 `xorm:"coupon_user_id" json:"couponUserId"` // 11 0 注释:使用的优惠券
  130. State string `xorm:"state" json:"state"` // 10 0 注释:支付状态,0待支付,1待发货,2已发货,3订单完成,4订单异常
  131. CreateBy int `xorm:"create_by" json:"createBy"` // 255 0 注释:用户id
  132. CreateTime time.Time `xorm:"create_time" json:"createTime"` // 0 0 注释:订单创建时间
  133. }
  134. func (receiver GoodsOrder) String() string {
  135. 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, "}")
  136. }
  137. // GoodsSku
  138. type GoodsSku struct {
  139. Id int64 `json:"id"` // 11 0 注释:
  140. SkuImage string `xorm:"sku_image" json:"skuImage"` // 255 0 注释:sku图片
  141. SkuName string `xorm:"sku_name" json:"skuName"` // 255 0 注释:商品sku名字
  142. Price float64 `xorm:"price" json:"price"` // 10 2 注释:现在价格
  143. HistoricalPrices float64 `xorm:"historical_prices" json:"historicalPrices"` // 10 2 注释:历史价格
  144. InventoryNumber int `xorm:"inventory_number" json:"inventoryNumber"` // 11 0 注释:库存
  145. CommodityAreaId int `xorm:"commodity_area_id" json:"commodityAreaId"` // 11 0 注释:属地id
  146. GoodsId int `xorm:"goods_id" json:"goodsId"` // 11 0 注释:商品id
  147. CreateBy string `xorm:"create_by" json:"createBy"` // 255 0 注释:创建人
  148. CreateTime time.Time `xorm:"create_time" json:"createTime"` // 0 0 注释:创建时间
  149. }
  150. func (receiver GoodsSku) String() string {
  151. 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, "}")
  152. }
  153. // GoodsSkuCard
  154. type GoodsSkuCard struct {
  155. Id int64 `json:"id"` // 11 0 注释:id
  156. CardName string `xorm:"card_name" json:"cardName"` // 255 0 注释:卡种名称
  157. State string `xorm:"state" json:"state"` // 255 0 注释:状态,0未使用,1已用,2过期
  158. Count int `xorm:"count" json:"count"` // 11 0 注释:库存
  159. TotalCount string `xorm:"total_count" json:"totalCount"` // 255 0 注释:总数
  160. CardKey string `xorm:"card_key" json:"cardKey"` // 255 0 注释:卡密
  161. Use string `xorm:"use" json:"use"` // 5 0 注释:是否已用
  162. UploadTime time.Time `xorm:"upload_time" json:"uploadTime"` // 0 0 注释:入库时间
  163. SkuId int `xorm:"sku_id" json:"skuId"` // 11 0 注释:商品规格绑定
  164. Sort string `xorm:"sort" json:"sort"` // 255 0 注释:排序,出售优先级
  165. }
  166. func (receiver GoodsSkuCard) String() string {
  167. 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, "}")
  168. }
  169. // GoodsTag
  170. type GoodsTag struct {
  171. Id int64 `json:"id"` // 11 0 注释:id
  172. Name string `xorm:"name" json:"name"` // 255 0 注释:名字
  173. IconUrl string `xorm:"icon_url" json:"iconUrl"` // 255 0 注释:图标路径
  174. Tag string `xorm:"tag" json:"tag"` // 255 0 注释:标签
  175. }
  176. func (receiver GoodsTag) String() string {
  177. return fmt.Sprint("GoodsTag{Id:", receiver.Id, ",Name:", receiver.Name, ",IconUrl:", receiver.IconUrl, ",Tag:", receiver.Tag, "}")
  178. }
  179. // GoodsTopic
  180. type GoodsTopic struct {
  181. Id int64 `json:"id"` // 11 0 注释:
  182. TopicPageImage string `xorm:"topic_page_image" json:"topicPageImage"` // 255 0 注释:主题首页图片
  183. TopicName string `xorm:"topic_name" json:"topicName"` // 255 0 注释:主题名称
  184. TopicDesc string `xorm:"topic_desc" json:"topicDesc"` // 255 0 注释:主题描述
  185. TypeIds string `xorm:"type_ids" json:"typeIds"` // 255 0 注释:商品类型id
  186. }
  187. func (receiver GoodsTopic) String() string {
  188. return fmt.Sprint("GoodsTopic{Id:", receiver.Id, ",TopicPageImage:", receiver.TopicPageImage, ",TopicName:", receiver.TopicName, ",TopicDesc:", receiver.TopicDesc, ",TypeIds:", receiver.TypeIds, "}")
  189. }
  190. // GoodsType 商品分类
  191. type GoodsType struct {
  192. Id int64 `json:"id"` // 11 0 注释:
  193. Sort int `xorm:"sort" json:"sort"` // 11 0 注释:排序
  194. TypeImage string `xorm:"type_image" json:"typeImage"` // 50 0 注释:类型图片
  195. TypeName string `xorm:"type_name" json:"typeName"` // 255 0 注释:商品类别名称
  196. CreateTime time.Time `xorm:"create_time" json:"createTime"` // 0 0 注释:创建时间
  197. }
  198. func (receiver GoodsType) String() string {
  199. return fmt.Sprint("GoodsType{Id:", receiver.Id, ",Sort:", receiver.Sort, ",TypeImage:", receiver.TypeImage, ",TypeName:", receiver.TypeName, ",CreateTime:", receiver.CreateTime, "}")
  200. }
  201. // ManageUser
  202. type ManageUser struct {
  203. Id int64 `json:"id"` // 11 0 注释:
  204. Name string `xorm:"name" json:"name"` // 255 0 注释:名称
  205. Username string `xorm:"username" json:"username"` // 255 0 注释:账号
  206. Password string `xorm:"password" json:"password"` // 255 0 注释:密码
  207. CreationTime int `xorm:"creation_time" json:"creationTime"` // 11 0 注释:账号创建时间
  208. LoginTime int `xorm:"login_time" json:"loginTime"` // 11 0 注释:登录时间
  209. Status string `xorm:"status" json:"status"` // 255 0 注释:账号状态
  210. RoleId int `xorm:"role_id" json:"roleId"` // 11 0 注释:角色id
  211. Phone string `xorm:"phone" json:"phone"` // 255 0 注释:手机
  212. Email string `xorm:"email" json:"email"` // 255 0 注释:邮箱
  213. Avatar string `xorm:"avatar" json:"avatar"` // 255 0 注释:头像
  214. }
  215. func (receiver ManageUser) String() string {
  216. 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, "}")
  217. }
  218. // Role
  219. type Role struct {
  220. Id int64 `json:"id"` // 11 0 注释:
  221. RoleName string `xorm:"role_name" json:"roleName"` // 255 0 注释:
  222. }
  223. func (receiver Role) String() string {
  224. return fmt.Sprint("Role{Id:", receiver.Id, ",RoleName:", receiver.RoleName, "}")
  225. }
  226. // RoleAuthority
  227. type RoleAuthority struct {
  228. AuthorityId int `xorm:"authority_id" json:"authorityId"` // 11 0 注释:
  229. RoleId int `xorm:"role_id" json:"roleId"` // 11 0 注释:
  230. }
  231. func (receiver RoleAuthority) String() string {
  232. return fmt.Sprint("RoleAuthority{AuthorityId:", receiver.AuthorityId, ",RoleId:", receiver.RoleId, "}")
  233. }
  234. // User
  235. type User struct {
  236. Id int64 `json:"id"` // 11 0 注释:
  237. Username string `xorm:"username" json:"username"` // 255 0 注释:账号
  238. Password string `xorm:"password" json:"password"` // 255 0 注释:密码
  239. CreationTime int `xorm:"creation_time" json:"creationTime"` // 11 0 注释:账号创建时间
  240. LoginTime int `xorm:"login_time" json:"loginTime"` // 11 0 注释:登录时间
  241. Status string `xorm:"status" json:"status"` // 255 0 注释:账号状态
  242. RoleId int `xorm:"role_id" json:"roleId"` // 11 0 注释:角色id
  243. Phone string `xorm:"phone" json:"phone"` // 255 0 注释:手机
  244. Email string `xorm:"email" json:"email"` // 255 0 注释:邮箱
  245. Name string `xorm:"name" json:"name"` // 255 0 注释:用户名
  246. Avatar string `xorm:"avatar" json:"avatar"` // 255 0 注释:头像
  247. RecommendCode string `xorm:"recommend_code" json:"recommendCode"` // 255 0 注释:推荐码
  248. }
  249. func (receiver User) String() string {
  250. 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, "}")
  251. }
  252. // UserWallet
  253. type UserWallet struct {
  254. Id int64 `json:"id"` // 11 0 注释:id
  255. UserId int `xorm:"user_id" json:"userId"` // 11 0 注释:用户id
  256. Balance float64 `xorm:"balance" json:"balance"` // 65 0 注释:余额
  257. PromotionAmount float64 `xorm:"promotion_amount" json:"promotionAmount"` // 20 2 注释:推广获取总金额
  258. RechargeAmount float64 `xorm:"recharge_amount" json:"rechargeAmount"` // 20 2 注释:充值金额
  259. }
  260. func (receiver UserWallet) String() string {
  261. return fmt.Sprint("UserWallet{Id:", receiver.Id, ",UserId:", receiver.UserId, ",Balance:", receiver.Balance, ",PromotionAmount:", receiver.PromotionAmount, ",RechargeAmount:", receiver.RechargeAmount, "}")
  262. }