fuwencai 6 months ago
commit
91bfe217ab
100 changed files with 3163 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 19 0
      .gitignore
  3. 7 0
      Makefile
  4. 6 0
      README.MD
  5. 18 0
      api/activity/activity.go
  6. 72 0
      api/activity/v1/activity.go
  7. 15 0
      api/hello/hello.go
  8. 12 0
      api/hello/v1/hello.go
  9. 17 0
      api/lottery_prize_info/lottery_prize_info.go
  10. 64 0
      api/lottery_prize_info/v1/lottery_prize_info.go
  11. 35 0
      go.mod
  12. 64 0
      go.sum
  13. 17 0
      hack/config.yaml
  14. 20 0
      hack/hack-cli.mk
  15. 75 0
      hack/hack.mk
  16. 33 0
      internal/cmd/cmd.go
  17. 19 0
      internal/consts/consts.go
  18. 5 0
      internal/controller/activity/activity.go
  19. 15 0
      internal/controller/activity/activity_new.go
  20. 37 0
      internal/controller/activity/activity_v1_create.go
  21. 18 0
      internal/controller/activity/activity_v1_get_activity_config.go
  22. 32 0
      internal/controller/activity/activity_v1_get_list.go
  23. 27 0
      internal/controller/activity/activity_v1_update.go
  24. 5 0
      internal/controller/hello/hello.go
  25. 16 0
      internal/controller/hello/hello_new.go
  26. 13 0
      internal/controller/hello/hello_v1_hello.go
  27. 5 0
      internal/controller/lottery_prize_info/lottery_prize_info.go
  28. 15 0
      internal/controller/lottery_prize_info/lottery_prize_info_new.go
  29. 14 0
      internal/controller/lottery_prize_info/lottery_prize_info_v1_create.go
  30. 14 0
      internal/controller/lottery_prize_info/lottery_prize_info_v1_get_list.go
  31. 14 0
      internal/controller/lottery_prize_info/lottery_prize_info_v1_update.go
  32. 0 0
      internal/dao/.gitkeep
  33. 27 0
      internal/dao/activity_info.go
  34. 27 0
      internal/dao/admin_request.go
  35. 27 0
      internal/dao/admin_request_relate.go
  36. 27 0
      internal/dao/admin_token.go
  37. 27 0
      internal/dao/admin_user.go
  38. 27 0
      internal/dao/admin_user_group_relate.go
  39. 27 0
      internal/dao/admin_user_relate.go
  40. 27 0
      internal/dao/equity_info.go
  41. 105 0
      internal/dao/internal/activity_info.go
  42. 85 0
      internal/dao/internal/admin_request.go
  43. 81 0
      internal/dao/internal/admin_request_relate.go
  44. 83 0
      internal/dao/internal/admin_token.go
  45. 93 0
      internal/dao/internal/admin_user.go
  46. 81 0
      internal/dao/internal/admin_user_group_relate.go
  47. 81 0
      internal/dao/internal/admin_user_relate.go
  48. 95 0
      internal/dao/internal/equity_info.go
  49. 103 0
      internal/dao/internal/lottery_prize_info.go
  50. 89 0
      internal/dao/internal/lottery_prize_order.go
  51. 99 0
      internal/dao/internal/lottery_user_account.go
  52. 87 0
      internal/dao/internal/prize_base_info.go
  53. 83 0
      internal/dao/internal/product_info.go
  54. 85 0
      internal/dao/internal/product_rule.go
  55. 27 0
      internal/dao/lottery_prize_info.go
  56. 27 0
      internal/dao/lottery_prize_order.go
  57. 27 0
      internal/dao/lottery_user_account.go
  58. 27 0
      internal/dao/prize_base_info.go
  59. 27 0
      internal/dao/product_info.go
  60. 27 0
      internal/dao/product_rule.go
  61. 0 0
      internal/logic/.gitkeep
  62. 1 0
      internal/logic/activity/activity.go
  63. 58 0
      internal/middleware/middleware_auth.go
  64. 0 0
      internal/model/.gitkeep
  65. 0 0
      internal/model/do/.gitkeep
  66. 32 0
      internal/model/do/activity_info.go
  67. 22 0
      internal/model/do/admin_request.go
  68. 20 0
      internal/model/do/admin_request_relate.go
  69. 21 0
      internal/model/do/admin_token.go
  70. 26 0
      internal/model/do/admin_user.go
  71. 20 0
      internal/model/do/admin_user_group_relate.go
  72. 20 0
      internal/model/do/admin_user_relate.go
  73. 27 0
      internal/model/do/equity_info.go
  74. 31 0
      internal/model/do/lottery_prize_info.go
  75. 24 0
      internal/model/do/lottery_prize_order.go
  76. 29 0
      internal/model/do/lottery_user_account.go
  77. 22 0
      internal/model/do/prize_base_info.go
  78. 20 0
      internal/model/do/product_info.go
  79. 22 0
      internal/model/do/product_rule.go
  80. 0 0
      internal/model/entity/.gitkeep
  81. 30 0
      internal/model/entity/activity_info.go
  82. 20 0
      internal/model/entity/admin_request.go
  83. 18 0
      internal/model/entity/admin_request_relate.go
  84. 19 0
      internal/model/entity/admin_token.go
  85. 24 0
      internal/model/entity/admin_user.go
  86. 18 0
      internal/model/entity/admin_user_group_relate.go
  87. 18 0
      internal/model/entity/admin_user_relate.go
  88. 25 0
      internal/model/entity/equity_info.go
  89. 29 0
      internal/model/entity/lottery_prize_info.go
  90. 22 0
      internal/model/entity/lottery_prize_order.go
  91. 27 0
      internal/model/entity/lottery_user_account.go
  92. 17 0
      internal/model/entity/prize_base_info.go
  93. 15 0
      internal/model/entity/product_info.go
  94. 20 0
      internal/model/entity/product_rule.go
  95. 1 0
      internal/packed/packed.go
  96. 0 0
      internal/service/.gitkeep
  97. 14 0
      main.go
  98. 70 0
      manifest/config/option.yaml
  99. 21 0
      manifest/deploy/kustomize/base/deployment.yaml
  100. 8 0
      manifest/deploy/kustomize/base/kustomization.yaml

+ 1 - 0
.gitattributes

@@ -0,0 +1 @@
+* linguist-language=GO

+ 19 - 0
.gitignore

@@ -0,0 +1,19 @@
+.buildpath
+.hgignore.swp
+.project
+.orig
+.swp
+.idea/
+.settings/
+.vscode/
+bin/
+**/.DS_Store
+gf
+main
+main.exe
+output/
+manifest/output/
+temp/
+temp.yaml
+bin
+**/config/config.yaml

+ 7 - 0
Makefile

@@ -0,0 +1,7 @@
+ROOT_DIR    = $(shell pwd)
+NAMESPACE   = "default"
+DEPLOY_NAME = "template-single"
+DOCKER_NAME = "template-single"
+
+include ./hack/hack-cli.mk
+include ./hack/hack.mk

+ 6 - 0
README.MD

@@ -0,0 +1,6 @@
+# GoFrame Template For SingleRepo
+
+Quick Start: 
+- https://goframe.org/quick
+
+# 抽奖活动相关接口 

+ 18 - 0
api/activity/activity.go

@@ -0,0 +1,18 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package activity
+
+import (
+	"context"
+
+	"demo/api/activity/v1"
+)
+
+type IActivityV1 interface {
+	Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error)
+	Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error)
+	GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error)
+	GetActivityConfig(ctx context.Context, req *v1.GetActivityConfigReq) (res *v1.GetActivityConfigRes, err error)
+}

+ 72 - 0
api/activity/v1/activity.go

@@ -0,0 +1,72 @@
+package v1
+
+import (
+	"demo/internal/model/entity"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+type CreateReq struct {
+	g.Meta           `path:"/activity" method:"post" tags:"Activity" summary:"Create activity"`
+	Id               string      `v:"required" dc:"活动id"`
+	Name             string      `v:"required" dc:"活动名称"`
+	StartTime        *gtime.Time `v:"required|datetime" dc:"活动开始时间:2024-04-13 00:00:00"`
+	EndTime          *gtime.Time `v:"required|datetime" dc:"活动结束时间:2024-05-27 23:59:59"`
+	LotteryStartTime string      `v:"required-if:mold,2,mold,1|date-format:H:i:s" dc:"抽奖开始时间:0:00:00"`
+	LotteryEndTime   string      `v:"required-if:mold,2,mold,1|date-format:H:i:s" dc:"抽奖结束时间:23:59:59"`
+	Cost             int         `v:"required-if:mold,2,mold,1" dc:"'抽奖花费:1、默X个剑鱼币兑换1次抽奖机会;传X 2、订单抽奖: 抽奖次数动态根据下单次数判断  传-1'"`
+	DailyNum         int         `v:"required|min:0" dc:" 每人每个身份每天抽奖次数限制"`
+	DeviceNum        int         `v:"required|min:0" dc:" 每个设备每天抽奖次数限制"`
+	IpNum            int         `v:"required|min:0" dc:" 每个IP每天抽奖次数限制"`
+	Pic              string      `v:"required-if:mold,2,mold,1" dc:" 活动图片"`
+	Rule             string      `v:"required" dc:" 活动规则:[  {    \"text\": \"活动时间:2024.5.13-2024.5.31,00:00至24:00。\"  }]"`
+	ShareCopy        string      `v:"required|json" dc:" 分享文案:{  \"PC\": {    \"title\": \"\",    \"subtitle\": \"\",    \"pic\": \"\",    \"href\": \"\"  },  \"APP\": {    \"title\": \"\",    \"subtitle\": \"\",    \"pic\": \"\",    \"href\": \"\"  },  \"H5\": {    \"title\": \"\",    \"subtitle\": \"!\",    \"pic\": \"\",   \"href\": \"\"  },  \"WX\": {    \"title\": \"\",    \"subtitle\": \"\",    \"pic\": \"\",    \"href\": \"\"  }}"`
+	State            int         `v:"required|in:0,1" dc:" 活动状态默认0:有效;1:已取消"`
+	Mold             int         `v:"required|in:0,1,2" dc:" 活动类型 0:购买奖励;1:剑鱼币抽奖;2:订单抽奖"`
+	OrderType        string      `v:"required-if:mold,2|in:m_1,v_1,v_2,v_3" dc:"订单类型: 该字段仅当mold值为2时生效;m_1-大会员购买;  v_1-购买超级订阅;v_2-续费超级订阅;v_3-升级超级订阅  支持多个时使用英文逗号分割"`
+}
+type CreateRes struct {
+}
+type Status int
+
+const (
+	StatusOK       Status = 0 // User is OK.
+	StatusDisabled Status = 1 // User is disabled.
+)
+
+type UpdateReq struct {
+	g.Meta           `path:"/activity/{id}" method:"put" tags:"Activity" summary:"Update activity"`
+	Id               int64       `v:"required" dc:"活动 id"`
+	StartTime        *gtime.Time `v:"datetime" dc:"活动开始时间"`
+	EndTime          *gtime.Time `v:"datetime" dc:"活动结束时间"`
+	LotteryStartTime string      `v:"date-format:H:i:s" dc:"抽奖开始时间:00:00:00"`
+	LotteryEndTime   string      `v:"date-format:H:i:s" dc:"抽奖结束时间:09:00:00"`
+	Cost             int         `dc:"'抽奖花费:1、默X个剑鱼币兑换1次抽奖机会;传X 2、订单抽奖: 抽奖次数动态根据下单次数判断  传-1"`
+	DailyNum         int         `v:"min:0" dc:" 每人每个身份每天抽奖次数限制"`
+	DeviceNum        int         `v:"min:0" dc:" 每个设备每天抽奖次数限制"`
+	IpNum            int         `v:"min:0" dc:" 每个IP每天抽奖次数限制"`
+	Pic              string      `dc:"活动图片"`
+	Rule             string      `dc:"活动规则:[  {    \"text\": \"活动时间:2024.5.13-2024.5.31,00:00至24:00。\"  }]"`
+	ShareCopy        string      `v:"json" dc:"分享文案:{  \"PC\": {    \"title\": \"\",    \"subtitle\": \"\",    \"pic\": \"\",    \"href\": \"\"  },  \"APP\": {    \"title\": \"\",    \"subtitle\": \"\",    \"pic\": \"\",    \"href\": \"\"  },  \"H5\": {    \"title\": \"\",    \"subtitle\": \"!\",    \"pic\": \"\",   \"href\": \"\"  },  \"WX\": {    \"title\": \"\",    \"subtitle\": \"\",    \"pic\": \"\",    \"href\": \"\"  }}"`
+	State            int         `v:"in:0,1" dc:" 活动状态默认0:有效;1:已取消"`
+}
+type UpdateRes struct{}
+type GetListReq struct {
+	g.Meta    `path:"/activity" method:"get" tags:"Activity" summary:"Get Activitys"`
+	StartTime *gtime.Time `v:"datetime" dc:"活动开始时间"`
+	EndTime   *gtime.Time `v:"datetime" dc:"活动结束时间"`
+	State     int         `v:"in:0,1" dc:" 活动状态默认0:有效;1:已取消"`
+	Mold      int         `v:"in:0,1,2" dc:" 活动类型 0:购买奖励;1:剑鱼币抽奖;2:订单抽奖"`
+	Name      string      `dc:"活动名称"`
+	Id        int
+	Offset    int `d:"0" dc:"分页开始条数"`
+	Limit     int `d:"10" dc:"每页条数"`
+}
+type GetListRes struct {
+	List  []*entity.ActivityInfo `json:"list" dc:"Activity list"`
+	Total int                    `json:"total" dc:"Activity list total"`
+}
+type GetActivityConfigReq struct {
+	g.Meta `path:"/activity-config" method:"get" tags:"ActivityConfig" summary:"Get Activitys config"`
+}
+type GetActivityConfigRes map[string]interface{}

+ 15 - 0
api/hello/hello.go

@@ -0,0 +1,15 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package hello
+
+import (
+	"context"
+
+	"demo/api/hello/v1"
+)
+
+type IHelloV1 interface {
+	Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error)
+}

+ 12 - 0
api/hello/v1/hello.go

@@ -0,0 +1,12 @@
+package v1
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+type HelloReq struct {
+	g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"`
+}
+type HelloRes struct {
+	g.Meta `mime:"text/html" example:"string"`
+}

+ 17 - 0
api/lottery_prize_info/lottery_prize_info.go

@@ -0,0 +1,17 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package lottery_prize_info
+
+import (
+	"context"
+
+	"demo/api/lottery_prize_info/v1"
+)
+
+type ILotteryPrizeInfoV1 interface {
+	Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error)
+	Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error)
+	GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error)
+}

+ 64 - 0
api/lottery_prize_info/v1/lottery_prize_info.go

@@ -0,0 +1,64 @@
+package v1
+
+import (
+	"demo/internal/model/entity"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+type CreateReq struct {
+	g.Meta         `path:"/lottery_prize_info" method:"post" tags:"lottery_prize_info" summary:"Create lottery_prize_info"`
+	Id             int    `v:"required" dc:" lottery_prize_info id"`
+	ActiveId       int    `v:"required" dc:" ActiveId"` // 关联活动id
+	State          int    // 默认0:可用;1:已取消或失效
+	Mold           int    // 奖品类型:0:会员福利;1:参与奖
+	PbId           int    // 奖品属性:默认0:剑鱼;1:WPS会员月卡;2:腾讯视频会员周卡;3:网易云音乐黑胶VIP月卡;4:喜马拉雅会员2个月 5:腾讯视频会员年卡 6:网易云音乐黑胶vip周卡 7:WPS会员年卡
+	JyPrize        string // 剑鱼奖品内容
+	Frequency      string // 中奖频次:每人X天“会员福利”仅可中奖:X次(每人7天“会员福利”仅可中奖1次)
+	Probability    int    // 中奖概率
+	Inventory      int    // 库存
+	Total          int    // 奖品总量
+	AlarmSwitch    int    // 告警开关0:打开;1:关闭
+	AlarmThreshold int    // 奖品告警阈值
+	Target         string // 中奖目标用户。默认空:全部用户,f:免费用户;v:超级订阅用户;m:大会员用户;e:商机管理用户
+	DailyNum       int    // 每日中此奖限制数量
+}
+type CreateRes struct {
+	Id int64 `json:"id" dc:"user id"`
+}
+type Status int
+
+const (
+	StatusOK       Status = 0 // User is OK.
+	StatusDisabled Status = 1 // User is disabled.
+)
+
+type UpdateReq struct {
+	g.Meta           `path:"/lottery_prize_info/{id}" method:"put" tags:"lottery_prize_info" summary:"Update lottery_prize_info"`
+	Id               int64       ` v:"required" dc:"lottery_prize_info id"`
+	StartTime        *gtime.Time ` dc:" startTime"`
+	EndTime          *gtime.Time ` dc:" endTime"`
+	LotteryStartTime string      ` dc:" lotteryStartTime"`
+	LotteryEndTime   string      ` dc:" lotteryEndTime"`
+	Cost             int         ` dc:" cost"`
+	DailyNum         int         ` dc:" dailyNum"`
+	DeviceNum        int         ` dc:" deviceNum"`
+	IpNum            int         ` dc:" ipNum"`
+	Pic              string      ` dc:" pic"`
+	Rule             string      ` dc:" rule"`
+	ShareCopy        string      ` dc:" shareCopy"`
+	State            int         ` dc:" state"`
+}
+type UpdateRes struct{}
+type GetListReq struct {
+	g.Meta    `path:"/lottery_prize_info" method:"get" tags:"lottery_prize_info" summary:"Get lottery_prize_info"`
+	StartTime *gtime.Time ` dc:" startTime"`
+	EndTime   *gtime.Time ` dc:" endTime"`
+	State     int         ` dc:" state"`
+	Mold      int         ` dc:" mold"`
+	Name      string
+	Id        int
+}
+type GetListRes struct {
+	List []*entity.LotteryPrizeInfo `json:"list" dc:"lottery_prize_info list"`
+}

+ 35 - 0
go.mod

@@ -0,0 +1,35 @@
+module demo
+
+go 1.18
+
+require (
+	github.com/gogf/gf/contrib/drivers/mysql/v2 v2.8.3
+	github.com/gogf/gf/v2 v2.8.3
+)
+
+require (
+	github.com/BurntSushi/toml v1.4.0 // indirect
+	github.com/clbanning/mxj/v2 v2.7.0 // indirect
+	github.com/emirpasic/gods v1.18.1 // indirect
+	github.com/fatih/color v1.18.0 // indirect
+	github.com/fsnotify/fsnotify v1.7.0 // indirect
+	github.com/go-logr/logr v1.4.2 // indirect
+	github.com/go-logr/stdr v1.2.2 // indirect
+	github.com/go-sql-driver/mysql v1.7.1 // indirect
+	github.com/gorilla/websocket v1.5.3 // indirect
+	github.com/grokify/html-strip-tags-go v0.1.0 // indirect
+	github.com/magiconair/properties v1.8.9 // indirect
+	github.com/mattn/go-colorable v0.1.13 // indirect
+	github.com/mattn/go-isatty v0.0.20 // indirect
+	github.com/mattn/go-runewidth v0.0.16 // indirect
+	github.com/olekukonko/tablewriter v0.0.5 // indirect
+	github.com/rivo/uniseg v0.4.7 // indirect
+	go.opentelemetry.io/otel v1.24.0 // indirect
+	go.opentelemetry.io/otel/metric v1.24.0 // indirect
+	go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+	go.opentelemetry.io/otel/trace v1.24.0 // indirect
+	golang.org/x/net v0.32.0 // indirect
+	golang.org/x/sys v0.28.0 // indirect
+	golang.org/x/text v0.21.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+)

+ 64 - 0
go.sum

@@ -0,0 +1,64 @@
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
+github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
+github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
+github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
+github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
+github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
+github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
+github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
+github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
+github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
+github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
+github.com/gogf/gf/contrib/drivers/mysql/v2 v2.8.3 h1:RtoBg5HWACFrgIrFkpzH94kxSd5EWefNAq5k6olNY6c=
+github.com/gogf/gf/contrib/drivers/mysql/v2 v2.8.3/go.mod h1:elZjckHRCejwml5Kdx2zfhOUDiAV3r5i4BgXcKAeH00=
+github.com/gogf/gf/v2 v2.8.3 h1:h9Px3lqJnnH6It0AqHRz4/1hx0JmvaSf1IvUir5x1rA=
+github.com/gogf/gf/v2 v2.8.3/go.mod h1:n++xPYGUUMadw6IygLEgGZqc6y6DRLrJKg5kqCrPLWY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
+github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
+github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
+github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM=
+github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
+github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
+github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
+github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
+github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
+github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
+github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
+github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
+github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
+golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
+golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
+golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
+golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

+ 17 - 0
hack/config.yaml

@@ -0,0 +1,17 @@
+
+# CLI tool, only in development environment.
+# https://goframe.org/docs/cli
+gfcli:
+  gen:
+    dao:
+      - link: "mysql:root:=PDT49#80Z!RVv52_z@tcp(192.168.3.217:4000)/jyactivities"
+        descriptionTag: true
+        tables: "lottery_prize_info,lottery_prize_order,equity_info,activity_info,lottery_user_account,prize_base_info,product_info,product_rule"
+      - link: "mysql:root:=PDT49#80Z!RVv52_z@tcp(192.168.3.217:4000)/cadmin"
+        descriptionTag: true
+        tables: "admin_user_group_relate,admin_request,admin_user_relate,admin_request_relate,admin_user,admin_token"
+        group: cadmin
+  docker:
+    build: "-a amd64 -s linux -p temp -ew"
+    tagPrefixes:
+      - my.image.pub/my-app

+ 20 - 0
hack/hack-cli.mk

@@ -0,0 +1,20 @@
+
+# Install/Update to the latest CLI tool.
+.PHONY: cli
+cli:
+	@set -e; \
+	wget -O gf \
+	https://github.com/gogf/gf/releases/latest/download/gf_$(shell go env GOOS)_$(shell go env GOARCH) && \
+	chmod +x gf && \
+	./gf install -y && \
+	rm ./gf
+
+
+# Check and install CLI tool.
+.PHONY: cli.install
+cli.install:
+	@set -e; \
+	gf -v > /dev/null 2>&1 || if [[ "$?" -ne "0" ]]; then \
+  		echo "GoFame CLI is not installed, start proceeding auto installation..."; \
+		make cli; \
+	fi;

+ 75 - 0
hack/hack.mk

@@ -0,0 +1,75 @@
+.DEFAULT_GOAL := build
+
+# Update GoFrame and its CLI to latest stable version.
+.PHONY: up
+up: cli.install
+	@gf up -a
+
+# Build binary using configuration from hack/config.yaml.
+.PHONY: build
+build: cli.install
+	@gf build -ew
+
+# Parse api and generate controller/sdk.
+.PHONY: ctrl
+ctrl: cli.install
+	@gf gen ctrl
+
+# Generate Go files for DAO/DO/Entity.
+.PHONY: dao
+dao: cli.install
+	@gf gen dao
+
+# Parse current project go files and generate enums go file.
+.PHONY: enums
+enums: cli.install
+	@gf gen enums
+
+# Generate Go files for Service.
+.PHONY: service
+service: cli.install
+	@gf gen service
+
+
+# Build docker image.
+.PHONY: image
+image: cli.install
+	$(eval _TAG  = $(shell git rev-parse --short HEAD))
+ifneq (, $(shell git status --porcelain 2>/dev/null))
+	$(eval _TAG  = $(_TAG).dirty)
+endif
+	$(eval _TAG  = $(if ${TAG},  ${TAG}, $(_TAG)))
+	$(eval _PUSH = $(if ${PUSH}, ${PUSH}, ))
+	@gf docker ${_PUSH} -tn $(DOCKER_NAME):${_TAG};
+
+
+# Build docker image and automatically push to docker repo.
+.PHONY: image.push
+image.push: cli.install
+	@make image PUSH=-p;
+
+
+# Deploy image and yaml to current kubectl environment.
+.PHONY: deploy
+deploy: cli.install
+	$(eval _TAG = $(if ${TAG},  ${TAG}, develop))
+
+	@set -e; \
+	mkdir -p $(ROOT_DIR)/temp/kustomize;\
+	cd $(ROOT_DIR)/manifest/deploy/kustomize/overlays/${_ENV};\
+	kustomize build > $(ROOT_DIR)/temp/kustomize.yaml;\
+	kubectl   apply -f $(ROOT_DIR)/temp/kustomize.yaml; \
+	if [ $(DEPLOY_NAME) != "" ]; then \
+		kubectl patch -n $(NAMESPACE) deployment/$(DEPLOY_NAME) -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"$(shell date +%s)\"}}}}}"; \
+	fi;
+
+
+# Parsing protobuf files and generating go files.
+.PHONY: pb
+pb: cli.install
+	@gf gen pb
+
+# Generate protobuf files for database tables.
+.PHONY: pbentity
+pbentity: cli.install
+	@gf gen pbentity

+ 33 - 0
internal/cmd/cmd.go

@@ -0,0 +1,33 @@
+package cmd
+
+import (
+	"context"
+	"demo/internal/controller/activity"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/gogf/gf/v2/os/gcmd"
+
+	"demo/internal/controller/hello"
+)
+
+var (
+	Main = gcmd.Command{
+		Name:  "main",
+		Usage: "main",
+		Brief: "start http server",
+		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
+			s := g.Server()
+			s.Group("/admin", func(group *ghttp.RouterGroup) {
+				//group.Middleware(middleware.HandlerAuth) // todo 到时候看还用不用管理后台现在的这一套权限判断
+				group.Middleware(ghttp.MiddlewareHandlerResponse)
+				group.Bind(
+					hello.NewV1(),
+					activity.NewV1(),
+				)
+			})
+			//s.SetSwaggerUITemplate(MySwaggerUITemplate)
+			s.Run()
+			return nil
+		},
+	}
+)

+ 19 - 0
internal/consts/consts.go

@@ -0,0 +1,19 @@
+package consts
+
+const (
+	ActivityCostDefault  = 100   //抽奖花费:1、默X个剑鱼币兑换1次抽奖机会
+	ActivityCostOrder    = -1    //抽奖花费:2、订单抽奖: 抽奖次数动态根据下单次数判断',
+	ActivityStateValid   = 0     //'活动状态默认0:有效;
+	ActivityStateInvalid = 1     //1:已取消',
+	ActivityMoldBuy      = 0     //活动类型 0:购买奖励;
+	ActivityMoldCost     = 1     //活动类型1:订单抽奖',
+	ActivityMoldOrder    = 2     //活动类型2:订单抽奖',
+	Activityorder_typeBM = "m_1" // 订单类型: m_1-大会员购买;
+	Activityorder_typeBS = "v_1" // 订单类型: v_1-购买超级订阅
+	Activityorder_typeRS = "v_2" // 订单类型: v_2-续费超级订阅
+	Activityorder_typeUS = "v_3" // 订单类型: v_3-升级超级订阅
+	EquityStateValid     = 0     // 兑换码状态:有效
+	EquityStateInvalid   = -1    // 兑换码状态:失效
+	EquityStateUsed      = 1     // 兑换码状态:已使用
+
+)

+ 5 - 0
internal/controller/activity/activity.go

@@ -0,0 +1,5 @@
+// =================================================================================
+// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
+// =================================================================================
+
+package activity

+ 15 - 0
internal/controller/activity/activity_new.go

@@ -0,0 +1,15 @@
+// =================================================================================
+// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
+// =================================================================================
+
+package activity
+
+import (
+	"demo/api/activity"
+)
+
+type ControllerV1 struct{}
+
+func NewV1() activity.IActivityV1 {
+	return &ControllerV1{}
+}

+ 37 - 0
internal/controller/activity/activity_v1_create.go

@@ -0,0 +1,37 @@
+package activity
+
+import (
+	"context"
+	"demo/internal/dao"
+	"demo/internal/model/do"
+	"github.com/gogf/gf/v2/os/gtime"
+
+	"demo/api/activity/v1"
+)
+
+func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) {
+	_, err = dao.ActivityInfo.Ctx(ctx).Data(do.ActivityInfo{
+		Id:               req.Id,
+		Name:             req.Name,
+		StartTime:        req.StartTime,
+		EndTime:          req.EndTime,
+		LotteryStartTime: req.LotteryStartTime,
+		LotteryEndTime:   req.LotteryEndTime,
+		Cost:             req.Cost,
+		DailyNum:         req.DailyNum,
+		DeviceNum:        req.DeviceNum,
+		IpNum:            req.IpNum,
+		Pic:              req.Pic,
+		Rule:             req.Rule,
+		ShareCopy:        req.ShareCopy,
+		State:            req.State,
+		Mold:             req.Mold,
+		CreateTime:       gtime.Now(),
+		OrderType:        req.OrderType,
+	}).Insert()
+	if err != nil {
+		return nil, err
+	}
+	res = &v1.CreateRes{}
+	return
+}

+ 18 - 0
internal/controller/activity/activity_v1_get_activity_config.go

@@ -0,0 +1,18 @@
+package activity
+
+import (
+	"context"
+	"github.com/gogf/gf/v2/frame/g"
+
+	"demo/api/activity/v1"
+)
+
+func (c *ControllerV1) GetActivityConfig(ctx context.Context, req *v1.GetActivityConfigReq) (res *v1.GetActivityConfigRes, err error) {
+	res = &v1.GetActivityConfigRes{}
+	rs := g.Cfg("option.yaml").MustData(ctx)
+	for k, v := range rs {
+		(*res)[k] = v
+	}
+
+	return res, err
+}

+ 32 - 0
internal/controller/activity/activity_v1_get_list.go

@@ -0,0 +1,32 @@
+package activity
+
+import (
+	"context"
+	"demo/api/activity/v1"
+	"demo/internal/dao"
+	"demo/internal/model/do"
+)
+
+func (c *ControllerV1) GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) {
+	res = &v1.GetListRes{}
+
+	orm := dao.ActivityInfo.Ctx(ctx)
+	if req.Name != "" {
+		orm = orm.WhereLike(dao.ActivityInfo.Columns().Name, "%"+req.Name+"%")
+	}
+	err = orm.Where(do.ActivityInfo{
+		Id:        req.Id,
+		Name:      req.Name,
+		StartTime: req.StartTime,
+		EndTime:   req.EndTime,
+		State:     req.State,
+		Mold:      req.Mold,
+	}).OmitEmpty().Limit(req.Offset, req.Limit).ScanAndCount(&res.List, &res.Total, false)
+	if err != nil {
+		return nil, err
+	}
+	if err != nil {
+		return nil, err
+	}
+	return
+}

+ 27 - 0
internal/controller/activity/activity_v1_update.go

@@ -0,0 +1,27 @@
+package activity
+
+import (
+	"context"
+	"demo/internal/dao"
+	"demo/internal/model/do"
+
+	"demo/api/activity/v1"
+)
+
+func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) {
+	_, err = dao.ActivityInfo.Ctx(ctx).OmitEmpty().Data(do.ActivityInfo{
+		StartTime:        req.StartTime,
+		EndTime:          req.EndTime,
+		LotteryStartTime: req.LotteryStartTime,
+		LotteryEndTime:   req.LotteryEndTime,
+		Cost:             req.Cost,
+		DailyNum:         req.DailyNum,
+		DeviceNum:        req.DeviceNum,
+		IpNum:            req.IpNum,
+		Pic:              req.Pic,
+		Rule:             req.Rule,
+		ShareCopy:        req.ShareCopy,
+		State:            req.State,
+	}).WherePri(req.Id).Update()
+	return nil, err
+}

+ 5 - 0
internal/controller/hello/hello.go

@@ -0,0 +1,5 @@
+// =================================================================================
+// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
+// =================================================================================
+
+package hello

+ 16 - 0
internal/controller/hello/hello_new.go

@@ -0,0 +1,16 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. 
+// =================================================================================
+
+package hello
+
+import (
+	"demo/api/hello"
+)
+
+type ControllerV1 struct{}
+
+func NewV1() hello.IHelloV1 {
+	return &ControllerV1{}
+}
+

+ 13 - 0
internal/controller/hello/hello_v1_hello.go

@@ -0,0 +1,13 @@
+package hello
+
+import (
+	"context"
+	"github.com/gogf/gf/v2/frame/g"
+
+	"demo/api/hello/v1"
+)
+
+func (c *ControllerV1) Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error) {
+	g.RequestFromCtx(ctx).Response.Writeln("Hello World!")
+	return
+}

+ 5 - 0
internal/controller/lottery_prize_info/lottery_prize_info.go

@@ -0,0 +1,5 @@
+// =================================================================================
+// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
+// =================================================================================
+
+package lottery_prize_info

+ 15 - 0
internal/controller/lottery_prize_info/lottery_prize_info_new.go

@@ -0,0 +1,15 @@
+// =================================================================================
+// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
+// =================================================================================
+
+package lottery_prize_info
+
+import (
+	"demo/api/lottery_prize_info"
+)
+
+type ControllerV1 struct{}
+
+func NewV1() lottery_prize_info.ILotteryPrizeInfoV1 {
+	return &ControllerV1{}
+}

+ 14 - 0
internal/controller/lottery_prize_info/lottery_prize_info_v1_create.go

@@ -0,0 +1,14 @@
+package lottery_prize_info
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/errors/gcode"
+	"github.com/gogf/gf/v2/errors/gerror"
+
+	"demo/api/lottery_prize_info/v1"
+)
+
+func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) {
+	return nil, gerror.NewCode(gcode.CodeNotImplemented)
+}

+ 14 - 0
internal/controller/lottery_prize_info/lottery_prize_info_v1_get_list.go

@@ -0,0 +1,14 @@
+package lottery_prize_info
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/errors/gcode"
+	"github.com/gogf/gf/v2/errors/gerror"
+
+	"demo/api/lottery_prize_info/v1"
+)
+
+func (c *ControllerV1) GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) {
+	return nil, gerror.NewCode(gcode.CodeNotImplemented)
+}

+ 14 - 0
internal/controller/lottery_prize_info/lottery_prize_info_v1_update.go

@@ -0,0 +1,14 @@
+package lottery_prize_info
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/errors/gcode"
+	"github.com/gogf/gf/v2/errors/gerror"
+
+	"demo/api/lottery_prize_info/v1"
+)
+
+func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) {
+	return nil, gerror.NewCode(gcode.CodeNotImplemented)
+}

+ 0 - 0
internal/dao/.gitkeep


+ 27 - 0
internal/dao/activity_info.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalActivityInfoDao is an internal type for wrapping the internal DAO implementation.
+type internalActivityInfoDao = *internal.ActivityInfoDao
+
+// activityInfoDao is the data access object for the table activity_info.
+// You can define custom methods on it to extend its functionality as needed.
+type activityInfoDao struct {
+	internalActivityInfoDao
+}
+
+var (
+	// ActivityInfo is a globally accessible object for table activity_info operations.
+	ActivityInfo = activityInfoDao{
+		internal.NewActivityInfoDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/admin_request.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalAdminRequestDao is an internal type for wrapping the internal DAO implementation.
+type internalAdminRequestDao = *internal.AdminRequestDao
+
+// adminRequestDao is the data access object for the table admin_request.
+// You can define custom methods on it to extend its functionality as needed.
+type adminRequestDao struct {
+	internalAdminRequestDao
+}
+
+var (
+	// AdminRequest is a globally accessible object for table admin_request operations.
+	AdminRequest = adminRequestDao{
+		internal.NewAdminRequestDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/admin_request_relate.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalAdminRequestRelateDao is an internal type for wrapping the internal DAO implementation.
+type internalAdminRequestRelateDao = *internal.AdminRequestRelateDao
+
+// adminRequestRelateDao is the data access object for the table admin_request_relate.
+// You can define custom methods on it to extend its functionality as needed.
+type adminRequestRelateDao struct {
+	internalAdminRequestRelateDao
+}
+
+var (
+	// AdminRequestRelate is a globally accessible object for table admin_request_relate operations.
+	AdminRequestRelate = adminRequestRelateDao{
+		internal.NewAdminRequestRelateDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/admin_token.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalAdminTokenDao is an internal type for wrapping the internal DAO implementation.
+type internalAdminTokenDao = *internal.AdminTokenDao
+
+// adminTokenDao is the data access object for the table admin_token.
+// You can define custom methods on it to extend its functionality as needed.
+type adminTokenDao struct {
+	internalAdminTokenDao
+}
+
+var (
+	// AdminToken is a globally accessible object for table admin_token operations.
+	AdminToken = adminTokenDao{
+		internal.NewAdminTokenDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/admin_user.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalAdminUserDao is an internal type for wrapping the internal DAO implementation.
+type internalAdminUserDao = *internal.AdminUserDao
+
+// adminUserDao is the data access object for the table admin_user.
+// You can define custom methods on it to extend its functionality as needed.
+type adminUserDao struct {
+	internalAdminUserDao
+}
+
+var (
+	// AdminUser is a globally accessible object for table admin_user operations.
+	AdminUser = adminUserDao{
+		internal.NewAdminUserDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/admin_user_group_relate.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalAdminUserGroupRelateDao is an internal type for wrapping the internal DAO implementation.
+type internalAdminUserGroupRelateDao = *internal.AdminUserGroupRelateDao
+
+// adminUserGroupRelateDao is the data access object for the table admin_user_group_relate.
+// You can define custom methods on it to extend its functionality as needed.
+type adminUserGroupRelateDao struct {
+	internalAdminUserGroupRelateDao
+}
+
+var (
+	// AdminUserGroupRelate is a globally accessible object for table admin_user_group_relate operations.
+	AdminUserGroupRelate = adminUserGroupRelateDao{
+		internal.NewAdminUserGroupRelateDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/admin_user_relate.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalAdminUserRelateDao is an internal type for wrapping the internal DAO implementation.
+type internalAdminUserRelateDao = *internal.AdminUserRelateDao
+
+// adminUserRelateDao is the data access object for the table admin_user_relate.
+// You can define custom methods on it to extend its functionality as needed.
+type adminUserRelateDao struct {
+	internalAdminUserRelateDao
+}
+
+var (
+	// AdminUserRelate is a globally accessible object for table admin_user_relate operations.
+	AdminUserRelate = adminUserRelateDao{
+		internal.NewAdminUserRelateDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/equity_info.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalEquityInfoDao is an internal type for wrapping the internal DAO implementation.
+type internalEquityInfoDao = *internal.EquityInfoDao
+
+// equityInfoDao is the data access object for the table equity_info.
+// You can define custom methods on it to extend its functionality as needed.
+type equityInfoDao struct {
+	internalEquityInfoDao
+}
+
+var (
+	// EquityInfo is a globally accessible object for table equity_info operations.
+	EquityInfo = equityInfoDao{
+		internal.NewEquityInfoDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 105 - 0
internal/dao/internal/activity_info.go

@@ -0,0 +1,105 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// ActivityInfoDao is the data access object for the table activity_info.
+type ActivityInfoDao struct {
+	table   string              // table is the underlying table name of the DAO.
+	group   string              // group is the database configuration group name of the current DAO.
+	columns ActivityInfoColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// ActivityInfoColumns defines and stores column names for the table activity_info.
+type ActivityInfoColumns struct {
+	Id               string // 抽奖活动信息表id
+	Name             string // 活动名称
+	StartTime        string // 活动开始时间
+	EndTime          string // 活动结束时间
+	LotteryStartTime string // 抽奖开始时间
+	LotteryEndTime   string // 抽奖结束时间
+	Cost             string // 抽奖花费:1、默X个剑鱼币兑换1次抽奖机会;2、订单抽奖: 抽奖次数动态根据下单次数判断
+	DailyNum         string // 每人每个身份每天抽奖次数限制
+	DeviceNum        string // 每个设备每天抽奖次数限制
+	IpNum            string // 每个IP每天抽奖次数限制
+	Pic              string // 活动图片
+	Rule             string // 活动规则
+	ShareCopy        string // 分享文案:{"APP":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"},"PC":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"},"H5":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"},"WX":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"}}
+	State            string // 活动状态默认0:有效;1:已取消
+	Mold             string // 活动类型 0:购买奖励;1:剑鱼币抽奖;2:订单抽奖
+	CreateTime       string // 创建时间
+	OrderType        string // 该字段仅当mold值为2时生效;m_1-大会员购买;  v_1-购买超级订阅;v_2-续费超级订阅;v_3-升级超级订阅  支持多个时使用英文逗号分割
+}
+
+// activityInfoColumns holds the columns for the table activity_info.
+var activityInfoColumns = ActivityInfoColumns{
+	Id:               "id",
+	Name:             "name",
+	StartTime:        "start_time",
+	EndTime:          "end_time",
+	LotteryStartTime: "lottery_start_time",
+	LotteryEndTime:   "lottery_end_time",
+	Cost:             "cost",
+	DailyNum:         "daily_num",
+	DeviceNum:        "device_num",
+	IpNum:            "ip_num",
+	Pic:              "pic",
+	Rule:             "rule",
+	ShareCopy:        "share_copy",
+	State:            "state",
+	Mold:             "mold",
+	CreateTime:       "create_time",
+	OrderType:        "order_type",
+}
+
+// NewActivityInfoDao creates and returns a new DAO object for table data access.
+func NewActivityInfoDao() *ActivityInfoDao {
+	return &ActivityInfoDao{
+		group:   "default",
+		table:   "activity_info",
+		columns: activityInfoColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *ActivityInfoDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *ActivityInfoDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *ActivityInfoDao) Columns() ActivityInfoColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *ActivityInfoDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *ActivityInfoDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *ActivityInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 85 - 0
internal/dao/internal/admin_request.go

@@ -0,0 +1,85 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// AdminRequestDao is the data access object for the table admin_request.
+type AdminRequestDao struct {
+	table   string              // table is the underlying table name of the DAO.
+	group   string              // group is the database configuration group name of the current DAO.
+	columns AdminRequestColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// AdminRequestColumns defines and stores column names for the table admin_request.
+type AdminRequestColumns struct {
+	Id         string //
+	Type       string // 请求类型
+	Name       string // 名称
+	Action     string // action
+	Call       string // 类型配置
+	CreateTime string // 创建时间
+	UpdateTime string // 更新时间
+}
+
+// adminRequestColumns holds the columns for the table admin_request.
+var adminRequestColumns = AdminRequestColumns{
+	Id:         "id",
+	Type:       "type",
+	Name:       "name",
+	Action:     "action",
+	Call:       "call",
+	CreateTime: "create_time",
+	UpdateTime: "update_time",
+}
+
+// NewAdminRequestDao creates and returns a new DAO object for table data access.
+func NewAdminRequestDao() *AdminRequestDao {
+	return &AdminRequestDao{
+		group:   "cadmin",
+		table:   "admin_request",
+		columns: adminRequestColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *AdminRequestDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *AdminRequestDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *AdminRequestDao) Columns() AdminRequestColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *AdminRequestDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *AdminRequestDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *AdminRequestDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 81 - 0
internal/dao/internal/admin_request_relate.go

@@ -0,0 +1,81 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// AdminRequestRelateDao is the data access object for the table admin_request_relate.
+type AdminRequestRelateDao struct {
+	table   string                    // table is the underlying table name of the DAO.
+	group   string                    // group is the database configuration group name of the current DAO.
+	columns AdminRequestRelateColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// AdminRequestRelateColumns defines and stores column names for the table admin_request_relate.
+type AdminRequestRelateColumns struct {
+	Id             string //
+	AdminAuthId    string //
+	AdminRequestId string //
+	CreateTime     string // 创建时间
+	UpdateTime     string // 更新时间
+}
+
+// adminRequestRelateColumns holds the columns for the table admin_request_relate.
+var adminRequestRelateColumns = AdminRequestRelateColumns{
+	Id:             "id",
+	AdminAuthId:    "admin_auth_id",
+	AdminRequestId: "admin_request_id",
+	CreateTime:     "create_time",
+	UpdateTime:     "update_time",
+}
+
+// NewAdminRequestRelateDao creates and returns a new DAO object for table data access.
+func NewAdminRequestRelateDao() *AdminRequestRelateDao {
+	return &AdminRequestRelateDao{
+		group:   "cadmin",
+		table:   "admin_request_relate",
+		columns: adminRequestRelateColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *AdminRequestRelateDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *AdminRequestRelateDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *AdminRequestRelateDao) Columns() AdminRequestRelateColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *AdminRequestRelateDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *AdminRequestRelateDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *AdminRequestRelateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 83 - 0
internal/dao/internal/admin_token.go

@@ -0,0 +1,83 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// AdminTokenDao is the data access object for the table admin_token.
+type AdminTokenDao struct {
+	table   string            // table is the underlying table name of the DAO.
+	group   string            // group is the database configuration group name of the current DAO.
+	columns AdminTokenColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// AdminTokenColumns defines and stores column names for the table admin_token.
+type AdminTokenColumns struct {
+	Id          string //
+	Token       string // token
+	AdminUserId string // 用户ID
+	ExpireTime  string // 过期时间
+	CreateTime  string // 创建时间
+	UpdateTime  string // 更新时间
+}
+
+// adminTokenColumns holds the columns for the table admin_token.
+var adminTokenColumns = AdminTokenColumns{
+	Id:          "id",
+	Token:       "token",
+	AdminUserId: "admin_user_id",
+	ExpireTime:  "expire_time",
+	CreateTime:  "create_time",
+	UpdateTime:  "update_time",
+}
+
+// NewAdminTokenDao creates and returns a new DAO object for table data access.
+func NewAdminTokenDao() *AdminTokenDao {
+	return &AdminTokenDao{
+		group:   "cadmin",
+		table:   "admin_token",
+		columns: adminTokenColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *AdminTokenDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *AdminTokenDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *AdminTokenDao) Columns() AdminTokenColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *AdminTokenDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *AdminTokenDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *AdminTokenDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 93 - 0
internal/dao/internal/admin_user.go

@@ -0,0 +1,93 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// AdminUserDao is the data access object for the table admin_user.
+type AdminUserDao struct {
+	table   string           // table is the underlying table name of the DAO.
+	group   string           // group is the database configuration group name of the current DAO.
+	columns AdminUserColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// AdminUserColumns defines and stores column names for the table admin_user.
+type AdminUserColumns struct {
+	Id            string //
+	Username      string // 用户名
+	Password      string // 密码
+	LastLoginIp   string // 最后登录IP
+	LastLoginTime string // 最后登录时间
+	Status        string // 状态
+	Description   string // 描述
+	CreateTime    string // 创建时间
+	UpdateTime    string // 更新时间
+	Phone         string // 手机号
+	Wxuserid      string // 企业微信关联id
+}
+
+// adminUserColumns holds the columns for the table admin_user.
+var adminUserColumns = AdminUserColumns{
+	Id:            "id",
+	Username:      "username",
+	Password:      "password",
+	LastLoginIp:   "last_login_ip",
+	LastLoginTime: "last_login_time",
+	Status:        "status",
+	Description:   "description",
+	CreateTime:    "create_time",
+	UpdateTime:    "update_time",
+	Phone:         "phone",
+	Wxuserid:      "wxuserid",
+}
+
+// NewAdminUserDao creates and returns a new DAO object for table data access.
+func NewAdminUserDao() *AdminUserDao {
+	return &AdminUserDao{
+		group:   "cadmin",
+		table:   "admin_user",
+		columns: adminUserColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *AdminUserDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *AdminUserDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *AdminUserDao) Columns() AdminUserColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *AdminUserDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *AdminUserDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *AdminUserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 81 - 0
internal/dao/internal/admin_user_group_relate.go

@@ -0,0 +1,81 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// AdminUserGroupRelateDao is the data access object for the table admin_user_group_relate.
+type AdminUserGroupRelateDao struct {
+	table   string                      // table is the underlying table name of the DAO.
+	group   string                      // group is the database configuration group name of the current DAO.
+	columns AdminUserGroupRelateColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// AdminUserGroupRelateColumns defines and stores column names for the table admin_user_group_relate.
+type AdminUserGroupRelateColumns struct {
+	Id               string //
+	AdminUserGroupId string //
+	AdminAuthId      string //
+	CreateTime       string // 创建时间
+	UpdateTime       string // 更新时间
+}
+
+// adminUserGroupRelateColumns holds the columns for the table admin_user_group_relate.
+var adminUserGroupRelateColumns = AdminUserGroupRelateColumns{
+	Id:               "id",
+	AdminUserGroupId: "admin_user_group_id",
+	AdminAuthId:      "admin_auth_id",
+	CreateTime:       "create_time",
+	UpdateTime:       "update_time",
+}
+
+// NewAdminUserGroupRelateDao creates and returns a new DAO object for table data access.
+func NewAdminUserGroupRelateDao() *AdminUserGroupRelateDao {
+	return &AdminUserGroupRelateDao{
+		group:   "cadmin",
+		table:   "admin_user_group_relate",
+		columns: adminUserGroupRelateColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *AdminUserGroupRelateDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *AdminUserGroupRelateDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *AdminUserGroupRelateDao) Columns() AdminUserGroupRelateColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *AdminUserGroupRelateDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *AdminUserGroupRelateDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *AdminUserGroupRelateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 81 - 0
internal/dao/internal/admin_user_relate.go

@@ -0,0 +1,81 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// AdminUserRelateDao is the data access object for the table admin_user_relate.
+type AdminUserRelateDao struct {
+	table   string                 // table is the underlying table name of the DAO.
+	group   string                 // group is the database configuration group name of the current DAO.
+	columns AdminUserRelateColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// AdminUserRelateColumns defines and stores column names for the table admin_user_relate.
+type AdminUserRelateColumns struct {
+	Id               string //
+	AdminUserGroupId string //
+	AdminUserId      string //
+	CreateTime       string // 创建时间
+	UpdateTime       string // 更新时间
+}
+
+// adminUserRelateColumns holds the columns for the table admin_user_relate.
+var adminUserRelateColumns = AdminUserRelateColumns{
+	Id:               "id",
+	AdminUserGroupId: "admin_user_group_id",
+	AdminUserId:      "admin_user_id",
+	CreateTime:       "create_time",
+	UpdateTime:       "update_time",
+}
+
+// NewAdminUserRelateDao creates and returns a new DAO object for table data access.
+func NewAdminUserRelateDao() *AdminUserRelateDao {
+	return &AdminUserRelateDao{
+		group:   "cadmin",
+		table:   "admin_user_relate",
+		columns: adminUserRelateColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *AdminUserRelateDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *AdminUserRelateDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *AdminUserRelateDao) Columns() AdminUserRelateColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *AdminUserRelateDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *AdminUserRelateDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *AdminUserRelateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 95 - 0
internal/dao/internal/equity_info.go

@@ -0,0 +1,95 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// EquityInfoDao is the data access object for the table equity_info.
+type EquityInfoDao struct {
+	table   string            // table is the underlying table name of the DAO.
+	group   string            // group is the database configuration group name of the current DAO.
+	columns EquityInfoColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// EquityInfoColumns defines and stores column names for the table equity_info.
+type EquityInfoColumns struct {
+	Id         string //
+	ActiveId   string // 关联活动id
+	SerialNum  string // 序号
+	Code       string // 权益码(唯一性)
+	Name       string // 权益名称
+	State      string // 默认0:未赠送;1:已赠送;-1:已失效
+	Mold       string // 默认0:月度;1:年度
+	ExEndTime  string // 兑换截止时间
+	OrderCode  string // 订单编号
+	PrizeId    string // lottery_prize_info---id
+	CreateTime string // 创建时间
+	UpdateTime string // 更新时间
+}
+
+// equityInfoColumns holds the columns for the table equity_info.
+var equityInfoColumns = EquityInfoColumns{
+	Id:         "id",
+	ActiveId:   "active_id",
+	SerialNum:  "serial_num",
+	Code:       "code",
+	Name:       "name",
+	State:      "state",
+	Mold:       "mold",
+	ExEndTime:  "ex_end_time",
+	OrderCode:  "order_code",
+	PrizeId:    "prize_id",
+	CreateTime: "create_time",
+	UpdateTime: "update_time",
+}
+
+// NewEquityInfoDao creates and returns a new DAO object for table data access.
+func NewEquityInfoDao() *EquityInfoDao {
+	return &EquityInfoDao{
+		group:   "default",
+		table:   "equity_info",
+		columns: equityInfoColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *EquityInfoDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *EquityInfoDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *EquityInfoDao) Columns() EquityInfoColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *EquityInfoDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *EquityInfoDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *EquityInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 103 - 0
internal/dao/internal/lottery_prize_info.go

@@ -0,0 +1,103 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// LotteryPrizeInfoDao is the data access object for the table lottery_prize_info.
+type LotteryPrizeInfoDao struct {
+	table   string                  // table is the underlying table name of the DAO.
+	group   string                  // group is the database configuration group name of the current DAO.
+	columns LotteryPrizeInfoColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// LotteryPrizeInfoColumns defines and stores column names for the table lottery_prize_info.
+type LotteryPrizeInfoColumns struct {
+	Id             string // 奖品信息表id
+	ActiveId       string // 关联活动id
+	State          string // 默认0:可用;1:已取消或失效
+	Mold           string // 奖品类型:0:会员福利;1:参与奖
+	PbId           string // 奖品属性:默认0:剑鱼;1:WPS会员月卡;2:腾讯视频会员周卡;3:网易云音乐黑胶VIP月卡;4:喜马拉雅会员2个月 5:腾讯视频会员年卡 6:网易云音乐黑胶vip周卡 7:WPS会员年卡
+	JyPrize        string // 剑鱼奖品内容
+	Frequency      string // 中奖频次:每人X天“会员福利”仅可中奖:X次(每人7天“会员福利”仅可中奖1次)
+	Probability    string // 中奖概率
+	Inventory      string // 库存
+	Total          string // 奖品总量
+	AlarmSwitch    string // 告警开关0:打开;1:关闭
+	AlarmThreshold string // 奖品告警阈值
+	Target         string // 中奖目标用户。默认空:全部用户,f:免费用户;v:超级订阅用户;m:大会员用户;e:商机管理用户
+	DailyNum       string // 每日中此奖限制数量
+	CreateTime     string // 创建时间
+	UpdateTime     string // 更新时间
+}
+
+// lotteryPrizeInfoColumns holds the columns for the table lottery_prize_info.
+var lotteryPrizeInfoColumns = LotteryPrizeInfoColumns{
+	Id:             "id",
+	ActiveId:       "active_id",
+	State:          "state",
+	Mold:           "mold",
+	PbId:           "pb_id",
+	JyPrize:        "jy_prize",
+	Frequency:      "frequency",
+	Probability:    "probability",
+	Inventory:      "inventory",
+	Total:          "total",
+	AlarmSwitch:    "alarm_switch",
+	AlarmThreshold: "alarm_threshold",
+	Target:         "target",
+	DailyNum:       "daily_num",
+	CreateTime:     "create_time",
+	UpdateTime:     "update_time",
+}
+
+// NewLotteryPrizeInfoDao creates and returns a new DAO object for table data access.
+func NewLotteryPrizeInfoDao() *LotteryPrizeInfoDao {
+	return &LotteryPrizeInfoDao{
+		group:   "default",
+		table:   "lottery_prize_info",
+		columns: lotteryPrizeInfoColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *LotteryPrizeInfoDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *LotteryPrizeInfoDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *LotteryPrizeInfoDao) Columns() LotteryPrizeInfoColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *LotteryPrizeInfoDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *LotteryPrizeInfoDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *LotteryPrizeInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 89 - 0
internal/dao/internal/lottery_prize_order.go

@@ -0,0 +1,89 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// LotteryPrizeOrderDao is the data access object for the table lottery_prize_order.
+type LotteryPrizeOrderDao struct {
+	table   string                   // table is the underlying table name of the DAO.
+	group   string                   // group is the database configuration group name of the current DAO.
+	columns LotteryPrizeOrderColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// LotteryPrizeOrderColumns defines and stores column names for the table lottery_prize_order.
+type LotteryPrizeOrderColumns struct {
+	Id         string // 下单后抽奖活动关联订单信息表
+	ActiveId   string // 关联活动id
+	Phone      string // 用户手机号
+	PositionId string // 用户职位id
+	MgoUserId  string // 用户mgo user id
+	OrderCode  string // 关联订单表code
+	State      string // 默认0:未抽奖;1:已抽奖;-1:作废
+	CreateTime string // 创建时间
+	UpdateTime string // 更新时间
+}
+
+// lotteryPrizeOrderColumns holds the columns for the table lottery_prize_order.
+var lotteryPrizeOrderColumns = LotteryPrizeOrderColumns{
+	Id:         "id",
+	ActiveId:   "active_id",
+	Phone:      "phone",
+	PositionId: "position_id",
+	MgoUserId:  "mgo_user_id",
+	OrderCode:  "order_code",
+	State:      "state",
+	CreateTime: "create_time",
+	UpdateTime: "update_time",
+}
+
+// NewLotteryPrizeOrderDao creates and returns a new DAO object for table data access.
+func NewLotteryPrizeOrderDao() *LotteryPrizeOrderDao {
+	return &LotteryPrizeOrderDao{
+		group:   "default",
+		table:   "lottery_prize_order",
+		columns: lotteryPrizeOrderColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *LotteryPrizeOrderDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *LotteryPrizeOrderDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *LotteryPrizeOrderDao) Columns() LotteryPrizeOrderColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *LotteryPrizeOrderDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *LotteryPrizeOrderDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *LotteryPrizeOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 99 - 0
internal/dao/internal/lottery_user_account.go

@@ -0,0 +1,99 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// LotteryUserAccountDao is the data access object for the table lottery_user_account.
+type LotteryUserAccountDao struct {
+	table   string                    // table is the underlying table name of the DAO.
+	group   string                    // group is the database configuration group name of the current DAO.
+	columns LotteryUserAccountColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// LotteryUserAccountColumns defines and stores column names for the table lottery_user_account.
+type LotteryUserAccountColumns struct {
+	Id            string // 用户中奖信息表id
+	ActiveId      string // 关联活动id
+	PrizeId       string // 关联奖品信息id
+	Phone         string // 用户手机号
+	PositionId    string // 用户职位id
+	MgoUserId     string // 用户mgo user id
+	EquityId      string // 第三方奖品关联奖品内容表id(equity_info表)
+	OrderCode     string // 关联订单表code
+	UserAgent     string // 请求头信息
+	Ip            string // ip信息
+	CreateTime    string // 中奖时间
+	Expires       string // 到期时间
+	ProductInfoId string // 活动奖励对应的剑鱼产品id
+	UpdateTime    string // 更新时间
+}
+
+// lotteryUserAccountColumns holds the columns for the table lottery_user_account.
+var lotteryUserAccountColumns = LotteryUserAccountColumns{
+	Id:            "id",
+	ActiveId:      "active_id",
+	PrizeId:       "prize_id",
+	Phone:         "phone",
+	PositionId:    "position_id",
+	MgoUserId:     "mgo_user_id",
+	EquityId:      "equity_id",
+	OrderCode:     "order_code",
+	UserAgent:     "user_agent",
+	Ip:            "ip",
+	CreateTime:    "create_time",
+	Expires:       "expires",
+	ProductInfoId: "product_info_id",
+	UpdateTime:    "update_time",
+}
+
+// NewLotteryUserAccountDao creates and returns a new DAO object for table data access.
+func NewLotteryUserAccountDao() *LotteryUserAccountDao {
+	return &LotteryUserAccountDao{
+		group:   "default",
+		table:   "lottery_user_account",
+		columns: lotteryUserAccountColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *LotteryUserAccountDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *LotteryUserAccountDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *LotteryUserAccountDao) Columns() LotteryUserAccountColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *LotteryUserAccountDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *LotteryUserAccountDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *LotteryUserAccountDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 87 - 0
internal/dao/internal/prize_base_info.go

@@ -0,0 +1,87 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// PrizeBaseInfoDao is the data access object for the table prize_base_info.
+type PrizeBaseInfoDao struct {
+	table   string               // table is the underlying table name of the DAO.
+	group   string               // group is the database configuration group name of the current DAO.
+	columns PrizeBaseInfoColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// PrizeBaseInfoColumns defines and stores column names for the table prize_base_info.
+type PrizeBaseInfoColumns struct {
+	Id        string //
+	Name      string // 名称
+	Attribute string // 属性:0:剑鱼;1:三方会员
+	DrawPic   string // 抽奖奖品图片
+	WinPic    string // 中奖奖品图片
+	Notes     string // 奖品类型说明:超级订阅1个月(单省)| WPS会员月卡
+	Url       string // 奖品对应查看链接
+	Label     string // 标签
+}
+
+// prizeBaseInfoColumns holds the columns for the table prize_base_info.
+var prizeBaseInfoColumns = PrizeBaseInfoColumns{
+	Id:        "id",
+	Name:      "name",
+	Attribute: "attribute",
+	DrawPic:   "draw_pic",
+	WinPic:    "win_pic",
+	Notes:     "notes",
+	Url:       "url",
+	Label:     "label",
+}
+
+// NewPrizeBaseInfoDao creates and returns a new DAO object for table data access.
+func NewPrizeBaseInfoDao() *PrizeBaseInfoDao {
+	return &PrizeBaseInfoDao{
+		group:   "default",
+		table:   "prize_base_info",
+		columns: prizeBaseInfoColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *PrizeBaseInfoDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *PrizeBaseInfoDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *PrizeBaseInfoDao) Columns() PrizeBaseInfoColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *PrizeBaseInfoDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *PrizeBaseInfoDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *PrizeBaseInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 83 - 0
internal/dao/internal/product_info.go

@@ -0,0 +1,83 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// ProductInfoDao is the data access object for the table product_info.
+type ProductInfoDao struct {
+	table   string             // table is the underlying table name of the DAO.
+	group   string             // group is the database configuration group name of the current DAO.
+	columns ProductInfoColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// ProductInfoColumns defines and stores column names for the table product_info.
+type ProductInfoColumns struct {
+	Id    string //
+	Name  string // 名称
+	Mold  string // 类型:1:购买;2:续费;3:升级
+	State string // 是否可用;默认0:可用;1:不可用
+	Wide  string // 是否全国:默认0:非全国;-1:全国
+	Cycle string // 下单周期:1:年;2:月;3:天;4:季
+}
+
+// productInfoColumns holds the columns for the table product_info.
+var productInfoColumns = ProductInfoColumns{
+	Id:    "id",
+	Name:  "name",
+	Mold:  "mold",
+	State: "state",
+	Wide:  "wide",
+	Cycle: "cycle",
+}
+
+// NewProductInfoDao creates and returns a new DAO object for table data access.
+func NewProductInfoDao() *ProductInfoDao {
+	return &ProductInfoDao{
+		group:   "default",
+		table:   "product_info",
+		columns: productInfoColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *ProductInfoDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *ProductInfoDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *ProductInfoDao) Columns() ProductInfoColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *ProductInfoDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *ProductInfoDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *ProductInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 85 - 0
internal/dao/internal/product_rule.go

@@ -0,0 +1,85 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+
+	"github.com/gogf/gf/v2/database/gdb"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// ProductRuleDao is the data access object for the table product_rule.
+type ProductRuleDao struct {
+	table   string             // table is the underlying table name of the DAO.
+	group   string             // group is the database configuration group name of the current DAO.
+	columns ProductRuleColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// ProductRuleColumns defines and stores column names for the table product_rule.
+type ProductRuleColumns struct {
+	Id            string // 赠送规则iddoc
+	ActiveId      string // 活动id
+	ProductInfoId string // 活动奖励对应的剑鱼产品id
+	PrizeId       string // 活动奖品信息表lottery_prize_info的id
+	State         string // 是否可用;默认0:可用;1:不可用
+	Cycle         string // 可兑换周期(单位天): 90
+	CreateDate    string // 创建时间
+}
+
+// productRuleColumns holds the columns for the table product_rule.
+var productRuleColumns = ProductRuleColumns{
+	Id:            "id",
+	ActiveId:      "active_id",
+	ProductInfoId: "product_info_id",
+	PrizeId:       "prize_id",
+	State:         "state",
+	Cycle:         "cycle",
+	CreateDate:    "create_date",
+}
+
+// NewProductRuleDao creates and returns a new DAO object for table data access.
+func NewProductRuleDao() *ProductRuleDao {
+	return &ProductRuleDao{
+		group:   "default",
+		table:   "product_rule",
+		columns: productRuleColumns,
+	}
+}
+
+// DB retrieves and returns the underlying raw database management object of the current DAO.
+func (dao *ProductRuleDao) DB() gdb.DB {
+	return g.DB(dao.group)
+}
+
+// Table returns the table name of the current DAO.
+func (dao *ProductRuleDao) Table() string {
+	return dao.table
+}
+
+// Columns returns all column names of the current DAO.
+func (dao *ProductRuleDao) Columns() ProductRuleColumns {
+	return dao.columns
+}
+
+// Group returns the database configuration group name of the current DAO.
+func (dao *ProductRuleDao) Group() string {
+	return dao.group
+}
+
+// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
+func (dao *ProductRuleDao) Ctx(ctx context.Context) *gdb.Model {
+	return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rolls back the transaction and returns the error if function f returns a non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note: Do not commit or roll back the transaction in function f,
+// as it is automatically handled by this function.
+func (dao *ProductRuleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+	return dao.Ctx(ctx).Transaction(ctx, f)
+}

+ 27 - 0
internal/dao/lottery_prize_info.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalLotteryPrizeInfoDao is an internal type for wrapping the internal DAO implementation.
+type internalLotteryPrizeInfoDao = *internal.LotteryPrizeInfoDao
+
+// lotteryPrizeInfoDao is the data access object for the table lottery_prize_info.
+// You can define custom methods on it to extend its functionality as needed.
+type lotteryPrizeInfoDao struct {
+	internalLotteryPrizeInfoDao
+}
+
+var (
+	// LotteryPrizeInfo is a globally accessible object for table lottery_prize_info operations.
+	LotteryPrizeInfo = lotteryPrizeInfoDao{
+		internal.NewLotteryPrizeInfoDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/lottery_prize_order.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalLotteryPrizeOrderDao is an internal type for wrapping the internal DAO implementation.
+type internalLotteryPrizeOrderDao = *internal.LotteryPrizeOrderDao
+
+// lotteryPrizeOrderDao is the data access object for the table lottery_prize_order.
+// You can define custom methods on it to extend its functionality as needed.
+type lotteryPrizeOrderDao struct {
+	internalLotteryPrizeOrderDao
+}
+
+var (
+	// LotteryPrizeOrder is a globally accessible object for table lottery_prize_order operations.
+	LotteryPrizeOrder = lotteryPrizeOrderDao{
+		internal.NewLotteryPrizeOrderDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/lottery_user_account.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalLotteryUserAccountDao is an internal type for wrapping the internal DAO implementation.
+type internalLotteryUserAccountDao = *internal.LotteryUserAccountDao
+
+// lotteryUserAccountDao is the data access object for the table lottery_user_account.
+// You can define custom methods on it to extend its functionality as needed.
+type lotteryUserAccountDao struct {
+	internalLotteryUserAccountDao
+}
+
+var (
+	// LotteryUserAccount is a globally accessible object for table lottery_user_account operations.
+	LotteryUserAccount = lotteryUserAccountDao{
+		internal.NewLotteryUserAccountDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/prize_base_info.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalPrizeBaseInfoDao is an internal type for wrapping the internal DAO implementation.
+type internalPrizeBaseInfoDao = *internal.PrizeBaseInfoDao
+
+// prizeBaseInfoDao is the data access object for the table prize_base_info.
+// You can define custom methods on it to extend its functionality as needed.
+type prizeBaseInfoDao struct {
+	internalPrizeBaseInfoDao
+}
+
+var (
+	// PrizeBaseInfo is a globally accessible object for table prize_base_info operations.
+	PrizeBaseInfo = prizeBaseInfoDao{
+		internal.NewPrizeBaseInfoDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/product_info.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalProductInfoDao is an internal type for wrapping the internal DAO implementation.
+type internalProductInfoDao = *internal.ProductInfoDao
+
+// productInfoDao is the data access object for the table product_info.
+// You can define custom methods on it to extend its functionality as needed.
+type productInfoDao struct {
+	internalProductInfoDao
+}
+
+var (
+	// ProductInfo is a globally accessible object for table product_info operations.
+	ProductInfo = productInfoDao{
+		internal.NewProductInfoDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 27 - 0
internal/dao/product_rule.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
+// =================================================================================
+
+package dao
+
+import (
+	"demo/internal/dao/internal"
+)
+
+// internalProductRuleDao is an internal type for wrapping the internal DAO implementation.
+type internalProductRuleDao = *internal.ProductRuleDao
+
+// productRuleDao is the data access object for the table product_rule.
+// You can define custom methods on it to extend its functionality as needed.
+type productRuleDao struct {
+	internalProductRuleDao
+}
+
+var (
+	// ProductRule is a globally accessible object for table product_rule operations.
+	ProductRule = productRuleDao{
+		internal.NewProductRuleDao(),
+	}
+)
+
+// Add your custom methods and functionality below.

+ 0 - 0
internal/logic/.gitkeep


+ 1 - 0
internal/logic/activity/activity.go

@@ -0,0 +1 @@
+package activity

+ 58 - 0
internal/middleware/middleware_auth.go

@@ -0,0 +1,58 @@
+package middleware
+
+import (
+	"demo/internal/dao"
+	"demo/internal/model/do"
+	"demo/internal/model/entity"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/gogf/gf/v2/os/gtime"
+	"net/http"
+)
+
+// HandlerAuth 接入剑鱼后台现有的权限控制
+func HandlerAuth(r *ghttp.Request) {
+	token_ := r.Request.URL.Query().Get("_token")
+	// todo  待优化
+	// 验证token有效
+	da := dao.AdminToken
+	orm := da.Ctx(r.Context())
+	token := entity.AdminToken{}
+	err := orm.Where(da.Columns().Token, token_).Scan(&token)
+	if err != nil || gtime.Now().After(token.ExpireTime) {
+		r.Response.WriteStatus(http.StatusForbidden)
+		return
+	}
+	user := entity.AdminUser{}
+	// 验证用户有效
+	err = dao.AdminUser.Ctx(r.Context()).Where(dao.AdminUser.Columns().Id, token.AdminUserId).Scan(&user)
+	if err != nil || user.Status == 2 {
+		r.Response.WriteStatus(http.StatusForbidden)
+		return
+	}
+	r.SetCtxVar("admin_user_id", token.AdminUserId)
+	// 获得请求id 验证请求有效
+	adminReq := entity.AdminRequest{}
+	// todo 因为这是 restful风格的接口 ,和剑鱼后台原有的权限判断不一致,所以在不调整表结构的情况下使用原call字段 充当请求方式字段  在页面是`类型配置`输入框
+	// 后边有时间可以看一下怎么调整一下
+	err = dao.AdminRequest.Ctx(r.Context()).Where(do.AdminRequest{Action: r.URL.Path, Call: r.Method}).Scan(&adminReq)
+	if err != nil {
+		r.Response.WriteStatus(http.StatusBadRequest)
+		return
+	}
+	exist, err := orm.Raw("SELECT * FROM cadmin.admin_user_relate aur ,admin_user_group_relate augr ,admin_request_relate arr where arr.admin_request_id=? and aur.admin_user_id=? and augr.admin_user_group_id=aur.admin_user_group_id and augr.admin_auth_id=arr.admin_auth_id ", adminReq.Id, token.AdminUserId).Exist()
+	if err != nil || !exist {
+		r.Response.WriteStatus(http.StatusNotImplemented)
+		return
+	}
+	// token续期
+	//在验证过token是否过期后为token续期
+	renew := token.ExpireTime.AddDate(0, 0, -1)
+	if renew.Before(gtime.Now()) {
+		_, err = orm.Data(da.Columns().ExpireTime, token.ExpireTime.AddDate(0, 0, 2)).Where(da.Columns().Id, token.Id).Update()
+		if err != nil {
+			g.Log().Error(r.Context(), "token 续期失败", err)
+		}
+	}
+	r.Middleware.Next()
+}

+ 0 - 0
internal/model/.gitkeep


+ 0 - 0
internal/model/do/.gitkeep


+ 32 - 0
internal/model/do/activity_info.go

@@ -0,0 +1,32 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// ActivityInfo is the golang structure of table activity_info for DAO operations like Where/Data.
+type ActivityInfo struct {
+	g.Meta           `orm:"table:activity_info, do:true"`
+	Id               interface{} // 抽奖活动信息表id
+	Name             interface{} // 活动名称
+	StartTime        *gtime.Time // 活动开始时间
+	EndTime          *gtime.Time // 活动结束时间
+	LotteryStartTime interface{} // 抽奖开始时间
+	LotteryEndTime   interface{} // 抽奖结束时间
+	Cost             interface{} // 抽奖花费:1、默X个剑鱼币兑换1次抽奖机会;2、订单抽奖: 抽奖次数动态根据下单次数判断
+	DailyNum         interface{} // 每人每个身份每天抽奖次数限制
+	DeviceNum        interface{} // 每个设备每天抽奖次数限制
+	IpNum            interface{} // 每个IP每天抽奖次数限制
+	Pic              interface{} // 活动图片
+	Rule             interface{} // 活动规则
+	ShareCopy        interface{} // 分享文案:{"APP":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"},"PC":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"},"H5":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"},"WX":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"}}
+	State            interface{} // 活动状态默认0:有效;1:已取消
+	Mold             interface{} // 活动类型 0:购买奖励;1:剑鱼币抽奖;2:订单抽奖
+	CreateTime       *gtime.Time // 创建时间
+	OrderType        interface{} // 该字段仅当mold值为2时生效;m_1-大会员购买;  v_1-购买超级订阅;v_2-续费超级订阅;v_3-升级超级订阅  支持多个时使用英文逗号分割
+}

+ 22 - 0
internal/model/do/admin_request.go

@@ -0,0 +1,22 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminRequest is the golang structure of table admin_request for DAO operations like Where/Data.
+type AdminRequest struct {
+	g.Meta     `orm:"table:admin_request, do:true"`
+	Id         interface{} //
+	Type       interface{} // 请求类型
+	Name       interface{} // 名称
+	Action     interface{} // action
+	Call       interface{} // 类型配置
+	CreateTime *gtime.Time // 创建时间
+	UpdateTime *gtime.Time // 更新时间
+}

+ 20 - 0
internal/model/do/admin_request_relate.go

@@ -0,0 +1,20 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminRequestRelate is the golang structure of table admin_request_relate for DAO operations like Where/Data.
+type AdminRequestRelate struct {
+	g.Meta         `orm:"table:admin_request_relate, do:true"`
+	Id             interface{} //
+	AdminAuthId    interface{} //
+	AdminRequestId interface{} //
+	CreateTime     *gtime.Time // 创建时间
+	UpdateTime     *gtime.Time // 更新时间
+}

+ 21 - 0
internal/model/do/admin_token.go

@@ -0,0 +1,21 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminToken is the golang structure of table admin_token for DAO operations like Where/Data.
+type AdminToken struct {
+	g.Meta      `orm:"table:admin_token, do:true"`
+	Id          interface{} //
+	Token       interface{} // token
+	AdminUserId interface{} // 用户ID
+	ExpireTime  *gtime.Time // 过期时间
+	CreateTime  *gtime.Time // 创建时间
+	UpdateTime  *gtime.Time // 更新时间
+}

+ 26 - 0
internal/model/do/admin_user.go

@@ -0,0 +1,26 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminUser is the golang structure of table admin_user for DAO operations like Where/Data.
+type AdminUser struct {
+	g.Meta        `orm:"table:admin_user, do:true"`
+	Id            interface{} //
+	Username      interface{} // 用户名
+	Password      interface{} // 密码
+	LastLoginIp   interface{} // 最后登录IP
+	LastLoginTime *gtime.Time // 最后登录时间
+	Status        interface{} // 状态
+	Description   interface{} // 描述
+	CreateTime    *gtime.Time // 创建时间
+	UpdateTime    *gtime.Time // 更新时间
+	Phone         interface{} // 手机号
+	Wxuserid      interface{} // 企业微信关联id
+}

+ 20 - 0
internal/model/do/admin_user_group_relate.go

@@ -0,0 +1,20 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminUserGroupRelate is the golang structure of table admin_user_group_relate for DAO operations like Where/Data.
+type AdminUserGroupRelate struct {
+	g.Meta           `orm:"table:admin_user_group_relate, do:true"`
+	Id               interface{} //
+	AdminUserGroupId interface{} //
+	AdminAuthId      interface{} //
+	CreateTime       *gtime.Time // 创建时间
+	UpdateTime       *gtime.Time // 更新时间
+}

+ 20 - 0
internal/model/do/admin_user_relate.go

@@ -0,0 +1,20 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminUserRelate is the golang structure of table admin_user_relate for DAO operations like Where/Data.
+type AdminUserRelate struct {
+	g.Meta           `orm:"table:admin_user_relate, do:true"`
+	Id               interface{} //
+	AdminUserGroupId interface{} //
+	AdminUserId      interface{} //
+	CreateTime       *gtime.Time // 创建时间
+	UpdateTime       *gtime.Time // 更新时间
+}

+ 27 - 0
internal/model/do/equity_info.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// EquityInfo is the golang structure of table equity_info for DAO operations like Where/Data.
+type EquityInfo struct {
+	g.Meta     `orm:"table:equity_info, do:true"`
+	Id         interface{} //
+	ActiveId   interface{} // 关联活动id
+	SerialNum  interface{} // 序号
+	Code       interface{} // 权益码(唯一性)
+	Name       interface{} // 权益名称
+	State      interface{} // 默认0:未赠送;1:已赠送;-1:已失效
+	Mold       interface{} // 默认0:月度;1:年度
+	ExEndTime  *gtime.Time // 兑换截止时间
+	OrderCode  interface{} // 订单编号
+	PrizeId    interface{} // lottery_prize_info---id
+	CreateTime *gtime.Time // 创建时间
+	UpdateTime *gtime.Time // 更新时间
+}

+ 31 - 0
internal/model/do/lottery_prize_info.go

@@ -0,0 +1,31 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// LotteryPrizeInfo is the golang structure of table lottery_prize_info for DAO operations like Where/Data.
+type LotteryPrizeInfo struct {
+	g.Meta         `orm:"table:lottery_prize_info, do:true"`
+	Id             interface{} // 奖品信息表id
+	ActiveId       interface{} // 关联活动id
+	State          interface{} // 默认0:可用;1:已取消或失效
+	Mold           interface{} // 奖品类型:0:会员福利;1:参与奖
+	PbId           interface{} // 奖品属性:默认0:剑鱼;1:WPS会员月卡;2:腾讯视频会员周卡;3:网易云音乐黑胶VIP月卡;4:喜马拉雅会员2个月 5:腾讯视频会员年卡 6:网易云音乐黑胶vip周卡 7:WPS会员年卡
+	JyPrize        interface{} // 剑鱼奖品内容
+	Frequency      interface{} // 中奖频次:每人X天“会员福利”仅可中奖:X次(每人7天“会员福利”仅可中奖1次)
+	Probability    interface{} // 中奖概率
+	Inventory      interface{} // 库存
+	Total          interface{} // 奖品总量
+	AlarmSwitch    interface{} // 告警开关0:打开;1:关闭
+	AlarmThreshold interface{} // 奖品告警阈值
+	Target         interface{} // 中奖目标用户。默认空:全部用户,f:免费用户;v:超级订阅用户;m:大会员用户;e:商机管理用户
+	DailyNum       interface{} // 每日中此奖限制数量
+	CreateTime     *gtime.Time // 创建时间
+	UpdateTime     *gtime.Time // 更新时间
+}

+ 24 - 0
internal/model/do/lottery_prize_order.go

@@ -0,0 +1,24 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// LotteryPrizeOrder is the golang structure of table lottery_prize_order for DAO operations like Where/Data.
+type LotteryPrizeOrder struct {
+	g.Meta     `orm:"table:lottery_prize_order, do:true"`
+	Id         interface{} // 下单后抽奖活动关联订单信息表
+	ActiveId   interface{} // 关联活动id
+	Phone      interface{} // 用户手机号
+	PositionId interface{} // 用户职位id
+	MgoUserId  interface{} // 用户mgo user id
+	OrderCode  interface{} // 关联订单表code
+	State      interface{} // 默认0:未抽奖;1:已抽奖;-1:作废
+	CreateTime *gtime.Time // 创建时间
+	UpdateTime *gtime.Time // 更新时间
+}

+ 29 - 0
internal/model/do/lottery_user_account.go

@@ -0,0 +1,29 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// LotteryUserAccount is the golang structure of table lottery_user_account for DAO operations like Where/Data.
+type LotteryUserAccount struct {
+	g.Meta        `orm:"table:lottery_user_account, do:true"`
+	Id            interface{} // 用户中奖信息表id
+	ActiveId      interface{} // 关联活动id
+	PrizeId       interface{} // 关联奖品信息id
+	Phone         interface{} // 用户手机号
+	PositionId    interface{} // 用户职位id
+	MgoUserId     interface{} // 用户mgo user id
+	EquityId      interface{} // 第三方奖品关联奖品内容表id(equity_info表)
+	OrderCode     interface{} // 关联订单表code
+	UserAgent     interface{} // 请求头信息
+	Ip            interface{} // ip信息
+	CreateTime    *gtime.Time // 中奖时间
+	Expires       *gtime.Time // 到期时间
+	ProductInfoId interface{} // 活动奖励对应的剑鱼产品id
+	UpdateTime    *gtime.Time // 更新时间
+}

+ 22 - 0
internal/model/do/prize_base_info.go

@@ -0,0 +1,22 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// PrizeBaseInfo is the golang structure of table prize_base_info for DAO operations like Where/Data.
+type PrizeBaseInfo struct {
+	g.Meta    `orm:"table:prize_base_info, do:true"`
+	Id        interface{} //
+	Name      interface{} // 名称
+	Attribute interface{} // 属性:0:剑鱼;1:三方会员
+	DrawPic   interface{} // 抽奖奖品图片
+	WinPic    interface{} // 中奖奖品图片
+	Notes     interface{} // 奖品类型说明:超级订阅1个月(单省)| WPS会员月卡
+	Url       interface{} // 奖品对应查看链接
+	Label     interface{} // 标签
+}

+ 20 - 0
internal/model/do/product_info.go

@@ -0,0 +1,20 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+// ProductInfo is the golang structure of table product_info for DAO operations like Where/Data.
+type ProductInfo struct {
+	g.Meta `orm:"table:product_info, do:true"`
+	Id     interface{} //
+	Name   interface{} // 名称
+	Mold   interface{} // 类型:1:购买;2:续费;3:升级
+	State  interface{} // 是否可用;默认0:可用;1:不可用
+	Wide   interface{} // 是否全国:默认0:非全国;-1:全国
+	Cycle  interface{} // 下单周期:1:年;2:月;3:天;4:季
+}

+ 22 - 0
internal/model/do/product_rule.go

@@ -0,0 +1,22 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// ProductRule is the golang structure of table product_rule for DAO operations like Where/Data.
+type ProductRule struct {
+	g.Meta        `orm:"table:product_rule, do:true"`
+	Id            interface{} // 赠送规则iddoc
+	ActiveId      interface{} // 活动id
+	ProductInfoId interface{} // 活动奖励对应的剑鱼产品id
+	PrizeId       interface{} // 活动奖品信息表lottery_prize_info的id
+	State         interface{} // 是否可用;默认0:可用;1:不可用
+	Cycle         interface{} // 可兑换周期(单位天): 90
+	CreateDate    *gtime.Time // 创建时间
+}

+ 0 - 0
internal/model/entity/.gitkeep


+ 30 - 0
internal/model/entity/activity_info.go

@@ -0,0 +1,30 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// ActivityInfo is the golang structure for table activity_info.
+type ActivityInfo struct {
+	Id               int         `json:"id"               orm:"id"                 description:"抽奖活动信息表id"`                                                                                                                                                                                                                                                                                                                       // 抽奖活动信息表id
+	Name             string      `json:"name"             orm:"name"               description:"活动名称"`                                                                                                                                                                                                                                                                                                                            // 活动名称
+	StartTime        *gtime.Time `json:"startTime"        orm:"start_time"         description:"活动开始时间"`                                                                                                                                                                                                                                                                                                                          // 活动开始时间
+	EndTime          *gtime.Time `json:"endTime"          orm:"end_time"           description:"活动结束时间"`                                                                                                                                                                                                                                                                                                                          // 活动结束时间
+	LotteryStartTime string      `json:"lotteryStartTime" orm:"lottery_start_time" description:"抽奖开始时间"`                                                                                                                                                                                                                                                                                                                          // 抽奖开始时间
+	LotteryEndTime   string      `json:"lotteryEndTime"   orm:"lottery_end_time"   description:"抽奖结束时间"`                                                                                                                                                                                                                                                                                                                          // 抽奖结束时间
+	Cost             int         `json:"cost"             orm:"cost"               description:"抽奖花费:1、默X个剑鱼币兑换1次抽奖机会;2、订单抽奖: 抽奖次数动态根据下单次数判断"`                                                                                                                                                                                                                                                                                    // 抽奖花费:1、默X个剑鱼币兑换1次抽奖机会;2、订单抽奖: 抽奖次数动态根据下单次数判断
+	DailyNum         int         `json:"dailyNum"         orm:"daily_num"          description:"每人每个身份每天抽奖次数限制"`                                                                                                                                                                                                                                                                                                                  // 每人每个身份每天抽奖次数限制
+	DeviceNum        int         `json:"deviceNum"        orm:"device_num"         description:"每个设备每天抽奖次数限制"`                                                                                                                                                                                                                                                                                                                    // 每个设备每天抽奖次数限制
+	IpNum            int         `json:"ipNum"            orm:"ip_num"             description:"每个IP每天抽奖次数限制"`                                                                                                                                                                                                                                                                                                                    // 每个IP每天抽奖次数限制
+	Pic              string      `json:"pic"              orm:"pic"                description:"活动图片"`                                                                                                                                                                                                                                                                                                                            // 活动图片
+	Rule             string      `json:"rule"             orm:"rule"               description:"活动规则"`                                                                                                                                                                                                                                                                                                                            // 活动规则
+	ShareCopy        string      `json:"shareCopy"        orm:"share_copy"         description:"分享文案:{\"APP\":{\"title\":\"标题\",\"subtitle\":\"副标题\",\"pic\":\"图片\",\"href\":\"链接\"},\"PC\":{\"title\":\"标题\",\"subtitle\":\"副标题\",\"pic\":\"图片\",\"href\":\"链接\"},\"H5\":{\"title\":\"标题\",\"subtitle\":\"副标题\",\"pic\":\"图片\",\"href\":\"链接\"},\"WX\":{\"title\":\"标题\",\"subtitle\":\"副标题\",\"pic\":\"图片\",\"href\":\"链接\"}}"` // 分享文案:{"APP":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"},"PC":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"},"H5":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"},"WX":{"title":"标题","subtitle":"副标题","pic":"图片","href":"链接"}}
+	State            int         `json:"state"            orm:"state"              description:"活动状态默认0:有效;1:已取消"`                                                                                                                                                                                                                                                                                                                // 活动状态默认0:有效;1:已取消
+	Mold             int         `json:"mold"             orm:"mold"               description:"活动类型 0:购买奖励;1:剑鱼币抽奖;2:订单抽奖"`                                                                                                                                                                                                                                                                                                      // 活动类型 0:购买奖励;1:剑鱼币抽奖;2:订单抽奖
+	CreateTime       *gtime.Time `json:"createTime"       orm:"create_time"        description:"创建时间"`                                                                                                                                                                                                                                                                                                                            // 创建时间
+	OrderType        string      `json:"orderType"        orm:"order_type"         description:"该字段仅当mold值为2时生效;m_1-大会员购买;  v_1-购买超级订阅;v_2-续费超级订阅;v_3-升级超级订阅  支持多个时使用英文逗号分割"`                                                                                                                                                                                                                                                     // 该字段仅当mold值为2时生效;m_1-大会员购买;  v_1-购买超级订阅;v_2-续费超级订阅;v_3-升级超级订阅  支持多个时使用英文逗号分割
+}

+ 20 - 0
internal/model/entity/admin_request.go

@@ -0,0 +1,20 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminRequest is the golang structure for table admin_request.
+type AdminRequest struct {
+	Id         uint        `json:"id"         orm:"id"          description:""`       //
+	Type       string      `json:"type"       orm:"type"        description:"请求类型"`   // 请求类型
+	Name       string      `json:"name"       orm:"name"        description:"名称"`     // 名称
+	Action     string      `json:"action"     orm:"action"      description:"action"` // action
+	Call       string      `json:"call"       orm:"call"        description:"类型配置"`   // 类型配置
+	CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:"创建时间"`   // 创建时间
+	UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:"更新时间"`   // 更新时间
+}

+ 18 - 0
internal/model/entity/admin_request_relate.go

@@ -0,0 +1,18 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminRequestRelate is the golang structure for table admin_request_relate.
+type AdminRequestRelate struct {
+	Id             uint        `json:"id"             orm:"id"               description:""`     //
+	AdminAuthId    uint        `json:"adminAuthId"    orm:"admin_auth_id"    description:""`     //
+	AdminRequestId uint        `json:"adminRequestId" orm:"admin_request_id" description:""`     //
+	CreateTime     *gtime.Time `json:"createTime"     orm:"create_time"      description:"创建时间"` // 创建时间
+	UpdateTime     *gtime.Time `json:"updateTime"     orm:"update_time"      description:"更新时间"` // 更新时间
+}

+ 19 - 0
internal/model/entity/admin_token.go

@@ -0,0 +1,19 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminToken is the golang structure for table admin_token.
+type AdminToken struct {
+	Id          uint64      `json:"id"          orm:"id"            description:""`      //
+	Token       string      `json:"token"       orm:"token"         description:"token"` // token
+	AdminUserId uint        `json:"adminUserId" orm:"admin_user_id" description:"用户ID"`  // 用户ID
+	ExpireTime  *gtime.Time `json:"expireTime"  orm:"expire_time"   description:"过期时间"`  // 过期时间
+	CreateTime  *gtime.Time `json:"createTime"  orm:"create_time"   description:"创建时间"`  // 创建时间
+	UpdateTime  *gtime.Time `json:"updateTime"  orm:"update_time"   description:"更新时间"`  // 更新时间
+}

+ 24 - 0
internal/model/entity/admin_user.go

@@ -0,0 +1,24 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminUser is the golang structure for table admin_user.
+type AdminUser struct {
+	Id            uint        `json:"id"            orm:"id"              description:""`         //
+	Username      string      `json:"username"      orm:"username"        description:"用户名"`      // 用户名
+	Password      string      `json:"password"      orm:"password"        description:"密码"`       // 密码
+	LastLoginIp   string      `json:"lastLoginIp"   orm:"last_login_ip"   description:"最后登录IP"`   // 最后登录IP
+	LastLoginTime *gtime.Time `json:"lastLoginTime" orm:"last_login_time" description:"最后登录时间"`   // 最后登录时间
+	Status        uint        `json:"status"        orm:"status"          description:"状态"`       // 状态
+	Description   string      `json:"description"   orm:"description"     description:"描述"`       // 描述
+	CreateTime    *gtime.Time `json:"createTime"    orm:"create_time"     description:"创建时间"`     // 创建时间
+	UpdateTime    *gtime.Time `json:"updateTime"    orm:"update_time"     description:"更新时间"`     // 更新时间
+	Phone         string      `json:"phone"         orm:"phone"           description:"手机号"`      // 手机号
+	Wxuserid      string      `json:"wxuserid"      orm:"wxuserid"        description:"企业微信关联id"` // 企业微信关联id
+}

+ 18 - 0
internal/model/entity/admin_user_group_relate.go

@@ -0,0 +1,18 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminUserGroupRelate is the golang structure for table admin_user_group_relate.
+type AdminUserGroupRelate struct {
+	Id               uint        `json:"id"               orm:"id"                  description:""`     //
+	AdminUserGroupId uint        `json:"adminUserGroupId" orm:"admin_user_group_id" description:""`     //
+	AdminAuthId      uint        `json:"adminAuthId"      orm:"admin_auth_id"       description:""`     //
+	CreateTime       *gtime.Time `json:"createTime"       orm:"create_time"         description:"创建时间"` // 创建时间
+	UpdateTime       *gtime.Time `json:"updateTime"       orm:"update_time"         description:"更新时间"` // 更新时间
+}

+ 18 - 0
internal/model/entity/admin_user_relate.go

@@ -0,0 +1,18 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// AdminUserRelate is the golang structure for table admin_user_relate.
+type AdminUserRelate struct {
+	Id               uint        `json:"id"               orm:"id"                  description:""`     //
+	AdminUserGroupId uint        `json:"adminUserGroupId" orm:"admin_user_group_id" description:""`     //
+	AdminUserId      uint        `json:"adminUserId"      orm:"admin_user_id"       description:""`     //
+	CreateTime       *gtime.Time `json:"createTime"       orm:"create_time"         description:"创建时间"` // 创建时间
+	UpdateTime       *gtime.Time `json:"updateTime"       orm:"update_time"         description:"更新时间"` // 更新时间
+}

+ 25 - 0
internal/model/entity/equity_info.go

@@ -0,0 +1,25 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// EquityInfo is the golang structure for table equity_info.
+type EquityInfo struct {
+	Id         int         `json:"id"         orm:"id"          description:""`                        //
+	ActiveId   int         `json:"activeId"   orm:"active_id"   description:"关联活动id"`                  // 关联活动id
+	SerialNum  string      `json:"serialNum"  orm:"serial_num"  description:"序号"`                      // 序号
+	Code       string      `json:"code"       orm:"code"        description:"权益码(唯一性)"`                // 权益码(唯一性)
+	Name       string      `json:"name"       orm:"name"        description:"权益名称"`                    // 权益名称
+	State      int         `json:"state"      orm:"state"       description:"默认0:未赠送;1:已赠送;-1:已失效"`    // 默认0:未赠送;1:已赠送;-1:已失效
+	Mold       int         `json:"mold"       orm:"mold"        description:"默认0:月度;1:年度"`             // 默认0:月度;1:年度
+	ExEndTime  *gtime.Time `json:"exEndTime"  orm:"ex_end_time" description:"兑换截止时间"`                  // 兑换截止时间
+	OrderCode  string      `json:"orderCode"  orm:"order_code"  description:"订单编号"`                    // 订单编号
+	PrizeId    int         `json:"prizeId"    orm:"prize_id"    description:"lottery_prize_info---id"` // lottery_prize_info---id
+	CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:"创建时间"`                    // 创建时间
+	UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:"更新时间"`                    // 更新时间
+}

+ 29 - 0
internal/model/entity/lottery_prize_info.go

@@ -0,0 +1,29 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// LotteryPrizeInfo is the golang structure for table lottery_prize_info.
+type LotteryPrizeInfo struct {
+	Id             int         `json:"id"             orm:"id"              description:"奖品信息表id"`                                                                                         // 奖品信息表id
+	ActiveId       int         `json:"activeId"       orm:"active_id"       description:"关联活动id"`                                                                                          // 关联活动id
+	State          int         `json:"state"          orm:"state"           description:"默认0:可用;1:已取消或失效"`                                                                                 // 默认0:可用;1:已取消或失效
+	Mold           int         `json:"mold"           orm:"mold"            description:"奖品类型:0:会员福利;1:参与奖"`                                                                               // 奖品类型:0:会员福利;1:参与奖
+	PbId           int         `json:"pbId"           orm:"pb_id"           description:"奖品属性:默认0:剑鱼;1:WPS会员月卡;2:腾讯视频会员周卡;3:网易云音乐黑胶VIP月卡;4:喜马拉雅会员2个月 5:腾讯视频会员年卡 6:网易云音乐黑胶vip周卡 7:WPS会员年卡"` // 奖品属性:默认0:剑鱼;1:WPS会员月卡;2:腾讯视频会员周卡;3:网易云音乐黑胶VIP月卡;4:喜马拉雅会员2个月 5:腾讯视频会员年卡 6:网易云音乐黑胶vip周卡 7:WPS会员年卡
+	JyPrize        string      `json:"jyPrize"        orm:"jy_prize"        description:"剑鱼奖品内容"`                                                                                          // 剑鱼奖品内容
+	Frequency      string      `json:"frequency"      orm:"frequency"       description:"中奖频次:每人X天“会员福利”仅可中奖:X次(每人7天“会员福利”仅可中奖1次)"`                                                        // 中奖频次:每人X天“会员福利”仅可中奖:X次(每人7天“会员福利”仅可中奖1次)
+	Probability    int         `json:"probability"    orm:"probability"     description:"中奖概率"`                                                                                            // 中奖概率
+	Inventory      int         `json:"inventory"      orm:"inventory"       description:"库存"`                                                                                              // 库存
+	Total          int         `json:"total"          orm:"total"           description:"奖品总量"`                                                                                            // 奖品总量
+	AlarmSwitch    int         `json:"alarmSwitch"    orm:"alarm_switch"    description:"告警开关0:打开;1:关闭"`                                                                                   // 告警开关0:打开;1:关闭
+	AlarmThreshold int         `json:"alarmThreshold" orm:"alarm_threshold" description:"奖品告警阈值"`                                                                                          // 奖品告警阈值
+	Target         string      `json:"target"         orm:"target"          description:"中奖目标用户。默认空:全部用户,f:免费用户;v:超级订阅用户;m:大会员用户;e:商机管理用户"`                                                // 中奖目标用户。默认空:全部用户,f:免费用户;v:超级订阅用户;m:大会员用户;e:商机管理用户
+	DailyNum       int         `json:"dailyNum"       orm:"daily_num"       description:"每日中此奖限制数量"`                                                                                       // 每日中此奖限制数量
+	CreateTime     *gtime.Time `json:"createTime"     orm:"create_time"     description:"创建时间"`                                                                                            // 创建时间
+	UpdateTime     *gtime.Time `json:"updateTime"     orm:"update_time"     description:"更新时间"`                                                                                            // 更新时间
+}

+ 22 - 0
internal/model/entity/lottery_prize_order.go

@@ -0,0 +1,22 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// LotteryPrizeOrder is the golang structure for table lottery_prize_order.
+type LotteryPrizeOrder struct {
+	Id         int         `json:"id"         orm:"id"          description:"下单后抽奖活动关联订单信息表"`      // 下单后抽奖活动关联订单信息表
+	ActiveId   int         `json:"activeId"   orm:"active_id"   description:"关联活动id"`              // 关联活动id
+	Phone      string      `json:"phone"      orm:"phone"       description:"用户手机号"`               // 用户手机号
+	PositionId int         `json:"positionId" orm:"position_id" description:"用户职位id"`              // 用户职位id
+	MgoUserId  string      `json:"mgoUserId"  orm:"mgo_user_id" description:"用户mgo user id"`       // 用户mgo user id
+	OrderCode  string      `json:"orderCode"  orm:"order_code"  description:"关联订单表code"`           // 关联订单表code
+	State      int         `json:"state"      orm:"state"       description:"默认0:未抽奖;1:已抽奖;-1:作废"` // 默认0:未抽奖;1:已抽奖;-1:作废
+	CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:"创建时间"`                // 创建时间
+	UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:"更新时间"`                // 更新时间
+}

+ 27 - 0
internal/model/entity/lottery_user_account.go

@@ -0,0 +1,27 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// LotteryUserAccount is the golang structure for table lottery_user_account.
+type LotteryUserAccount struct {
+	Id            int         `json:"id"            orm:"id"              description:"用户中奖信息表id"`                    // 用户中奖信息表id
+	ActiveId      int         `json:"activeId"      orm:"active_id"       description:"关联活动id"`                       // 关联活动id
+	PrizeId       int         `json:"prizeId"       orm:"prize_id"        description:"关联奖品信息id"`                     // 关联奖品信息id
+	Phone         string      `json:"phone"         orm:"phone"           description:"用户手机号"`                        // 用户手机号
+	PositionId    int         `json:"positionId"    orm:"position_id"     description:"用户职位id"`                       // 用户职位id
+	MgoUserId     string      `json:"mgoUserId"     orm:"mgo_user_id"     description:"用户mgo user id"`                // 用户mgo user id
+	EquityId      int         `json:"equityId"      orm:"equity_id"       description:"第三方奖品关联奖品内容表id(equity_info表)"` // 第三方奖品关联奖品内容表id(equity_info表)
+	OrderCode     string      `json:"orderCode"     orm:"order_code"      description:"关联订单表code"`                    // 关联订单表code
+	UserAgent     string      `json:"userAgent"     orm:"user_agent"      description:"请求头信息"`                        // 请求头信息
+	Ip            string      `json:"ip"            orm:"ip"              description:"ip信息"`                         // ip信息
+	CreateTime    *gtime.Time `json:"createTime"    orm:"create_time"     description:"中奖时间"`                         // 中奖时间
+	Expires       *gtime.Time `json:"expires"       orm:"expires"         description:"到期时间"`                         // 到期时间
+	ProductInfoId int         `json:"productInfoId" orm:"product_info_id" description:"活动奖励对应的剑鱼产品id"`                // 活动奖励对应的剑鱼产品id
+	UpdateTime    *gtime.Time `json:"updateTime"    orm:"update_time"     description:"更新时间"`                         // 更新时间
+}

+ 17 - 0
internal/model/entity/prize_base_info.go

@@ -0,0 +1,17 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+// PrizeBaseInfo is the golang structure for table prize_base_info.
+type PrizeBaseInfo struct {
+	Id        int    `json:"id"        orm:"id"        description:""`                            //
+	Name      string `json:"name"      orm:"name"      description:"名称"`                          // 名称
+	Attribute int    `json:"attribute" orm:"attribute" description:"属性:0:剑鱼;1:三方会员"`              // 属性:0:剑鱼;1:三方会员
+	DrawPic   string `json:"drawPic"   orm:"draw_pic"  description:"抽奖奖品图片"`                      // 抽奖奖品图片
+	WinPic    string `json:"winPic"    orm:"win_pic"   description:"中奖奖品图片"`                      // 中奖奖品图片
+	Notes     string `json:"notes"     orm:"notes"     description:"奖品类型说明:超级订阅1个月(单省)| WPS会员月卡"` // 奖品类型说明:超级订阅1个月(单省)| WPS会员月卡
+	Url       string `json:"url"       orm:"url"       description:"奖品对应查看链接"`                    // 奖品对应查看链接
+	Label     string `json:"label"     orm:"label"     description:"标签"`                          // 标签
+}

+ 15 - 0
internal/model/entity/product_info.go

@@ -0,0 +1,15 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+// ProductInfo is the golang structure for table product_info.
+type ProductInfo struct {
+	Id    int    `json:"id"    orm:"id"    description:""`                     //
+	Name  string `json:"name"  orm:"name"  description:"名称"`                   // 名称
+	Mold  int    `json:"mold"  orm:"mold"  description:"类型:1:购买;2:续费;3:升级"`    // 类型:1:购买;2:续费;3:升级
+	State int    `json:"state" orm:"state" description:"是否可用;默认0:可用;1:不可用"`    // 是否可用;默认0:可用;1:不可用
+	Wide  int    `json:"wide"  orm:"wide"  description:"是否全国:默认0:非全国;-1:全国"`   // 是否全国:默认0:非全国;-1:全国
+	Cycle int    `json:"cycle" orm:"cycle" description:"下单周期:1:年;2:月;3:天;4:季"` // 下单周期:1:年;2:月;3:天;4:季
+}

+ 20 - 0
internal/model/entity/product_rule.go

@@ -0,0 +1,20 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+// ProductRule is the golang structure for table product_rule.
+type ProductRule struct {
+	Id            int         `json:"id"            orm:"id"              description:"赠送规则iddoc"`                    // 赠送规则iddoc
+	ActiveId      int         `json:"activeId"      orm:"active_id"       description:"活动id"`                         // 活动id
+	ProductInfoId int         `json:"productInfoId" orm:"product_info_id" description:"活动奖励对应的剑鱼产品id"`                // 活动奖励对应的剑鱼产品id
+	PrizeId       int         `json:"prizeId"       orm:"prize_id"        description:"活动奖品信息表lottery_prize_info的id"` // 活动奖品信息表lottery_prize_info的id
+	State         int         `json:"state"         orm:"state"           description:"是否可用;默认0:可用;1:不可用"`            // 是否可用;默认0:可用;1:不可用
+	Cycle         int         `json:"cycle"         orm:"cycle"           description:"可兑换周期(单位天): 90"`               // 可兑换周期(单位天): 90
+	CreateDate    *gtime.Time `json:"createDate"    orm:"create_date"     description:"创建时间"`                         // 创建时间
+}

+ 1 - 0
internal/packed/packed.go

@@ -0,0 +1 @@
+package packed

+ 0 - 0
internal/service/.gitkeep


+ 14 - 0
main.go

@@ -0,0 +1,14 @@
+package main
+
+import (
+	_ "demo/internal/packed"
+	_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
+
+	"github.com/gogf/gf/v2/os/gctx"
+
+	"demo/internal/cmd"
+)
+
+func main() {
+	cmd.Main.Run(gctx.GetInitCtx())
+}

+ 70 - 0
manifest/config/option.yaml

@@ -0,0 +1,70 @@
+activity_config: # 活动配置项  返给前端用
+  mold:
+    name: "活动模式"
+    multiple: false # 是否多选
+    option:
+      - value: 0
+        name: "购买奖励"
+      - value: 1
+        name: "剑鱼币抽奖"
+      - value: 2
+        name: "订单抽奖"
+  order_type: #订单类型
+    name: "订单类型"
+    multiple: true # 是否多选
+    option:
+      - value: "m_1"
+        name: "大会员购买"
+      - value: "v_1"
+        name: "购买超级订阅"
+      - value: "v_2"
+        name: "续费超级订阅"
+      - value: "v_3"
+        name: "升级超级订阅"
+  state:
+    name: "活动状态"
+    multiple: false # 是否多选
+    option:
+      - value: 0
+        name: "有效"
+        default: true
+      - value: 1
+        name: "已取消"
+lottery_prize_info_config: #奖品选择项
+  state:
+    name: "奖品状态"
+    multiple: false # 是否多选
+    option:
+      - value: 0
+        name: "有效"
+        default: true
+      - value: 1
+        name: "已取消"
+  mold: # 奖品  单选
+    name: "奖品状态"
+    multiple: false # 是否多选
+    option:
+      - value: 0
+        name: "购买奖励"
+      - value: 1
+        name: "剑鱼币抽奖"
+  alarm_switch:
+    name: "告警开关"
+    multiple: false # 是否多选
+    option:
+      - value: 0
+        name: "打开"
+      - value: 1
+        name: "关闭"
+  target:
+    name: "中奖目标用户"
+    multiple: true # 是否多选
+    option:
+      - value: ""
+        name: "全部"
+      - value: "f"
+        name: "免费用户"
+      - value: "m"
+        name: "大会员"
+      - value: "v"
+        name: "超级订阅"

+ 21 - 0
manifest/deploy/kustomize/base/deployment.yaml

@@ -0,0 +1,21 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: template-single
+  labels:
+    app: template-single
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: template-single
+  template:
+    metadata:
+      labels:
+        app: template-single
+    spec:
+      containers:
+        - name : main
+          image: template-single
+          imagePullPolicy: Always
+

+ 8 - 0
manifest/deploy/kustomize/base/kustomization.yaml

@@ -0,0 +1,8 @@
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+resources:
+- deployment.yaml
+- service.yaml
+
+
+

Some files were not shown because too many files changed in this diff