DoMain.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. package domain
  2. import (
  3. "fmt"
  4. "time"
  5. )
  6. //Article
  7. type Article struct {
  8. Id int `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 int `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 int `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 int `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 int `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 int `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 int `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 0 注释:满x
  83. CashBackPrice float64 `xorm:"cash_back_price" json:"cashBackPrice"`// 10 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. Count int `xorm:"count" json:"count"`// 255 0 注释:优惠券数量
  88. ReceiveType string `xorm:"receive_type" json:"receiveType"`// 255 0 注释:领取条件
  89. Validity string `xorm:"validity" json:"validity"`// 255 0 注释:有效性,领取开始计时(ClaimTiming),固定时间(FixedTime)
  90. ValidityPeriod time.Time `xorm:"validity_period" json:"validityPeriod"`// 0 0 注释:有效期
  91. }
  92. func (receiver GoodsCoupon) String() string {
  93. 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, ",Count:", receiver.Count, ",ReceiveType:", receiver.ReceiveType, ",Validity:", receiver.Validity, ",ValidityPeriod:", receiver.ValidityPeriod, "}")
  94. }
  95. //GoodsCouponUser 优惠券领取
  96. type GoodsCouponUser struct {
  97. Id int `json:"id"`// 11 0 注释:id
  98. UserId int `xorm:"user_id" json:"userId"`// 11 0 注释:用户id
  99. CouponId int `xorm:"coupon_id" json:"couponId"`// 11 0 注释:优惠券id
  100. CollectionTime time.Time `xorm:"collection_time" json:"collectionTime"`// 0 0 注释:领取时间
  101. State string `xorm:"state" json:"state"`// 255 0 注释:状态,已使用2,未使用1,已过期0
  102. }
  103. func (receiver GoodsCouponUser) String() string {
  104. return fmt.Sprint("GoodsCouponUser{Id:", receiver.Id, ",UserId:", receiver.UserId, ",CouponId:", receiver.CouponId, ",CollectionTime:", receiver.CollectionTime, ",State:", receiver.State, "}")
  105. }
  106. //GoodsIntroduction 商品介绍
  107. type GoodsIntroduction struct {
  108. Id int `json:"id"`// 11 0 注释:文章id
  109. GoodsArticleName string `xorm:"goods_article_name" json:"goodsArticleName"`// 255 0 注释:商品文章名
  110. GoodsArticle string `xorm:"goods_article" json:"goodsArticle"`// 0 0 注释:商品文章
  111. CreateBy string `xorm:"create_by" json:"createBy"`// 0 0 注释:创建人
  112. CreateTime time.Time `xorm:"create_time" json:"createTime"`// 0 0 注释:创建时间
  113. UpdateBy string `xorm:"update_by" json:"updateBy"`// 255 0 注释:更新人
  114. UpdateTime time.Time `xorm:"update_time" json:"updateTime"`// 0 0 注释:更新时间
  115. }
  116. func (receiver GoodsIntroduction) String() string {
  117. 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, "}")
  118. }
  119. //GoodsOrder
  120. type GoodsOrder struct {
  121. Id int `json:"id"`// 11 0 注释:id
  122. OrderName string `xorm:"order_name" json:"orderName"`// 255 0 注释:订单名
  123. SkuId int `xorm:"sku_id" json:"skuId"`// 11 0 注释:skuid
  124. Count int `xorm:"count" json:"count"`// 11 0 注释:购买数量
  125. Price float64 `xorm:"price" json:"price"`// 10 2 注释:单价
  126. TotalPrice float64 `xorm:"total_price" json:"totalPrice"`// 10 2 注释:总价
  127. ContactInformation string `xorm:"contact_information" json:"contactInformation"`// 255 0 注释:联系方式
  128. CouponUserId int `xorm:"coupon_user_id" json:"couponUserId"`// 11 0 注释:使用的优惠券
  129. State string `xorm:"state" json:"state"`// 10 0 注释:支付状态,0未支付,1已支付,2关闭订单,3订单异常
  130. CreateBy int `xorm:"create_by" json:"createBy"`// 255 0 注释:用户id
  131. CreateTime time.Time `xorm:"create_time" json:"createTime"`// 0 0 注释:订单创建时间
  132. }
  133. func (receiver GoodsOrder) String() string {
  134. 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, "}")
  135. }
  136. //GoodsSku
  137. type GoodsSku struct {
  138. Id int `json:"id"`// 11 0 注释:
  139. SkuImage string `xorm:"sku_image" json:"skuImage"`// 255 0 注释:sku图片
  140. SkuName string `xorm:"sku_name" json:"skuName"`// 255 0 注释:商品sku名字
  141. Price float64 `xorm:"price" json:"price"`// 10 2 注释:现在价格
  142. HistoricalPrices float64 `xorm:"historical_prices" json:"historicalPrices"`// 10 2 注释:历史价格
  143. InventoryNumber int `xorm:"inventory_number" json:"inventoryNumber"`// 11 0 注释:库存
  144. CommodityAreaId int `xorm:"commodity_area_id" json:"commodityAreaId"`// 11 0 注释:属地id
  145. GoodsId int `xorm:"goods_id" json:"goodsId"`// 11 0 注释:商品id
  146. CreateBy string `xorm:"create_by" json:"createBy"`// 255 0 注释:创建人
  147. CreateTime time.Time `xorm:"create_time" json:"createTime"`// 0 0 注释:创建时间
  148. }
  149. func (receiver GoodsSku) String() string {
  150. 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, "}")
  151. }
  152. //GoodsSkuCard
  153. type GoodsSkuCard struct {
  154. Id int `json:"id"`// 11 0 注释:id
  155. CardName string `xorm:"card_name" json:"cardName"`// 255 0 注释:卡种名称
  156. State string `xorm:"state" json:"state"`// 255 0 注释:状态,0未使用,1已用,2过期
  157. Count int `xorm:"count" json:"count"`// 11 0 注释:库存
  158. TotalCount string `xorm:"total_count" json:"totalCount"`// 255 0 注释:总数
  159. CardKey string `xorm:"card_key" json:"cardKey"`// 255 0 注释:卡密
  160. Use string `xorm:"use" json:"use"`// 5 0 注释:是否已用
  161. UploadTime time.Time `xorm:"upload_time" json:"uploadTime"`// 0 0 注释:入库时间
  162. SkuId int `xorm:"sku_id" json:"skuId"`// 11 0 注释:商品规格绑定
  163. Sort string `xorm:"sort" json:"sort"`// 255 0 注释:排序,出售优先级
  164. }
  165. func (receiver GoodsSkuCard) String() string {
  166. 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, "}")
  167. }
  168. //GoodsTag
  169. type GoodsTag struct {
  170. Id int `json:"id"`// 11 0 注释:id
  171. Name string `xorm:"name" json:"name"`// 255 0 注释:名字
  172. IconUrl string `xorm:"icon_url" json:"iconUrl"`// 255 0 注释:图标路径
  173. Tag string `xorm:"tag" json:"tag"`// 255 0 注释:标签
  174. }
  175. func (receiver GoodsTag) String() string {
  176. return fmt.Sprint("GoodsTag{Id:", receiver.Id, ",Name:", receiver.Name, ",IconUrl:", receiver.IconUrl, ",Tag:", receiver.Tag, "}")
  177. }
  178. //GoodsTopic
  179. type GoodsTopic struct {
  180. Id int `json:"id"`// 11 0 注释:
  181. TopicPageImage string `xorm:"topic_page_image" json:"topicPageImage"`// 255 0 注释:主题首页图片
  182. TopicName string `xorm:"topic_name" json:"topicName"`// 255 0 注释:主题名称
  183. TopicDesc string `xorm:"topic_desc" json:"topicDesc"`// 255 0 注释:主题描述
  184. TypeIds string `xorm:"type_ids" json:"typeIds"`// 255 0 注释:商品类型id
  185. }
  186. func (receiver GoodsTopic) String() string {
  187. return fmt.Sprint("GoodsTopic{Id:", receiver.Id, ",TopicPageImage:", receiver.TopicPageImage, ",TopicName:", receiver.TopicName, ",TopicDesc:", receiver.TopicDesc, ",TypeIds:", receiver.TypeIds, "}")
  188. }
  189. //GoodsType 商品分类
  190. type GoodsType struct {
  191. Id int `json:"id"`// 11 0 注释:
  192. Sort int `xorm:"sort" json:"sort"`// 11 0 注释:排序
  193. TypeImage string `xorm:"type_image" json:"typeImage"`// 50 0 注释:类型图片
  194. TypeName string `xorm:"type_name" json:"typeName"`// 255 0 注释:商品类别名称
  195. CreateTime time.Time `xorm:"create_time" json:"createTime"`// 0 0 注释:创建时间
  196. }
  197. func (receiver GoodsType) String() string {
  198. return fmt.Sprint("GoodsType{Id:", receiver.Id, ",Sort:", receiver.Sort, ",TypeImage:", receiver.TypeImage, ",TypeName:", receiver.TypeName, ",CreateTime:", receiver.CreateTime, "}")
  199. }
  200. //ManageUser
  201. type ManageUser struct {
  202. Id int `json:"id"`// 11 0 注释:
  203. Name string `xorm:"name" json:"name"`// 255 0 注释:名称
  204. Username string `xorm:"username" json:"username"`// 255 0 注释:账号
  205. Password string `xorm:"password" json:"password"`// 255 0 注释:密码
  206. CreationTime int `xorm:"creation_time" json:"creationTime"`// 11 0 注释:账号创建时间
  207. LoginTime int `xorm:"login_time" json:"loginTime"`// 11 0 注释:登录时间
  208. Status string `xorm:"status" json:"status"`// 255 0 注释:账号状态
  209. RoleId int `xorm:"role_id" json:"roleId"`// 11 0 注释:角色id
  210. Phone string `xorm:"phone" json:"phone"`// 255 0 注释:手机
  211. Email string `xorm:"email" json:"email"`// 255 0 注释:邮箱
  212. Avatar string `xorm:"avatar" json:"avatar"`// 255 0 注释:头像
  213. }
  214. func (receiver ManageUser) String() string {
  215. 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, "}")
  216. }
  217. //Role
  218. type Role struct {
  219. Id int `json:"id"`// 11 0 注释:
  220. RoleName string `xorm:"role_name" json:"roleName"`// 255 0 注释:
  221. }
  222. func (receiver Role) String() string {
  223. return fmt.Sprint("Role{Id:", receiver.Id, ",RoleName:", receiver.RoleName, "}")
  224. }
  225. //RoleAuthority
  226. type RoleAuthority struct {
  227. AuthorityId int `xorm:"authority_id" json:"authorityId"`// 11 0 注释:
  228. RoleId int `xorm:"role_id" json:"roleId"`// 11 0 注释:
  229. }
  230. func (receiver RoleAuthority) String() string {
  231. return fmt.Sprint("RoleAuthority{AuthorityId:", receiver.AuthorityId, ",RoleId:", receiver.RoleId, "}")
  232. }
  233. //User
  234. type User struct {
  235. Id int `json:"id"`// 11 0 注释:
  236. Username string `xorm:"username" json:"username"`// 255 0 注释:账号
  237. Password string `xorm:"password" json:"password"`// 255 0 注释:密码
  238. CreationTime int `xorm:"creation_time" json:"creationTime"`// 11 0 注释:账号创建时间
  239. LoginTime int `xorm:"login_time" json:"loginTime"`// 11 0 注释:登录时间
  240. Status string `xorm:"status" json:"status"`// 255 0 注释:账号状态
  241. RoleId int `xorm:"role_id" json:"roleId"`// 11 0 注释:角色id
  242. Phone string `xorm:"phone" json:"phone"`// 255 0 注释:手机
  243. Email string `xorm:"email" json:"email"`// 255 0 注释:邮箱
  244. Name string `xorm:"name" json:"name"`// 255 0 注释:用户名
  245. Avatar string `xorm:"avatar" json:"avatar"`// 255 0 注释:头像
  246. RecommendCode string `xorm:"recommend_code" json:"recommendCode"`// 255 0 注释:推荐码
  247. }
  248. func (receiver User) String() string {
  249. 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, "}")
  250. }
  251. //UserWallet
  252. type UserWallet struct {
  253. Id int `json:"id"`// 11 0 注释:id
  254. UserId int `xorm:"user_id" json:"userId"`// 11 0 注释:用户id
  255. Balance float64 `xorm:"balance" json:"balance"`// 65 0 注释:余额
  256. PromotionAmount float64 `xorm:"promotion_amount" json:"promotionAmount"`// 20 2 注释:推广获取总金额
  257. RechargeAmount float64 `xorm:"recharge_amount" json:"rechargeAmount"`// 20 2 注释:充值金额
  258. }
  259. func (receiver UserWallet) String() string {
  260. return fmt.Sprint("UserWallet{Id:", receiver.Id, ",UserId:", receiver.UserId, ",Balance:", receiver.Balance, ",PromotionAmount:", receiver.PromotionAmount, ",RechargeAmount:", receiver.RechargeAmount, "}")
  261. }