From b16d36d4ddd7238c358673c36ce99eb7982b5937 Mon Sep 17 00:00:00 2001 From: ZHANGZENGNING Date: Tue, 29 Apr 2025 17:54:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=95=E7=A5=A8=E7=B3=BB=E7=BB=9F=204.29?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/material_theme_project_new.xml | 4 +- api/hello/hello.go | 15 --- api/hello/v1/hello.go | 12 -- api/v1/vote/vote.go | 18 +++ go.mod | 45 +++++--- go.sum | 98 +++++++++++----- hack/config.yaml | 5 +- internal/cmd/cmd.go | 18 +-- internal/controller/hello/hello.go | 5 - internal/controller/hello/hello_new.go | 15 --- internal/controller/hello/hello_v1_hello.go | 13 --- internal/controller/vote.go | 76 +++++++++++++ internal/dao/able_sign_users.go | 27 ----- internal/dao/comment.go | 27 ----- internal/dao/comment_zan.go | 27 ----- internal/dao/experience_officer_sign.go | 27 ----- internal/dao/experience_officer_vote.go | 27 ----- internal/dao/hot_jwcode.go | 27 ----- internal/dao/hot_subject.go | 27 ----- internal/dao/hot_wish.go | 27 ----- internal/dao/internal/able_sign_users.go | 77 ------------- internal/dao/internal/comment.go | 89 --------------- internal/dao/internal/comment_zan.go | 79 ------------- internal/dao/internal/experience_officer_sign.go | 89 --------------- internal/dao/internal/experience_officer_vote.go | 89 --------------- internal/dao/internal/hot_jwcode.go | 79 ------------- internal/dao/internal/hot_subject.go | 79 ------------- internal/dao/internal/hot_wish.go | 79 ------------- internal/dao/internal/lecturers.go | 79 ------------- internal/dao/internal/manager.go | 85 -------------- internal/dao/internal/member_info.go | 89 --------------- internal/dao/internal/notice.go | 89 --------------- internal/dao/internal/product.go | 79 ------------- internal/dao/internal/subject.go | 77 ------------- internal/dao/internal/support.go | 81 -------------- .../dao/internal/transaction_lecturer_records.go | 79 ------------- internal/dao/internal/transaction_plan_files.go | 81 -------------- internal/dao/internal/vote_1_indicators.go | 79 ------------- internal/dao/internal/vote_1_records.go | 81 -------------- internal/dao/internal/vote_1_virtual_records.go | 81 -------------- internal/dao/internal/vote_indicators.go | 77 ------------- internal/dao/internal/vote_records.go | 81 -------------- internal/dao/internal/wish.go | 123 -------------------- internal/dao/internal/wish_cost.go | 85 -------------- internal/dao/internal/wish_related.go | 77 ------------- internal/dao/internal/wish_state.go | 79 ------------- internal/dao/internal/wish_translate.go | 83 -------------- internal/dao/internal/wish_zan.go | 79 ------------- internal/dao/lecturers.go | 27 ----- internal/dao/manager.go | 27 ----- internal/dao/member_info.go | 27 ----- internal/dao/notice.go | 27 ----- internal/dao/product.go | 27 ----- internal/dao/subject.go | 27 ----- internal/dao/support.go | 27 ----- internal/dao/transaction_lecturer_records.go | 27 ----- internal/dao/transaction_plan_files.go | 27 ----- internal/dao/vote_1_indicators.go | 27 ----- internal/dao/vote_1_records.go | 27 ----- internal/dao/vote_1_virtual_records.go | 27 ----- internal/dao/vote_indicators.go | 27 ----- internal/dao/vote_records.go | 27 ----- internal/dao/wish.go | 27 ----- internal/dao/wish_cost.go | 27 ----- internal/dao/wish_related.go | 27 ----- internal/dao/wish_state.go | 27 ----- internal/dao/wish_translate.go | 27 ----- internal/dao/wish_zan.go | 27 ----- internal/logic/vote.go | 124 +++++++++++++++++++++ internal/model/do/able_sign_users.go | 17 --- internal/model/do/comment.go | 23 ---- internal/model/do/comment_zan.go | 18 --- internal/model/do/experience_officer_sign.go | 24 ---- internal/model/do/experience_officer_vote.go | 24 ---- internal/model/do/hot_jwcode.go | 18 --- internal/model/do/hot_subject.go | 18 --- internal/model/do/hot_wish.go | 18 --- internal/model/do/lecturers.go | 18 --- internal/model/do/manager.go | 21 ---- internal/model/do/member_info.go | 23 ---- internal/model/do/notice.go | 23 ---- internal/model/do/product.go | 18 --- internal/model/do/subject.go | 17 --- internal/model/do/support.go | 19 ---- internal/model/do/transaction_lecturer_records.go | 18 --- internal/model/do/transaction_plan_files.go | 19 ---- internal/model/do/vote_1_indicators.go | 18 --- internal/model/do/vote_1_records.go | 20 ---- internal/model/do/vote_1_virtual_records.go | 20 ---- internal/model/do/vote_indicators.go | 17 --- internal/model/do/vote_records.go | 20 ---- internal/model/do/wish.go | 41 ------- internal/model/do/wish_cost.go | 21 ---- internal/model/do/wish_related.go | 17 --- internal/model/do/wish_state.go | 18 --- internal/model/do/wish_translate.go | 20 ---- internal/model/do/wish_zan.go | 18 --- internal/model/dto/Result.go | 80 +++++++++++++ internal/model/dto/activityDto.go | 13 +++ internal/model/dto/voteDto.go | 12 ++ internal/model/entity/able_sign_users.go | 12 -- internal/model/entity/comment.go | 18 --- internal/model/entity/comment_zan.go | 13 --- internal/model/entity/experience_officer_sign.go | 22 ---- internal/model/entity/experience_officer_vote.go | 22 ---- internal/model/entity/hot_jwcode.go | 13 --- internal/model/entity/hot_subject.go | 13 --- internal/model/entity/hot_wish.go | 13 --- internal/model/entity/lecturers.go | 13 --- internal/model/entity/manager.go | 16 --- internal/model/entity/member_info.go | 18 --- internal/model/entity/notice.go | 18 --- internal/model/entity/product.go | 13 --- internal/model/entity/subject.go | 12 -- internal/model/entity/support.go | 14 --- .../model/entity/transaction_lecturer_records.go | 13 --- internal/model/entity/transaction_plan_files.go | 14 --- internal/model/entity/vote_1_indicators.go | 13 --- internal/model/entity/vote_1_records.go | 18 --- internal/model/entity/vote_1_virtual_records.go | 18 --- internal/model/entity/vote_indicators.go | 12 -- internal/model/entity/vote_records.go | 18 --- internal/model/entity/wish.go | 39 ------- internal/model/entity/wish_cost.go | 16 --- internal/model/entity/wish_related.go | 12 -- internal/model/entity/wish_state.go | 13 --- internal/model/entity/wish_translate.go | 15 --- internal/model/entity/wish_zan.go | 13 --- internal/service/vote.go | 34 ++++++ main.go | 3 + manifest/deploy/kustomize/base/deployment.yaml | 2 +- manifest/deploy/kustomize/base/service.yaml | 2 +- .../kustomize/overlays/develop/configmap.yaml | 2 +- .../kustomize/overlays/develop/deployment.yaml | 2 +- 134 files changed, 483 insertions(+), 4205 deletions(-) delete mode 100644 api/hello/hello.go delete mode 100644 api/hello/v1/hello.go create mode 100644 api/v1/vote/vote.go delete mode 100644 internal/controller/hello/hello.go delete mode 100644 internal/controller/hello/hello_new.go delete mode 100644 internal/controller/hello/hello_v1_hello.go create mode 100644 internal/controller/vote.go delete mode 100644 internal/dao/able_sign_users.go delete mode 100644 internal/dao/comment.go delete mode 100644 internal/dao/comment_zan.go delete mode 100644 internal/dao/experience_officer_sign.go delete mode 100644 internal/dao/experience_officer_vote.go delete mode 100644 internal/dao/hot_jwcode.go delete mode 100644 internal/dao/hot_subject.go delete mode 100644 internal/dao/hot_wish.go delete mode 100644 internal/dao/internal/able_sign_users.go delete mode 100644 internal/dao/internal/comment.go delete mode 100644 internal/dao/internal/comment_zan.go delete mode 100644 internal/dao/internal/experience_officer_sign.go delete mode 100644 internal/dao/internal/experience_officer_vote.go delete mode 100644 internal/dao/internal/hot_jwcode.go delete mode 100644 internal/dao/internal/hot_subject.go delete mode 100644 internal/dao/internal/hot_wish.go delete mode 100644 internal/dao/internal/lecturers.go delete mode 100644 internal/dao/internal/manager.go delete mode 100644 internal/dao/internal/member_info.go delete mode 100644 internal/dao/internal/notice.go delete mode 100644 internal/dao/internal/product.go delete mode 100644 internal/dao/internal/subject.go delete mode 100644 internal/dao/internal/support.go delete mode 100644 internal/dao/internal/transaction_lecturer_records.go delete mode 100644 internal/dao/internal/transaction_plan_files.go delete mode 100644 internal/dao/internal/vote_1_indicators.go delete mode 100644 internal/dao/internal/vote_1_records.go delete mode 100644 internal/dao/internal/vote_1_virtual_records.go delete mode 100644 internal/dao/internal/vote_indicators.go delete mode 100644 internal/dao/internal/vote_records.go delete mode 100644 internal/dao/internal/wish.go delete mode 100644 internal/dao/internal/wish_cost.go delete mode 100644 internal/dao/internal/wish_related.go delete mode 100644 internal/dao/internal/wish_state.go delete mode 100644 internal/dao/internal/wish_translate.go delete mode 100644 internal/dao/internal/wish_zan.go delete mode 100644 internal/dao/lecturers.go delete mode 100644 internal/dao/manager.go delete mode 100644 internal/dao/member_info.go delete mode 100644 internal/dao/notice.go delete mode 100644 internal/dao/product.go delete mode 100644 internal/dao/subject.go delete mode 100644 internal/dao/support.go delete mode 100644 internal/dao/transaction_lecturer_records.go delete mode 100644 internal/dao/transaction_plan_files.go delete mode 100644 internal/dao/vote_1_indicators.go delete mode 100644 internal/dao/vote_1_records.go delete mode 100644 internal/dao/vote_1_virtual_records.go delete mode 100644 internal/dao/vote_indicators.go delete mode 100644 internal/dao/vote_records.go delete mode 100644 internal/dao/wish.go delete mode 100644 internal/dao/wish_cost.go delete mode 100644 internal/dao/wish_related.go delete mode 100644 internal/dao/wish_state.go delete mode 100644 internal/dao/wish_translate.go delete mode 100644 internal/dao/wish_zan.go create mode 100644 internal/logic/vote.go delete mode 100644 internal/model/do/able_sign_users.go delete mode 100644 internal/model/do/comment.go delete mode 100644 internal/model/do/comment_zan.go delete mode 100644 internal/model/do/experience_officer_sign.go delete mode 100644 internal/model/do/experience_officer_vote.go delete mode 100644 internal/model/do/hot_jwcode.go delete mode 100644 internal/model/do/hot_subject.go delete mode 100644 internal/model/do/hot_wish.go delete mode 100644 internal/model/do/lecturers.go delete mode 100644 internal/model/do/manager.go delete mode 100644 internal/model/do/member_info.go delete mode 100644 internal/model/do/notice.go delete mode 100644 internal/model/do/product.go delete mode 100644 internal/model/do/subject.go delete mode 100644 internal/model/do/support.go delete mode 100644 internal/model/do/transaction_lecturer_records.go delete mode 100644 internal/model/do/transaction_plan_files.go delete mode 100644 internal/model/do/vote_1_indicators.go delete mode 100644 internal/model/do/vote_1_records.go delete mode 100644 internal/model/do/vote_1_virtual_records.go delete mode 100644 internal/model/do/vote_indicators.go delete mode 100644 internal/model/do/vote_records.go delete mode 100644 internal/model/do/wish.go delete mode 100644 internal/model/do/wish_cost.go delete mode 100644 internal/model/do/wish_related.go delete mode 100644 internal/model/do/wish_state.go delete mode 100644 internal/model/do/wish_translate.go delete mode 100644 internal/model/do/wish_zan.go create mode 100644 internal/model/dto/Result.go create mode 100644 internal/model/dto/activityDto.go create mode 100644 internal/model/dto/voteDto.go delete mode 100644 internal/model/entity/able_sign_users.go delete mode 100644 internal/model/entity/comment.go delete mode 100644 internal/model/entity/comment_zan.go delete mode 100644 internal/model/entity/experience_officer_sign.go delete mode 100644 internal/model/entity/experience_officer_vote.go delete mode 100644 internal/model/entity/hot_jwcode.go delete mode 100644 internal/model/entity/hot_subject.go delete mode 100644 internal/model/entity/hot_wish.go delete mode 100644 internal/model/entity/lecturers.go delete mode 100644 internal/model/entity/manager.go delete mode 100644 internal/model/entity/member_info.go delete mode 100644 internal/model/entity/notice.go delete mode 100644 internal/model/entity/product.go delete mode 100644 internal/model/entity/subject.go delete mode 100644 internal/model/entity/support.go delete mode 100644 internal/model/entity/transaction_lecturer_records.go delete mode 100644 internal/model/entity/transaction_plan_files.go delete mode 100644 internal/model/entity/vote_1_indicators.go delete mode 100644 internal/model/entity/vote_1_records.go delete mode 100644 internal/model/entity/vote_1_virtual_records.go delete mode 100644 internal/model/entity/vote_indicators.go delete mode 100644 internal/model/entity/vote_records.go delete mode 100644 internal/model/entity/wish.go delete mode 100644 internal/model/entity/wish_cost.go delete mode 100644 internal/model/entity/wish_related.go delete mode 100644 internal/model/entity/wish_state.go delete mode 100644 internal/model/entity/wish_translate.go delete mode 100644 internal/model/entity/wish_zan.go create mode 100644 internal/service/vote.go diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml index 99437f2..2732562 100644 --- a/.idea/material_theme_project_new.xml +++ b/.idea/material_theme_project_new.xml @@ -3,7 +3,9 @@ diff --git a/api/hello/hello.go b/api/hello/hello.go deleted file mode 100644 index 3163f3b..0000000 --- a/api/hello/hello.go +++ /dev/null @@ -1,15 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package hello - -import ( - "context" - - "VoteManage_Go/api/hello/v1" -) - -type IHelloV1 interface { - Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error) -} diff --git a/api/hello/v1/hello.go b/api/hello/v1/hello.go deleted file mode 100644 index b4dd233..0000000 --- a/api/hello/v1/hello.go +++ /dev/null @@ -1,12 +0,0 @@ -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"` -} diff --git a/api/v1/vote/vote.go b/api/v1/vote/vote.go new file mode 100644 index 0000000..6f2c423 --- /dev/null +++ b/api/v1/vote/vote.go @@ -0,0 +1,18 @@ +package vote + +// 条件筛选 +type GetVoteDetailListReq struct { + PageNo int `v:"required" json:"pageNo" dc:"页码" d:"1"` + PageSize int `v:"required" json:"pageSize" dc:"页面大小" d:"10"` + ActivityId int `v:"required" json:"activityId" dc:"活动id"` + Jwcode string `json:"jwcode" dc:"查询条件中的精网号"` + Dept string `json:"dept" dc:"查询条件中的部门"` + StartDate string `json:"startDate" dc:"开始时间"` + EndDate string `json:"endDate" dc:"结束时间"` + //StartTime *gtime.Time `json:"startTime" dc:"开始时间"` + // EndTime *gtime.Time `json:"endTime" dc:"结束时间"` +} +type GetActivityListReq struct { + PageNo int `v:"required" json:"pageNo" dc:"页码" d:"1"` + PageSize int `v:"required" json:"pageSize" dc:"页面大小" d:"24"` +} diff --git a/go.mod b/go.mod index 0deeee0..8a283d3 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,45 @@ module VoteManage_Go -go 1.18 +go 1.22 -require github.com/gogf/gf/v2 v2.7.1 +toolchain go1.23.8 require ( - github.com/BurntSushi/toml v1.3.2 // indirect + github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0 + github.com/gogf/gf/v2 v2.9.0 + github.com/xuri/excelize/v2 v2.9.0 +) + +require ( + github.com/BurntSushi/toml v1.4.0 // indirect github.com/clbanning/mxj/v2 v2.7.0 // indirect - github.com/fatih/color v1.16.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.2.3 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/gorilla/websocket v1.5.1 // indirect + github.com/go-sql-driver/mysql v1.7.1 // indirect + github.com/google/uuid v1.6.0 // 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.7 // 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.9 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - go.opentelemetry.io/otel v1.14.0 // indirect - go.opentelemetry.io/otel/sdk v1.14.0 // indirect - go.opentelemetry.io/otel/trace v1.14.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + github.com/richardlehane/mscfb v1.0.4 // indirect + github.com/richardlehane/msoleps v1.0.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect + github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect + go.opentelemetry.io/otel v1.32.0 // indirect + go.opentelemetry.io/otel/metric v1.32.0 // indirect + go.opentelemetry.io/otel/sdk v1.32.0 // indirect + go.opentelemetry.io/otel/trace v1.32.0 // indirect + golang.org/x/crypto v0.30.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 ) diff --git a/go.sum b/go.sum index c1d3bdc..d8b60de 100644 --- a/go.sum +++ b/go.sum @@ -1,52 +1,94 @@ -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +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/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/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/gogf/gf/v2 v2.7.1 h1:Ukp7vzwh6VKnivEEx/xiMc61dL1HVZqCCHl//3GBRxc= -github.com/gogf/gf/v2 v2.7.1/go.mod h1:3oyGjyLHtSSo8kQ57Nj1TPdUNc0e2HS0A2J+KkXoW+I= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +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.9.0 h1:1f7EeD0lfPHoXfaJDSL7cxRcSRelbsAKgF3MGXY+Uyo= +github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0/go.mod h1:tToO1PjGkLIR+9DbJ0wrKicYma0H/EUHXOpwel6Dw+0= +github.com/gogf/gf/v2 v2.9.0 h1:semN5Q5qGjDQEv4620VzxcJzJlSD07gmyJ9Sy9zfbHk= +github.com/gogf/gf/v2 v2.9.0/go.mod h1:sWGQw+pLILtuHmbOxoe0D+0DdaXxbleT57axOLH2vKI= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +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 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= 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/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= 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/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= -go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= -go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= -go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= -go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= -go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM= +github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= +github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= +github.com/richardlehane/msoleps v1.0.4 h1:WuESlvhX3gH2IHcd8UqyCuFY5yiq/GR/yqaSM/9/g00= +github.com/richardlehane/msoleps v1.0.4/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= +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/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d h1:llb0neMWDQe87IzJLS4Ci7psK/lVsjIS2otl+1WyRyY= +github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/excelize/v2 v2.9.0 h1:1tgOaEq92IOEumR1/JfYS/eR0KHOCsRv/rYXXh6YJQE= +github.com/xuri/excelize/v2 v2.9.0/go.mod h1:uqey4QBZ9gdMeWApPLdhm9x+9o2lq4iVmjiLfBS5hdE= +github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 h1:hPVCafDV85blFTabnqKgNhDCkJX25eik94Si9cTER4A= +github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= +go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= +go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= +go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= +go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= +go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= +golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY= +golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ= +golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= +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.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +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/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/hack/config.yaml b/hack/config.yaml index abaf120..e6063c4 100644 --- a/hack/config.yaml +++ b/hack/config.yaml @@ -6,7 +6,10 @@ gfcli: dao: - link: "mysql:shequ:7bMDPChJSdLMAwNR@tcp(121.89.234.155:3306)/shequ" descriptionTag: true - + tables: "member_info,vote_records" + - link: "mysql:live:p4jMAMShNM8HTrbX@tcp(39.101.133.168:3306)/live" + descriptionTag: true + tables: "float_window" docker: build: "-a amd64 -s linux -p temp -ew" tagPrefixes: diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index 6f883cc..1d73af8 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -1,15 +1,19 @@ package cmd import ( + "VoteManage_Go/internal/controller" "context" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/net/ghttp" "github.com/gogf/gf/v2/os/gcmd" - - "VoteManage_Go/internal/controller/hello" ) +func MiddlewareCORS(r *ghttp.Request) { + r.Response.CORSDefault() + r.Middleware.Next() +} + var ( Main = gcmd.Command{ Name: "main", @@ -17,11 +21,11 @@ var ( Brief: "start http server", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { s := g.Server() - s.Group("/", func(group *ghttp.RouterGroup) { - group.Middleware(ghttp.MiddlewareHandlerResponse) - group.Bind( - hello.NewV1(), - ) + s.Group("/api", func(group *ghttp.RouterGroup) { + group.Middleware(MiddlewareCORS) + group.POST("/vote", controller.Vote().GetVoteDetailList) + group.POST("/export", controller.Vote().ExportVote) + group.POST("/activity", controller.Vote().GetActivityList) }) s.Run() return nil diff --git a/internal/controller/hello/hello.go b/internal/controller/hello/hello.go deleted file mode 100644 index f72082f..0000000 --- a/internal/controller/hello/hello.go +++ /dev/null @@ -1,5 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package hello diff --git a/internal/controller/hello/hello_new.go b/internal/controller/hello/hello_new.go deleted file mode 100644 index 94d2945..0000000 --- a/internal/controller/hello/hello_new.go +++ /dev/null @@ -1,15 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package hello - -import ( - "VoteManage_Go/api/hello" -) - -type ControllerV1 struct{} - -func NewV1() hello.IHelloV1 { - return &ControllerV1{} -} diff --git a/internal/controller/hello/hello_v1_hello.go b/internal/controller/hello/hello_v1_hello.go deleted file mode 100644 index 704489c..0000000 --- a/internal/controller/hello/hello_v1_hello.go +++ /dev/null @@ -1,13 +0,0 @@ -package hello - -import ( - "context" - "github.com/gogf/gf/v2/frame/g" - - "VoteManage_Go/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 -} diff --git a/internal/controller/vote.go b/internal/controller/vote.go new file mode 100644 index 0000000..f697ef3 --- /dev/null +++ b/internal/controller/vote.go @@ -0,0 +1,76 @@ +package controller + +import ( + "VoteManage_Go/api/v1/vote" + "VoteManage_Go/internal/model/dto" + "VoteManage_Go/internal/service" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" +) + +type cVote struct{} + +func Vote() *cVote { + return &cVote{} +} +func (c cVote) GetVoteDetailList(r *ghttp.Request) { + var req *vote.GetVoteDetailListReq + if err := r.Parse(&req); err != nil { + r.Response.WriteJsonExit(dto.Result{ + Code: 400, + Message: err.Error(), + }) + } + res, total, err := service.Vote().GetVoteByCondition(r.Context(), req) + + if err != nil { + r.Response.WriteJsonExit(dto.Result{ + Code: 400, + Message: err.Error(), + }) + } + r.Response.WriteJsonExit(dto.Result{ + Code: 200, + Message: "success", + Data: g.Map{ + "list": res, + "total": total, + }, + }) +} +func (c *cVote) ExportVote(r *ghttp.Request) { + var req *vote.GetVoteDetailListReq + // 解析请求参数 + if err := r.Parse(&req); err != nil { + r.Response.WriteJsonExit(dto.Error(err.Error())) + } + + //查询数据,创建excel文件,设置表头,写入数据,设置文件名,保存到缓冲区并返回,设置响应头,指定内容类型为excel文件,指定文件名为fileName,将buffer中的内容写入响应 + service.Vote().ExportVote(r, req) +} + +func (c *cVote) GetActivityList(r *ghttp.Request) { + var req *vote.GetActivityListReq + if err := r.Parse(&req); err != nil { + r.Response.WriteJsonExit(dto.Result{ + Code: 400, + Message: err.Error(), + }) + } + res, total, err := service.Vote().GetActivityList(r.Context(), req) + + if err != nil { + r.Response.WriteJsonExit(dto.Result{ + Code: 400, + Message: err.Error(), + }) + } + r.Response.WriteJsonExit(dto.Result{ + Code: 200, + Message: "success", + Data: g.Map{ + "list": res, + "total": total, + }, + }) +} diff --git a/internal/dao/able_sign_users.go b/internal/dao/able_sign_users.go deleted file mode 100644 index b6b0334..0000000 --- a/internal/dao/able_sign_users.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalAbleSignUsersDao is internal type for wrapping internal DAO implements. -type internalAbleSignUsersDao = *internal.AbleSignUsersDao - -// ableSignUsersDao is the data access object for table able_sign_users. -// You can define custom methods on it to extend its functionality as you wish. -type ableSignUsersDao struct { - internalAbleSignUsersDao -} - -var ( - // AbleSignUsers is globally public accessible object for table able_sign_users operations. - AbleSignUsers = ableSignUsersDao{ - internal.NewAbleSignUsersDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/comment.go b/internal/dao/comment.go deleted file mode 100644 index 6788ef2..0000000 --- a/internal/dao/comment.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalCommentDao is internal type for wrapping internal DAO implements. -type internalCommentDao = *internal.CommentDao - -// commentDao is the data access object for table comment. -// You can define custom methods on it to extend its functionality as you wish. -type commentDao struct { - internalCommentDao -} - -var ( - // Comment is globally public accessible object for table comment operations. - Comment = commentDao{ - internal.NewCommentDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/comment_zan.go b/internal/dao/comment_zan.go deleted file mode 100644 index b1abea5..0000000 --- a/internal/dao/comment_zan.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalCommentZanDao is internal type for wrapping internal DAO implements. -type internalCommentZanDao = *internal.CommentZanDao - -// commentZanDao is the data access object for table comment_zan. -// You can define custom methods on it to extend its functionality as you wish. -type commentZanDao struct { - internalCommentZanDao -} - -var ( - // CommentZan is globally public accessible object for table comment_zan operations. - CommentZan = commentZanDao{ - internal.NewCommentZanDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/experience_officer_sign.go b/internal/dao/experience_officer_sign.go deleted file mode 100644 index 0ed5bed..0000000 --- a/internal/dao/experience_officer_sign.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalExperienceOfficerSignDao is internal type for wrapping internal DAO implements. -type internalExperienceOfficerSignDao = *internal.ExperienceOfficerSignDao - -// experienceOfficerSignDao is the data access object for table experience_officer_sign. -// You can define custom methods on it to extend its functionality as you wish. -type experienceOfficerSignDao struct { - internalExperienceOfficerSignDao -} - -var ( - // ExperienceOfficerSign is globally public accessible object for table experience_officer_sign operations. - ExperienceOfficerSign = experienceOfficerSignDao{ - internal.NewExperienceOfficerSignDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/experience_officer_vote.go b/internal/dao/experience_officer_vote.go deleted file mode 100644 index 5fc1748..0000000 --- a/internal/dao/experience_officer_vote.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalExperienceOfficerVoteDao is internal type for wrapping internal DAO implements. -type internalExperienceOfficerVoteDao = *internal.ExperienceOfficerVoteDao - -// experienceOfficerVoteDao is the data access object for table experience_officer_vote. -// You can define custom methods on it to extend its functionality as you wish. -type experienceOfficerVoteDao struct { - internalExperienceOfficerVoteDao -} - -var ( - // ExperienceOfficerVote is globally public accessible object for table experience_officer_vote operations. - ExperienceOfficerVote = experienceOfficerVoteDao{ - internal.NewExperienceOfficerVoteDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/hot_jwcode.go b/internal/dao/hot_jwcode.go deleted file mode 100644 index 6b1e5f3..0000000 --- a/internal/dao/hot_jwcode.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalHotJwcodeDao is internal type for wrapping internal DAO implements. -type internalHotJwcodeDao = *internal.HotJwcodeDao - -// hotJwcodeDao is the data access object for table hot_jwcode. -// You can define custom methods on it to extend its functionality as you wish. -type hotJwcodeDao struct { - internalHotJwcodeDao -} - -var ( - // HotJwcode is globally public accessible object for table hot_jwcode operations. - HotJwcode = hotJwcodeDao{ - internal.NewHotJwcodeDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/hot_subject.go b/internal/dao/hot_subject.go deleted file mode 100644 index 981c353..0000000 --- a/internal/dao/hot_subject.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalHotSubjectDao is internal type for wrapping internal DAO implements. -type internalHotSubjectDao = *internal.HotSubjectDao - -// hotSubjectDao is the data access object for table hot_subject. -// You can define custom methods on it to extend its functionality as you wish. -type hotSubjectDao struct { - internalHotSubjectDao -} - -var ( - // HotSubject is globally public accessible object for table hot_subject operations. - HotSubject = hotSubjectDao{ - internal.NewHotSubjectDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/hot_wish.go b/internal/dao/hot_wish.go deleted file mode 100644 index 4f50282..0000000 --- a/internal/dao/hot_wish.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalHotWishDao is internal type for wrapping internal DAO implements. -type internalHotWishDao = *internal.HotWishDao - -// hotWishDao is the data access object for table hot_wish. -// You can define custom methods on it to extend its functionality as you wish. -type hotWishDao struct { - internalHotWishDao -} - -var ( - // HotWish is globally public accessible object for table hot_wish operations. - HotWish = hotWishDao{ - internal.NewHotWishDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/internal/able_sign_users.go b/internal/dao/internal/able_sign_users.go deleted file mode 100644 index 5c439f7..0000000 --- a/internal/dao/internal/able_sign_users.go +++ /dev/null @@ -1,77 +0,0 @@ -// ========================================================================== -// 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" -) - -// AbleSignUsersDao is the data access object for table able_sign_users. -type AbleSignUsersDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns AbleSignUsersColumns // columns contains all the column names of Table for convenient usage. -} - -// AbleSignUsersColumns defines and stores column names for table able_sign_users. -type AbleSignUsersColumns struct { - Id string // - Jwcode string // - Type string // 1 博股会员 2 信息费5年 3 购买三个指标 -} - -// ableSignUsersColumns holds the columns for table able_sign_users. -var ableSignUsersColumns = AbleSignUsersColumns{ - Id: "id", - Jwcode: "jwcode", - Type: "type", -} - -// NewAbleSignUsersDao creates and returns a new DAO object for table data access. -func NewAbleSignUsersDao() *AbleSignUsersDao { - return &AbleSignUsersDao{ - group: "default", - table: "able_sign_users", - columns: ableSignUsersColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *AbleSignUsersDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *AbleSignUsersDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *AbleSignUsersDao) Columns() AbleSignUsersColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *AbleSignUsersDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *AbleSignUsersDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *AbleSignUsersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/comment.go b/internal/dao/internal/comment.go deleted file mode 100644 index 5d18fd9..0000000 --- a/internal/dao/internal/comment.go +++ /dev/null @@ -1,89 +0,0 @@ -// ========================================================================== -// 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" -) - -// CommentDao is the data access object for table comment. -type CommentDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns CommentColumns // columns contains all the column names of Table for convenient usage. -} - -// CommentColumns defines and stores column names for table comment. -type CommentColumns struct { - Id string // - WishId string // 心愿ID - Jwcode string // 评论人code - Content string // 评论内容 - Image string // 图片,多张图片用json格式保存 - ReplyNum string // 回复数 - Pid string // 父级评论ID - Delete string // 0正常1删除 - CreatedAt string // 评论时间 -} - -// commentColumns holds the columns for table comment. -var commentColumns = CommentColumns{ - Id: "id", - WishId: "wish_id", - Jwcode: "jwcode", - Content: "content", - Image: "image", - ReplyNum: "reply_num", - Pid: "pid", - Delete: "delete", - CreatedAt: "created_at", -} - -// NewCommentDao creates and returns a new DAO object for table data access. -func NewCommentDao() *CommentDao { - return &CommentDao{ - group: "default", - table: "comment", - columns: commentColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *CommentDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *CommentDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *CommentDao) Columns() CommentColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *CommentDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *CommentDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *CommentDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/comment_zan.go b/internal/dao/internal/comment_zan.go deleted file mode 100644 index 47c6f7c..0000000 --- a/internal/dao/internal/comment_zan.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// CommentZanDao is the data access object for table comment_zan. -type CommentZanDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns CommentZanColumns // columns contains all the column names of Table for convenient usage. -} - -// CommentZanColumns defines and stores column names for table comment_zan. -type CommentZanColumns struct { - Id string // - Jwcode string // - CommentId string // - CreatedAt string // -} - -// commentZanColumns holds the columns for table comment_zan. -var commentZanColumns = CommentZanColumns{ - Id: "id", - Jwcode: "jwcode", - CommentId: "comment_id", - CreatedAt: "created_at", -} - -// NewCommentZanDao creates and returns a new DAO object for table data access. -func NewCommentZanDao() *CommentZanDao { - return &CommentZanDao{ - group: "default", - table: "comment_zan", - columns: commentZanColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *CommentZanDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *CommentZanDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *CommentZanDao) Columns() CommentZanColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *CommentZanDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *CommentZanDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *CommentZanDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/experience_officer_sign.go b/internal/dao/internal/experience_officer_sign.go deleted file mode 100644 index 902227f..0000000 --- a/internal/dao/internal/experience_officer_sign.go +++ /dev/null @@ -1,89 +0,0 @@ -// ========================================================================== -// 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" -) - -// ExperienceOfficerSignDao is the data access object for table experience_officer_sign. -type ExperienceOfficerSignDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns ExperienceOfficerSignColumns // columns contains all the column names of Table for convenient usage. -} - -// ExperienceOfficerSignColumns defines and stores column names for table experience_officer_sign. -type ExperienceOfficerSignColumns struct { - Id string // - Jwcode string // - Time string // - State string // 1 报名用户 - Location string // 1 新加坡 2 马来 3 香港 4 美股 5 A股 - Identity string // 1 博股会员 2 金卡会员 - ReservationCode string // - Seat string // - Date string // -} - -// experienceOfficerSignColumns holds the columns for table experience_officer_sign. -var experienceOfficerSignColumns = ExperienceOfficerSignColumns{ - Id: "id", - Jwcode: "jwcode", - Time: "time", - State: "state", - Location: "location", - Identity: "identity", - ReservationCode: "reservation_code", - Seat: "seat", - Date: "date", -} - -// NewExperienceOfficerSignDao creates and returns a new DAO object for table data access. -func NewExperienceOfficerSignDao() *ExperienceOfficerSignDao { - return &ExperienceOfficerSignDao{ - group: "default", - table: "experience_officer_sign", - columns: experienceOfficerSignColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *ExperienceOfficerSignDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *ExperienceOfficerSignDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *ExperienceOfficerSignDao) Columns() ExperienceOfficerSignColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *ExperienceOfficerSignDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *ExperienceOfficerSignDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *ExperienceOfficerSignDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/experience_officer_vote.go b/internal/dao/internal/experience_officer_vote.go deleted file mode 100644 index aac0894..0000000 --- a/internal/dao/internal/experience_officer_vote.go +++ /dev/null @@ -1,89 +0,0 @@ -// ========================================================================== -// 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" -) - -// ExperienceOfficerVoteDao is the data access object for table experience_officer_vote. -type ExperienceOfficerVoteDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns ExperienceOfficerVoteColumns // columns contains all the column names of Table for convenient usage. -} - -// ExperienceOfficerVoteColumns defines and stores column names for table experience_officer_vote. -type ExperienceOfficerVoteColumns struct { - Id string // - Jwcode string // - Time string // - State string // 1 报名用户 - Location string // 1 新加坡 2 马来 3 香港 4 美股 5 A股 - Identity string // 1 博股会员 2 金卡会员 - ReservationCode string // - Seat string // - Date string // -} - -// experienceOfficerVoteColumns holds the columns for table experience_officer_vote. -var experienceOfficerVoteColumns = ExperienceOfficerVoteColumns{ - Id: "id", - Jwcode: "jwcode", - Time: "time", - State: "state", - Location: "location", - Identity: "identity", - ReservationCode: "reservation_code", - Seat: "seat", - Date: "date", -} - -// NewExperienceOfficerVoteDao creates and returns a new DAO object for table data access. -func NewExperienceOfficerVoteDao() *ExperienceOfficerVoteDao { - return &ExperienceOfficerVoteDao{ - group: "default", - table: "experience_officer_vote", - columns: experienceOfficerVoteColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *ExperienceOfficerVoteDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *ExperienceOfficerVoteDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *ExperienceOfficerVoteDao) Columns() ExperienceOfficerVoteColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *ExperienceOfficerVoteDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *ExperienceOfficerVoteDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *ExperienceOfficerVoteDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/hot_jwcode.go b/internal/dao/internal/hot_jwcode.go deleted file mode 100644 index 2d73cc2..0000000 --- a/internal/dao/internal/hot_jwcode.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// HotJwcodeDao is the data access object for table hot_jwcode. -type HotJwcodeDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns HotJwcodeColumns // columns contains all the column names of Table for convenient usage. -} - -// HotJwcodeColumns defines and stores column names for table hot_jwcode. -type HotJwcodeColumns struct { - Id string // - Jwcode string // 精网号 - Hot string // 热度值 - UpdatedAt string // -} - -// hotJwcodeColumns holds the columns for table hot_jwcode. -var hotJwcodeColumns = HotJwcodeColumns{ - Id: "id", - Jwcode: "jwcode", - Hot: "hot", - UpdatedAt: "updated_at", -} - -// NewHotJwcodeDao creates and returns a new DAO object for table data access. -func NewHotJwcodeDao() *HotJwcodeDao { - return &HotJwcodeDao{ - group: "default", - table: "hot_jwcode", - columns: hotJwcodeColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *HotJwcodeDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *HotJwcodeDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *HotJwcodeDao) Columns() HotJwcodeColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *HotJwcodeDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *HotJwcodeDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *HotJwcodeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/hot_subject.go b/internal/dao/internal/hot_subject.go deleted file mode 100644 index 1bb81a9..0000000 --- a/internal/dao/internal/hot_subject.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// HotSubjectDao is the data access object for table hot_subject. -type HotSubjectDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns HotSubjectColumns // columns contains all the column names of Table for convenient usage. -} - -// HotSubjectColumns defines and stores column names for table hot_subject. -type HotSubjectColumns struct { - Id string // - SubjectId string // 话题ID - Hot string // 热度值 - UpdatedAt string // -} - -// hotSubjectColumns holds the columns for table hot_subject. -var hotSubjectColumns = HotSubjectColumns{ - Id: "id", - SubjectId: "subject_id", - Hot: "hot", - UpdatedAt: "updated_at", -} - -// NewHotSubjectDao creates and returns a new DAO object for table data access. -func NewHotSubjectDao() *HotSubjectDao { - return &HotSubjectDao{ - group: "default", - table: "hot_subject", - columns: hotSubjectColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *HotSubjectDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *HotSubjectDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *HotSubjectDao) Columns() HotSubjectColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *HotSubjectDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *HotSubjectDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *HotSubjectDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/hot_wish.go b/internal/dao/internal/hot_wish.go deleted file mode 100644 index 6caeade..0000000 --- a/internal/dao/internal/hot_wish.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// HotWishDao is the data access object for table hot_wish. -type HotWishDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns HotWishColumns // columns contains all the column names of Table for convenient usage. -} - -// HotWishColumns defines and stores column names for table hot_wish. -type HotWishColumns struct { - Id string // - WishId string // 心愿ID - Hot string // 热度值 - UpdatedAt string // -} - -// hotWishColumns holds the columns for table hot_wish. -var hotWishColumns = HotWishColumns{ - Id: "id", - WishId: "wish_id", - Hot: "hot", - UpdatedAt: "updated_at", -} - -// NewHotWishDao creates and returns a new DAO object for table data access. -func NewHotWishDao() *HotWishDao { - return &HotWishDao{ - group: "default", - table: "hot_wish", - columns: hotWishColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *HotWishDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *HotWishDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *HotWishDao) Columns() HotWishColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *HotWishDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *HotWishDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *HotWishDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/lecturers.go b/internal/dao/internal/lecturers.go deleted file mode 100644 index f9f2753..0000000 --- a/internal/dao/internal/lecturers.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// LecturersDao is the data access object for table lecturers. -type LecturersDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns LecturersColumns // columns contains all the column names of Table for convenient usage. -} - -// LecturersColumns defines and stores column names for table lecturers. -type LecturersColumns struct { - Id string // - Jwcode string // - Avatar string // - Name string // -} - -// lecturersColumns holds the columns for table lecturers. -var lecturersColumns = LecturersColumns{ - Id: "id", - Jwcode: "jwcode", - Avatar: "avatar", - Name: "name", -} - -// NewLecturersDao creates and returns a new DAO object for table data access. -func NewLecturersDao() *LecturersDao { - return &LecturersDao{ - group: "default", - table: "lecturers", - columns: lecturersColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *LecturersDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *LecturersDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *LecturersDao) Columns() LecturersColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *LecturersDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *LecturersDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *LecturersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/manager.go b/internal/dao/internal/manager.go deleted file mode 100644 index 51808e6..0000000 --- a/internal/dao/internal/manager.go +++ /dev/null @@ -1,85 +0,0 @@ -// ========================================================================== -// 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" -) - -// ManagerDao is the data access object for table manager. -type ManagerDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns ManagerColumns // columns contains all the column names of Table for convenient usage. -} - -// ManagerColumns defines and stores column names for table manager. -type ManagerColumns struct { - Id string // - Jwcode string // - Name string // - Type string // 产品ID - LanguageKey string // - Enabled string // - CreatedAt string // -} - -// managerColumns holds the columns for table manager. -var managerColumns = ManagerColumns{ - Id: "id", - Jwcode: "jwcode", - Name: "name", - Type: "type", - LanguageKey: "language_key", - Enabled: "enabled", - CreatedAt: "created_at", -} - -// NewManagerDao creates and returns a new DAO object for table data access. -func NewManagerDao() *ManagerDao { - return &ManagerDao{ - group: "default", - table: "manager", - columns: managerColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *ManagerDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *ManagerDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *ManagerDao) Columns() ManagerColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *ManagerDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *ManagerDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *ManagerDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/member_info.go b/internal/dao/internal/member_info.go deleted file mode 100644 index 17d0d1a..0000000 --- a/internal/dao/internal/member_info.go +++ /dev/null @@ -1,89 +0,0 @@ -// ========================================================================== -// 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" -) - -// MemberInfoDao is the data access object for table member_info. -type MemberInfoDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns MemberInfoColumns // columns contains all the column names of Table for convenient usage. -} - -// MemberInfoColumns defines and stores column names for table member_info. -type MemberInfoColumns struct { - Id string // - Jwcode string // - Nickname string // - Img string // - Medal string // 体验官勋章url - LocMarket string // - Dept string // - Shop string // - BoguMember string // 1:博股会员,0:不是 -} - -// memberInfoColumns holds the columns for table member_info. -var memberInfoColumns = MemberInfoColumns{ - Id: "id", - Jwcode: "jwcode", - Nickname: "nickname", - Img: "img", - Medal: "medal", - LocMarket: "loc_market", - Dept: "dept", - Shop: "shop", - BoguMember: "bogu_member", -} - -// NewMemberInfoDao creates and returns a new DAO object for table data access. -func NewMemberInfoDao() *MemberInfoDao { - return &MemberInfoDao{ - group: "default", - table: "member_info", - columns: memberInfoColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *MemberInfoDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *MemberInfoDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *MemberInfoDao) Columns() MemberInfoColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *MemberInfoDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *MemberInfoDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *MemberInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/notice.go b/internal/dao/internal/notice.go deleted file mode 100644 index e800354..0000000 --- a/internal/dao/internal/notice.go +++ /dev/null @@ -1,89 +0,0 @@ -// ========================================================================== -// 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" -) - -// NoticeDao is the data access object for table notice. -type NoticeDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns NoticeColumns // columns contains all the column names of Table for convenient usage. -} - -// NoticeColumns defines and stores column names for table notice. -type NoticeColumns struct { - Id string // - Type string // 1进度修改2评论3点赞 - WishId string // 心愿ID - CommentId string // - Jwcode string // 操作人 - NoticeJwcode string // 通知人 - State string // 0新通知1已看 - WishState string // 把心愿改成的状态 - CreatedAt string // -} - -// noticeColumns holds the columns for table notice. -var noticeColumns = NoticeColumns{ - Id: "id", - Type: "type", - WishId: "wish_id", - CommentId: "comment_id", - Jwcode: "jwcode", - NoticeJwcode: "notice_jwcode", - State: "state", - WishState: "wish_state", - CreatedAt: "created_at", -} - -// NewNoticeDao creates and returns a new DAO object for table data access. -func NewNoticeDao() *NoticeDao { - return &NoticeDao{ - group: "default", - table: "notice", - columns: noticeColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *NoticeDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *NoticeDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *NoticeDao) Columns() NoticeColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *NoticeDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *NoticeDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *NoticeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/product.go b/internal/dao/internal/product.go deleted file mode 100644 index dcb90b9..0000000 --- a/internal/dao/internal/product.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// ProductDao is the data access object for table product. -type ProductDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns ProductColumns // columns contains all the column names of Table for convenient usage. -} - -// ProductColumns defines and stores column names for table product. -type ProductColumns struct { - Id string // - Name string // - Enabled string // - ZhCN string // -} - -// productColumns holds the columns for table product. -var productColumns = ProductColumns{ - Id: "id", - Name: "name", - Enabled: "enabled", - ZhCN: "zh_CN", -} - -// NewProductDao creates and returns a new DAO object for table data access. -func NewProductDao() *ProductDao { - return &ProductDao{ - group: "default", - table: "product", - columns: productColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *ProductDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *ProductDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *ProductDao) Columns() ProductColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *ProductDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *ProductDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *ProductDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/subject.go b/internal/dao/internal/subject.go deleted file mode 100644 index 8c94b2b..0000000 --- a/internal/dao/internal/subject.go +++ /dev/null @@ -1,77 +0,0 @@ -// ========================================================================== -// 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" -) - -// SubjectDao is the data access object for table subject. -type SubjectDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns SubjectColumns // columns contains all the column names of Table for convenient usage. -} - -// SubjectColumns defines and stores column names for table subject. -type SubjectColumns struct { - Id string // - Type string // - Content string // -} - -// subjectColumns holds the columns for table subject. -var subjectColumns = SubjectColumns{ - Id: "id", - Type: "type", - Content: "content", -} - -// NewSubjectDao creates and returns a new DAO object for table data access. -func NewSubjectDao() *SubjectDao { - return &SubjectDao{ - group: "default", - table: "subject", - columns: subjectColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *SubjectDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *SubjectDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *SubjectDao) Columns() SubjectColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *SubjectDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *SubjectDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *SubjectDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/support.go b/internal/dao/internal/support.go deleted file mode 100644 index 0bbb791..0000000 --- a/internal/dao/internal/support.go +++ /dev/null @@ -1,81 +0,0 @@ -// ========================================================================== -// 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" -) - -// SupportDao is the data access object for table support. -type SupportDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns SupportColumns // columns contains all the column names of Table for convenient usage. -} - -// SupportColumns defines and stores column names for table support. -type SupportColumns struct { - Id string // - Jwcode string // 用户标识 - WishId string // 心愿ID - Type string // 1支持2反对 - CreatedAt string // 时间 -} - -// supportColumns holds the columns for table support. -var supportColumns = SupportColumns{ - Id: "id", - Jwcode: "jwcode", - WishId: "wish_id", - Type: "type", - CreatedAt: "created_at", -} - -// NewSupportDao creates and returns a new DAO object for table data access. -func NewSupportDao() *SupportDao { - return &SupportDao{ - group: "default", - table: "support", - columns: supportColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *SupportDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *SupportDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *SupportDao) Columns() SupportColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *SupportDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *SupportDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *SupportDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/transaction_lecturer_records.go b/internal/dao/internal/transaction_lecturer_records.go deleted file mode 100644 index 0ddb9d1..0000000 --- a/internal/dao/internal/transaction_lecturer_records.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// TransactionLecturerRecordsDao is the data access object for table transaction_lecturer_records. -type TransactionLecturerRecordsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns TransactionLecturerRecordsColumns // columns contains all the column names of Table for convenient usage. -} - -// TransactionLecturerRecordsColumns defines and stores column names for table transaction_lecturer_records. -type TransactionLecturerRecordsColumns struct { - Id string // - Jwcode string // - LecturerJwcode string // - Time string // -} - -// transactionLecturerRecordsColumns holds the columns for table transaction_lecturer_records. -var transactionLecturerRecordsColumns = TransactionLecturerRecordsColumns{ - Id: "id", - Jwcode: "jwcode", - LecturerJwcode: "lecturer_jwcode", - Time: "time", -} - -// NewTransactionLecturerRecordsDao creates and returns a new DAO object for table data access. -func NewTransactionLecturerRecordsDao() *TransactionLecturerRecordsDao { - return &TransactionLecturerRecordsDao{ - group: "default", - table: "transaction_lecturer_records", - columns: transactionLecturerRecordsColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *TransactionLecturerRecordsDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *TransactionLecturerRecordsDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *TransactionLecturerRecordsDao) Columns() TransactionLecturerRecordsColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *TransactionLecturerRecordsDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *TransactionLecturerRecordsDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *TransactionLecturerRecordsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/transaction_plan_files.go b/internal/dao/internal/transaction_plan_files.go deleted file mode 100644 index 4e163b9..0000000 --- a/internal/dao/internal/transaction_plan_files.go +++ /dev/null @@ -1,81 +0,0 @@ -// ========================================================================== -// 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" -) - -// TransactionPlanFilesDao is the data access object for table transaction_plan_files. -type TransactionPlanFilesDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns TransactionPlanFilesColumns // columns contains all the column names of Table for convenient usage. -} - -// TransactionPlanFilesColumns defines and stores column names for table transaction_plan_files. -type TransactionPlanFilesColumns struct { - Id string // - Jwcode string // - Content string // - Time string // 提交时间 - EncryptionId string // -} - -// transactionPlanFilesColumns holds the columns for table transaction_plan_files. -var transactionPlanFilesColumns = TransactionPlanFilesColumns{ - Id: "id", - Jwcode: "jwcode", - Content: "content", - Time: "time", - EncryptionId: "encryption_id", -} - -// NewTransactionPlanFilesDao creates and returns a new DAO object for table data access. -func NewTransactionPlanFilesDao() *TransactionPlanFilesDao { - return &TransactionPlanFilesDao{ - group: "default", - table: "transaction_plan_files", - columns: transactionPlanFilesColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *TransactionPlanFilesDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *TransactionPlanFilesDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *TransactionPlanFilesDao) Columns() TransactionPlanFilesColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *TransactionPlanFilesDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *TransactionPlanFilesDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *TransactionPlanFilesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/vote_1_indicators.go b/internal/dao/internal/vote_1_indicators.go deleted file mode 100644 index 2c5c880..0000000 --- a/internal/dao/internal/vote_1_indicators.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// Vote1IndicatorsDao is the data access object for table vote1_indicators. -type Vote1IndicatorsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns Vote1IndicatorsColumns // columns contains all the column names of Table for convenient usage. -} - -// Vote1IndicatorsColumns defines and stores column names for table vote1_indicators. -type Vote1IndicatorsColumns struct { - Id string // - Title string // - Description string // - Img string // -} - -// vote1IndicatorsColumns holds the columns for table vote1_indicators. -var vote1IndicatorsColumns = Vote1IndicatorsColumns{ - Id: "id", - Title: "title", - Description: "description", - Img: "img", -} - -// NewVote1IndicatorsDao creates and returns a new DAO object for table data access. -func NewVote1IndicatorsDao() *Vote1IndicatorsDao { - return &Vote1IndicatorsDao{ - group: "default", - table: "vote1_indicators", - columns: vote1IndicatorsColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *Vote1IndicatorsDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *Vote1IndicatorsDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *Vote1IndicatorsDao) Columns() Vote1IndicatorsColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *Vote1IndicatorsDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *Vote1IndicatorsDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *Vote1IndicatorsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/vote_1_records.go b/internal/dao/internal/vote_1_records.go deleted file mode 100644 index f69df60..0000000 --- a/internal/dao/internal/vote_1_records.go +++ /dev/null @@ -1,81 +0,0 @@ -// ========================================================================== -// 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" -) - -// Vote1RecordsDao is the data access object for table vote1_records. -type Vote1RecordsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns Vote1RecordsColumns // columns contains all the column names of Table for convenient usage. -} - -// Vote1RecordsColumns defines and stores column names for table vote1_records. -type Vote1RecordsColumns struct { - Id string // - Jwcode string // - VId string // - VoteDate string // - Time string // -} - -// vote1RecordsColumns holds the columns for table vote1_records. -var vote1RecordsColumns = Vote1RecordsColumns{ - Id: "id", - Jwcode: "jwcode", - VId: "v_id", - VoteDate: "vote_date", - Time: "time", -} - -// NewVote1RecordsDao creates and returns a new DAO object for table data access. -func NewVote1RecordsDao() *Vote1RecordsDao { - return &Vote1RecordsDao{ - group: "default", - table: "vote1_records", - columns: vote1RecordsColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *Vote1RecordsDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *Vote1RecordsDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *Vote1RecordsDao) Columns() Vote1RecordsColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *Vote1RecordsDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *Vote1RecordsDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *Vote1RecordsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/vote_1_virtual_records.go b/internal/dao/internal/vote_1_virtual_records.go deleted file mode 100644 index e0d47dd..0000000 --- a/internal/dao/internal/vote_1_virtual_records.go +++ /dev/null @@ -1,81 +0,0 @@ -// ========================================================================== -// 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" -) - -// Vote1VirtualRecordsDao is the data access object for table vote1_virtual_records. -type Vote1VirtualRecordsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns Vote1VirtualRecordsColumns // columns contains all the column names of Table for convenient usage. -} - -// Vote1VirtualRecordsColumns defines and stores column names for table vote1_virtual_records. -type Vote1VirtualRecordsColumns struct { - Id string // - VId string // - Votes string // - VoteDate string // - Time string // -} - -// vote1VirtualRecordsColumns holds the columns for table vote1_virtual_records. -var vote1VirtualRecordsColumns = Vote1VirtualRecordsColumns{ - Id: "id", - VId: "v_id", - Votes: "votes", - VoteDate: "vote_date", - Time: "time", -} - -// NewVote1VirtualRecordsDao creates and returns a new DAO object for table data access. -func NewVote1VirtualRecordsDao() *Vote1VirtualRecordsDao { - return &Vote1VirtualRecordsDao{ - group: "default", - table: "vote1_virtual_records", - columns: vote1VirtualRecordsColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *Vote1VirtualRecordsDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *Vote1VirtualRecordsDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *Vote1VirtualRecordsDao) Columns() Vote1VirtualRecordsColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *Vote1VirtualRecordsDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *Vote1VirtualRecordsDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *Vote1VirtualRecordsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/vote_indicators.go b/internal/dao/internal/vote_indicators.go deleted file mode 100644 index ba42ecd..0000000 --- a/internal/dao/internal/vote_indicators.go +++ /dev/null @@ -1,77 +0,0 @@ -// ========================================================================== -// 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" -) - -// VoteIndicatorsDao is the data access object for table vote_indicators. -type VoteIndicatorsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns VoteIndicatorsColumns // columns contains all the column names of Table for convenient usage. -} - -// VoteIndicatorsColumns defines and stores column names for table vote_indicators. -type VoteIndicatorsColumns struct { - Id string // - Title string // - Num string // 选择人数 -} - -// voteIndicatorsColumns holds the columns for table vote_indicators. -var voteIndicatorsColumns = VoteIndicatorsColumns{ - Id: "id", - Title: "title", - Num: "num", -} - -// NewVoteIndicatorsDao creates and returns a new DAO object for table data access. -func NewVoteIndicatorsDao() *VoteIndicatorsDao { - return &VoteIndicatorsDao{ - group: "default", - table: "vote_indicators", - columns: voteIndicatorsColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *VoteIndicatorsDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *VoteIndicatorsDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *VoteIndicatorsDao) Columns() VoteIndicatorsColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *VoteIndicatorsDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *VoteIndicatorsDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *VoteIndicatorsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/vote_records.go b/internal/dao/internal/vote_records.go deleted file mode 100644 index 19ff48e..0000000 --- a/internal/dao/internal/vote_records.go +++ /dev/null @@ -1,81 +0,0 @@ -// ========================================================================== -// 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" -) - -// VoteRecordsDao is the data access object for table vote_records. -type VoteRecordsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns VoteRecordsColumns // columns contains all the column names of Table for convenient usage. -} - -// VoteRecordsColumns defines and stores column names for table vote_records. -type VoteRecordsColumns struct { - Id string // - Jwcode string // - VoteDate string // - Time string // - OptionsTitle string // -} - -// voteRecordsColumns holds the columns for table vote_records. -var voteRecordsColumns = VoteRecordsColumns{ - Id: "id", - Jwcode: "jwcode", - VoteDate: "vote_date", - Time: "time", - OptionsTitle: "options_title", -} - -// NewVoteRecordsDao creates and returns a new DAO object for table data access. -func NewVoteRecordsDao() *VoteRecordsDao { - return &VoteRecordsDao{ - group: "default", - table: "vote_records", - columns: voteRecordsColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *VoteRecordsDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *VoteRecordsDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *VoteRecordsDao) Columns() VoteRecordsColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *VoteRecordsDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *VoteRecordsDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *VoteRecordsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/wish.go b/internal/dao/internal/wish.go deleted file mode 100644 index ea322b1..0000000 --- a/internal/dao/internal/wish.go +++ /dev/null @@ -1,123 +0,0 @@ -// ========================================================================== -// 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" -) - -// WishDao is the data access object for table wish. -type WishDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns WishColumns // columns contains all the column names of Table for convenient usage. -} - -// WishColumns defines and stores column names for table wish. -type WishColumns struct { - Id string // - Jwcode string // 用户标识 - Title string // 心愿名称 - Content string // 心愿内容 - Image string // 图片,多张图片用json格式保存 - Type string // 1精网2弘历软件3大财神4锦囊5L-2产品 - Status string // 0隐藏1待处理2排期中3在开发4已上线 - Support string // 点赞数 - Opposition string // 反对数 - Comment string // 评论数 - Fee string // 打赏当午券数 - FeeNum string // 打赏人数 - Vote string // 总票数 - Zan string // 点赞数 - See string // 观看数 - Class string // 1心愿2公告 - Label string // 1软件bug2产品需求3市场建议 - Delete string // 0正常1删除2隐藏 - ManagerJwcode string // 负责人的jwcode - Order string // 排序 - Coding string // 是否经过开发 - DeadLine string // 上线日期 - Language string // - SubjectId string // 话题ID - CreatedAt string // - UpdatedAt string // -} - -// wishColumns holds the columns for table wish. -var wishColumns = WishColumns{ - Id: "id", - Jwcode: "jwcode", - Title: "title", - Content: "content", - Image: "image", - Type: "type", - Status: "status", - Support: "support", - Opposition: "opposition", - Comment: "comment", - Fee: "fee", - FeeNum: "fee_num", - Vote: "vote", - Zan: "zan", - See: "see", - Class: "class", - Label: "label", - Delete: "delete", - ManagerJwcode: "manager_jwcode", - Order: "order", - Coding: "coding", - DeadLine: "dead_line", - Language: "language", - SubjectId: "subject_id", - CreatedAt: "created_at", - UpdatedAt: "updated_at", -} - -// NewWishDao creates and returns a new DAO object for table data access. -func NewWishDao() *WishDao { - return &WishDao{ - group: "default", - table: "wish", - columns: wishColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *WishDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *WishDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *WishDao) Columns() WishColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *WishDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *WishDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *WishDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/wish_cost.go b/internal/dao/internal/wish_cost.go deleted file mode 100644 index 139dcfa..0000000 --- a/internal/dao/internal/wish_cost.go +++ /dev/null @@ -1,85 +0,0 @@ -// ========================================================================== -// 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" -) - -// WishCostDao is the data access object for table wish_cost. -type WishCostDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns WishCostColumns // columns contains all the column names of Table for convenient usage. -} - -// WishCostColumns defines and stores column names for table wish_cost. -type WishCostColumns struct { - Id string // - Jwcode string // - WishId string // - Coin string // - Status string // 1新建2成功3未成功 - Msg string // - CreatedAt string // -} - -// wishCostColumns holds the columns for table wish_cost. -var wishCostColumns = WishCostColumns{ - Id: "id", - Jwcode: "jwcode", - WishId: "wish_id", - Coin: "coin", - Status: "status", - Msg: "msg", - CreatedAt: "created_at", -} - -// NewWishCostDao creates and returns a new DAO object for table data access. -func NewWishCostDao() *WishCostDao { - return &WishCostDao{ - group: "default", - table: "wish_cost", - columns: wishCostColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *WishCostDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *WishCostDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *WishCostDao) Columns() WishCostColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *WishCostDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *WishCostDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *WishCostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/wish_related.go b/internal/dao/internal/wish_related.go deleted file mode 100644 index 66baa67..0000000 --- a/internal/dao/internal/wish_related.go +++ /dev/null @@ -1,77 +0,0 @@ -// ========================================================================== -// 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" -) - -// WishRelatedDao is the data access object for table wish_related. -type WishRelatedDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns WishRelatedColumns // columns contains all the column names of Table for convenient usage. -} - -// WishRelatedColumns defines and stores column names for table wish_related. -type WishRelatedColumns struct { - Id string // - WishId string // 心愿ID - NoticeId string // 公告ID -} - -// wishRelatedColumns holds the columns for table wish_related. -var wishRelatedColumns = WishRelatedColumns{ - Id: "id", - WishId: "wish_id", - NoticeId: "notice_id", -} - -// NewWishRelatedDao creates and returns a new DAO object for table data access. -func NewWishRelatedDao() *WishRelatedDao { - return &WishRelatedDao{ - group: "default", - table: "wish_related", - columns: wishRelatedColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *WishRelatedDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *WishRelatedDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *WishRelatedDao) Columns() WishRelatedColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *WishRelatedDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *WishRelatedDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *WishRelatedDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/wish_state.go b/internal/dao/internal/wish_state.go deleted file mode 100644 index 52487ef..0000000 --- a/internal/dao/internal/wish_state.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// WishStateDao is the data access object for table wish_state. -type WishStateDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns WishStateColumns // columns contains all the column names of Table for convenient usage. -} - -// WishStateColumns defines and stores column names for table wish_state. -type WishStateColumns struct { - Id string // - Language string // - Type string // - Name string // -} - -// wishStateColumns holds the columns for table wish_state. -var wishStateColumns = WishStateColumns{ - Id: "id", - Language: "language", - Type: "type", - Name: "name", -} - -// NewWishStateDao creates and returns a new DAO object for table data access. -func NewWishStateDao() *WishStateDao { - return &WishStateDao{ - group: "default", - table: "wish_state", - columns: wishStateColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *WishStateDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *WishStateDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *WishStateDao) Columns() WishStateColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *WishStateDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *WishStateDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *WishStateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/wish_translate.go b/internal/dao/internal/wish_translate.go deleted file mode 100644 index 27810d7..0000000 --- a/internal/dao/internal/wish_translate.go +++ /dev/null @@ -1,83 +0,0 @@ -// ========================================================================== -// 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" -) - -// WishTranslateDao is the data access object for table wish_translate. -type WishTranslateDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns WishTranslateColumns // columns contains all the column names of Table for convenient usage. -} - -// WishTranslateColumns defines and stores column names for table wish_translate. -type WishTranslateColumns struct { - Id string // - WishId string // - SourceLanguage string // - TargetLanguage string // - Title string // - Content string // -} - -// wishTranslateColumns holds the columns for table wish_translate. -var wishTranslateColumns = WishTranslateColumns{ - Id: "id", - WishId: "wish_id", - SourceLanguage: "source_language", - TargetLanguage: "target_language", - Title: "title", - Content: "content", -} - -// NewWishTranslateDao creates and returns a new DAO object for table data access. -func NewWishTranslateDao() *WishTranslateDao { - return &WishTranslateDao{ - group: "default", - table: "wish_translate", - columns: wishTranslateColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *WishTranslateDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *WishTranslateDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *WishTranslateDao) Columns() WishTranslateColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *WishTranslateDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *WishTranslateDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *WishTranslateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/internal/wish_zan.go b/internal/dao/internal/wish_zan.go deleted file mode 100644 index 7e6e491..0000000 --- a/internal/dao/internal/wish_zan.go +++ /dev/null @@ -1,79 +0,0 @@ -// ========================================================================== -// 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" -) - -// WishZanDao is the data access object for table wish_zan. -type WishZanDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of current DAO. - columns WishZanColumns // columns contains all the column names of Table for convenient usage. -} - -// WishZanColumns defines and stores column names for table wish_zan. -type WishZanColumns struct { - Id string // - Jwcode string // - WishId string // - CreatedAt string // -} - -// wishZanColumns holds the columns for table wish_zan. -var wishZanColumns = WishZanColumns{ - Id: "id", - Jwcode: "jwcode", - WishId: "wish_id", - CreatedAt: "created_at", -} - -// NewWishZanDao creates and returns a new DAO object for table data access. -func NewWishZanDao() *WishZanDao { - return &WishZanDao{ - group: "default", - table: "wish_zan", - columns: wishZanColumns, - } -} - -// DB retrieves and returns the underlying raw database management object of current DAO. -func (dao *WishZanDao) DB() gdb.DB { - return g.DB(dao.group) -} - -// Table returns the table name of current dao. -func (dao *WishZanDao) Table() string { - return dao.table -} - -// Columns returns all column names of current dao. -func (dao *WishZanDao) Columns() WishZanColumns { - return dao.columns -} - -// Group returns the configuration group name of database of current dao. -func (dao *WishZanDao) Group() string { - return dao.group -} - -// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. -func (dao *WishZanDao) Ctx(ctx context.Context) *gdb.Model { - return dao.DB().Model(dao.table).Safe().Ctx(ctx) -} - -// Transaction wraps the transaction logic using function f. -// It rollbacks the transaction and returns the error from function f if it returns non-nil error. -// It commits the transaction and returns nil if function f returns nil. -// -// Note that, you should not Commit or Rollback the transaction in function f -// as it is automatically handled by this function. -func (dao *WishZanDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { - return dao.Ctx(ctx).Transaction(ctx, f) -} diff --git a/internal/dao/lecturers.go b/internal/dao/lecturers.go deleted file mode 100644 index b274496..0000000 --- a/internal/dao/lecturers.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalLecturersDao is internal type for wrapping internal DAO implements. -type internalLecturersDao = *internal.LecturersDao - -// lecturersDao is the data access object for table lecturers. -// You can define custom methods on it to extend its functionality as you wish. -type lecturersDao struct { - internalLecturersDao -} - -var ( - // Lecturers is globally public accessible object for table lecturers operations. - Lecturers = lecturersDao{ - internal.NewLecturersDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/manager.go b/internal/dao/manager.go deleted file mode 100644 index ac1211a..0000000 --- a/internal/dao/manager.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalManagerDao is internal type for wrapping internal DAO implements. -type internalManagerDao = *internal.ManagerDao - -// managerDao is the data access object for table manager. -// You can define custom methods on it to extend its functionality as you wish. -type managerDao struct { - internalManagerDao -} - -var ( - // Manager is globally public accessible object for table manager operations. - Manager = managerDao{ - internal.NewManagerDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/member_info.go b/internal/dao/member_info.go deleted file mode 100644 index ffa3011..0000000 --- a/internal/dao/member_info.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalMemberInfoDao is internal type for wrapping internal DAO implements. -type internalMemberInfoDao = *internal.MemberInfoDao - -// memberInfoDao is the data access object for table member_info. -// You can define custom methods on it to extend its functionality as you wish. -type memberInfoDao struct { - internalMemberInfoDao -} - -var ( - // MemberInfo is globally public accessible object for table member_info operations. - MemberInfo = memberInfoDao{ - internal.NewMemberInfoDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/notice.go b/internal/dao/notice.go deleted file mode 100644 index 44fbf0b..0000000 --- a/internal/dao/notice.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalNoticeDao is internal type for wrapping internal DAO implements. -type internalNoticeDao = *internal.NoticeDao - -// noticeDao is the data access object for table notice. -// You can define custom methods on it to extend its functionality as you wish. -type noticeDao struct { - internalNoticeDao -} - -var ( - // Notice is globally public accessible object for table notice operations. - Notice = noticeDao{ - internal.NewNoticeDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/product.go b/internal/dao/product.go deleted file mode 100644 index 0297954..0000000 --- a/internal/dao/product.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalProductDao is internal type for wrapping internal DAO implements. -type internalProductDao = *internal.ProductDao - -// productDao is the data access object for table product. -// You can define custom methods on it to extend its functionality as you wish. -type productDao struct { - internalProductDao -} - -var ( - // Product is globally public accessible object for table product operations. - Product = productDao{ - internal.NewProductDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/subject.go b/internal/dao/subject.go deleted file mode 100644 index 0fe1493..0000000 --- a/internal/dao/subject.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalSubjectDao is internal type for wrapping internal DAO implements. -type internalSubjectDao = *internal.SubjectDao - -// subjectDao is the data access object for table subject. -// You can define custom methods on it to extend its functionality as you wish. -type subjectDao struct { - internalSubjectDao -} - -var ( - // Subject is globally public accessible object for table subject operations. - Subject = subjectDao{ - internal.NewSubjectDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/support.go b/internal/dao/support.go deleted file mode 100644 index c6105aa..0000000 --- a/internal/dao/support.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalSupportDao is internal type for wrapping internal DAO implements. -type internalSupportDao = *internal.SupportDao - -// supportDao is the data access object for table support. -// You can define custom methods on it to extend its functionality as you wish. -type supportDao struct { - internalSupportDao -} - -var ( - // Support is globally public accessible object for table support operations. - Support = supportDao{ - internal.NewSupportDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/transaction_lecturer_records.go b/internal/dao/transaction_lecturer_records.go deleted file mode 100644 index 99d2b90..0000000 --- a/internal/dao/transaction_lecturer_records.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalTransactionLecturerRecordsDao is internal type for wrapping internal DAO implements. -type internalTransactionLecturerRecordsDao = *internal.TransactionLecturerRecordsDao - -// transactionLecturerRecordsDao is the data access object for table transaction_lecturer_records. -// You can define custom methods on it to extend its functionality as you wish. -type transactionLecturerRecordsDao struct { - internalTransactionLecturerRecordsDao -} - -var ( - // TransactionLecturerRecords is globally public accessible object for table transaction_lecturer_records operations. - TransactionLecturerRecords = transactionLecturerRecordsDao{ - internal.NewTransactionLecturerRecordsDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/transaction_plan_files.go b/internal/dao/transaction_plan_files.go deleted file mode 100644 index e19273a..0000000 --- a/internal/dao/transaction_plan_files.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalTransactionPlanFilesDao is internal type for wrapping internal DAO implements. -type internalTransactionPlanFilesDao = *internal.TransactionPlanFilesDao - -// transactionPlanFilesDao is the data access object for table transaction_plan_files. -// You can define custom methods on it to extend its functionality as you wish. -type transactionPlanFilesDao struct { - internalTransactionPlanFilesDao -} - -var ( - // TransactionPlanFiles is globally public accessible object for table transaction_plan_files operations. - TransactionPlanFiles = transactionPlanFilesDao{ - internal.NewTransactionPlanFilesDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/vote_1_indicators.go b/internal/dao/vote_1_indicators.go deleted file mode 100644 index 69a2aa2..0000000 --- a/internal/dao/vote_1_indicators.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalVote1IndicatorsDao is internal type for wrapping internal DAO implements. -type internalVote1IndicatorsDao = *internal.Vote1IndicatorsDao - -// vote1IndicatorsDao is the data access object for table vote1_indicators. -// You can define custom methods on it to extend its functionality as you wish. -type vote1IndicatorsDao struct { - internalVote1IndicatorsDao -} - -var ( - // Vote1Indicators is globally public accessible object for table vote1_indicators operations. - Vote1Indicators = vote1IndicatorsDao{ - internal.NewVote1IndicatorsDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/vote_1_records.go b/internal/dao/vote_1_records.go deleted file mode 100644 index f578f53..0000000 --- a/internal/dao/vote_1_records.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalVote1RecordsDao is internal type for wrapping internal DAO implements. -type internalVote1RecordsDao = *internal.Vote1RecordsDao - -// vote1RecordsDao is the data access object for table vote1_records. -// You can define custom methods on it to extend its functionality as you wish. -type vote1RecordsDao struct { - internalVote1RecordsDao -} - -var ( - // Vote1Records is globally public accessible object for table vote1_records operations. - Vote1Records = vote1RecordsDao{ - internal.NewVote1RecordsDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/vote_1_virtual_records.go b/internal/dao/vote_1_virtual_records.go deleted file mode 100644 index 3598380..0000000 --- a/internal/dao/vote_1_virtual_records.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalVote1VirtualRecordsDao is internal type for wrapping internal DAO implements. -type internalVote1VirtualRecordsDao = *internal.Vote1VirtualRecordsDao - -// vote1VirtualRecordsDao is the data access object for table vote1_virtual_records. -// You can define custom methods on it to extend its functionality as you wish. -type vote1VirtualRecordsDao struct { - internalVote1VirtualRecordsDao -} - -var ( - // Vote1VirtualRecords is globally public accessible object for table vote1_virtual_records operations. - Vote1VirtualRecords = vote1VirtualRecordsDao{ - internal.NewVote1VirtualRecordsDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/vote_indicators.go b/internal/dao/vote_indicators.go deleted file mode 100644 index 6d6d8a3..0000000 --- a/internal/dao/vote_indicators.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalVoteIndicatorsDao is internal type for wrapping internal DAO implements. -type internalVoteIndicatorsDao = *internal.VoteIndicatorsDao - -// voteIndicatorsDao is the data access object for table vote_indicators. -// You can define custom methods on it to extend its functionality as you wish. -type voteIndicatorsDao struct { - internalVoteIndicatorsDao -} - -var ( - // VoteIndicators is globally public accessible object for table vote_indicators operations. - VoteIndicators = voteIndicatorsDao{ - internal.NewVoteIndicatorsDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/vote_records.go b/internal/dao/vote_records.go deleted file mode 100644 index 8a3d838..0000000 --- a/internal/dao/vote_records.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalVoteRecordsDao is internal type for wrapping internal DAO implements. -type internalVoteRecordsDao = *internal.VoteRecordsDao - -// voteRecordsDao is the data access object for table vote_records. -// You can define custom methods on it to extend its functionality as you wish. -type voteRecordsDao struct { - internalVoteRecordsDao -} - -var ( - // VoteRecords is globally public accessible object for table vote_records operations. - VoteRecords = voteRecordsDao{ - internal.NewVoteRecordsDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/wish.go b/internal/dao/wish.go deleted file mode 100644 index f97f449..0000000 --- a/internal/dao/wish.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalWishDao is internal type for wrapping internal DAO implements. -type internalWishDao = *internal.WishDao - -// wishDao is the data access object for table wish. -// You can define custom methods on it to extend its functionality as you wish. -type wishDao struct { - internalWishDao -} - -var ( - // Wish is globally public accessible object for table wish operations. - Wish = wishDao{ - internal.NewWishDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/wish_cost.go b/internal/dao/wish_cost.go deleted file mode 100644 index d8450d6..0000000 --- a/internal/dao/wish_cost.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalWishCostDao is internal type for wrapping internal DAO implements. -type internalWishCostDao = *internal.WishCostDao - -// wishCostDao is the data access object for table wish_cost. -// You can define custom methods on it to extend its functionality as you wish. -type wishCostDao struct { - internalWishCostDao -} - -var ( - // WishCost is globally public accessible object for table wish_cost operations. - WishCost = wishCostDao{ - internal.NewWishCostDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/wish_related.go b/internal/dao/wish_related.go deleted file mode 100644 index 518d8ae..0000000 --- a/internal/dao/wish_related.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalWishRelatedDao is internal type for wrapping internal DAO implements. -type internalWishRelatedDao = *internal.WishRelatedDao - -// wishRelatedDao is the data access object for table wish_related. -// You can define custom methods on it to extend its functionality as you wish. -type wishRelatedDao struct { - internalWishRelatedDao -} - -var ( - // WishRelated is globally public accessible object for table wish_related operations. - WishRelated = wishRelatedDao{ - internal.NewWishRelatedDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/wish_state.go b/internal/dao/wish_state.go deleted file mode 100644 index 806bb0a..0000000 --- a/internal/dao/wish_state.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalWishStateDao is internal type for wrapping internal DAO implements. -type internalWishStateDao = *internal.WishStateDao - -// wishStateDao is the data access object for table wish_state. -// You can define custom methods on it to extend its functionality as you wish. -type wishStateDao struct { - internalWishStateDao -} - -var ( - // WishState is globally public accessible object for table wish_state operations. - WishState = wishStateDao{ - internal.NewWishStateDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/wish_translate.go b/internal/dao/wish_translate.go deleted file mode 100644 index 015279a..0000000 --- a/internal/dao/wish_translate.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalWishTranslateDao is internal type for wrapping internal DAO implements. -type internalWishTranslateDao = *internal.WishTranslateDao - -// wishTranslateDao is the data access object for table wish_translate. -// You can define custom methods on it to extend its functionality as you wish. -type wishTranslateDao struct { - internalWishTranslateDao -} - -var ( - // WishTranslate is globally public accessible object for table wish_translate operations. - WishTranslate = wishTranslateDao{ - internal.NewWishTranslateDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/dao/wish_zan.go b/internal/dao/wish_zan.go deleted file mode 100644 index e33a1f4..0000000 --- a/internal/dao/wish_zan.go +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package dao - -import ( - "VoteManage_Go/internal/dao/internal" -) - -// internalWishZanDao is internal type for wrapping internal DAO implements. -type internalWishZanDao = *internal.WishZanDao - -// wishZanDao is the data access object for table wish_zan. -// You can define custom methods on it to extend its functionality as you wish. -type wishZanDao struct { - internalWishZanDao -} - -var ( - // WishZan is globally public accessible object for table wish_zan operations. - WishZan = wishZanDao{ - internal.NewWishZanDao(), - } -) - -// Fill with you ideas below. diff --git a/internal/logic/vote.go b/internal/logic/vote.go new file mode 100644 index 0000000..9cbe810 --- /dev/null +++ b/internal/logic/vote.go @@ -0,0 +1,124 @@ +package logic + +import ( + "VoteManage_Go/api/v1/vote" + "VoteManage_Go/internal/dao" + "VoteManage_Go/internal/model/dto" + "VoteManage_Go/internal/service" + "context" + "fmt" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/os/gtime" + "github.com/xuri/excelize/v2" + "net/url" + "strconv" + "time" +) + +type sVote struct{} + +func init() { + service.RegisterVote(New()) +} + +func New() *sVote { + return &sVote{} +} + +func (s *sVote) GetVoteByCondition(ctx context.Context, req *vote.GetVoteDetailListReq) (votes []*dto.VoteDto, total int, err error) { + query := g.Model("vote_records v").LeftJoin("member_info m", "v.jwcode = m.jwcode"). + Fields("v.id, m.nickname, v.jwcode, m.dept, v.options_title, v.time"). + Where("v.activity_id = ?", req.ActivityId) + + // 条件1:jwcode输入(精确匹配) + if req.Jwcode != "" { + query = query.Where("v.jwcode = ?", req.Jwcode) + } + + // 条件2:地区dept下拉框(精确匹配)dept是汉字 + if req.Dept != "" { + query = query.Where("m.dept = ?", req.Dept) + } + + // 条件3:投票日期范围(时间戳转换) + //if req.StartTime != nil && req.EndTime != nil { + // // 将前端日期字符串转为Unix时间戳(示例:2025.04.01 00:00:00 → 时间戳) + // query = query.Where("v.time BETWEEN ? AND ?", req.StartTime.Unix(), req.EndTime.Unix()) + //} + if req.StartDate != "" && req.EndDate != "" { + start := gtime.New(req.StartDate + " 00:00:00").Unix() + end := gtime.New(req.EndDate + " 23:59:59").Unix() + query = query.Where("v.time BETWEEN ? AND ?", start, end) + } + + // 条件4:分页 + query.Page(req.PageNo, req.PageSize).ScanAndCount(&votes, &total, false) + return +} + +func (s *sVote) ExportVote(r *ghttp.Request, req *vote.GetVoteDetailListReq) { + votes, _, err := s.GetVoteByCondition(r.Context(), req) + if err != nil { + r.Response.WriteJsonExit(dto.Error("查询失败:" + err.Error())) + return + } + if len(votes) == 0 { + r.Response.WriteJsonExit(dto.Error("查询结果为空")) + return + } + + // 内存中创建Excel文件(不落盘) + excelFile := excelize.NewFile() + sheetName := "投票记录" + excelFile.SetSheetName("Sheet1", sheetName) + + // 设置表头样式 + headers := []string{"序号", "姓名", "精网号", "地区", "投票明细", "投票时间"} + for i, header := range headers { + col := string('A' + i) + excelFile.SetCellValue(sheetName, col+"1", header) + excelFile.SetColWidth(sheetName, col, col, 18) // 列宽调整 + } + + // 动态写入数据 + for rowIdx, vote := range votes { + row := strconv.Itoa(rowIdx + 2) + excelFile.SetCellValue(sheetName, "A"+row, rowIdx+1) + excelFile.SetCellValue(sheetName, "B"+row, vote.Nickname) + excelFile.SetCellValue(sheetName, "C"+row, vote.Jwcode) + excelFile.SetCellValue(sheetName, "D"+row, vote.Dept) + excelFile.SetCellValue(sheetName, "E"+row, vote.OptionsTitle) + excelFile.SetCellValue(sheetName, "F"+row, vote.Time) + } + + // 生成唯一文件名并响应流 + fileName := fmt.Sprintf("投票记录_%s.xlsx", + time.Now().Format("20060102150405"), + ) + r.Response.Header().Set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") + r.Response.Header().Set("Content-Disposition", "attachment; filename*=UTF-8''"+url.QueryEscape(fileName)) + + // 直接写入HTTP响应流 + if buffer, err := excelFile.WriteToBuffer(); err == nil { + r.Response.Write(buffer.Bytes()) + } else { + r.Response.WriteJsonExit(dto.Error("文件生成失败:" + err.Error())) + } +} +func (s *sVote) GetActivityList(ctx context.Context, req *vote.GetActivityListReq) (activities []*dto.Activity, total int, err error) { + err = g.DB("live").Model("float_window").Fields("id, title, start, end, created_at"). + OrderDesc("id").Page(req.PageNo, req.PageSize).ScanAndCount(&activities, &total, false) + for _, v := range activities { + v.VoteCount, _ = dao.VoteRecords.Ctx(ctx).Where("activity_id", v.Id).Fields("DISTINCT jwcode").Count() + //fmt.Printf(strconv.Itoa(v.VoteCount)) + if gtime.Date() < v.Start { + v.Status = 1 + } else if gtime.Date() > v.End { + v.Status = 3 + } else { + v.Status = 2 + } + } + return +} diff --git a/internal/model/do/able_sign_users.go b/internal/model/do/able_sign_users.go deleted file mode 100644 index d6ca79c..0000000 --- a/internal/model/do/able_sign_users.go +++ /dev/null @@ -1,17 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// AbleSignUsers is the golang structure of table able_sign_users for DAO operations like Where/Data. -type AbleSignUsers struct { - g.Meta `orm:"table:able_sign_users, do:true"` - Id interface{} // - Jwcode interface{} // - Type interface{} // 1 博股会员 2 信息费5年 3 购买三个指标 -} diff --git a/internal/model/do/comment.go b/internal/model/do/comment.go deleted file mode 100644 index 5c96866..0000000 --- a/internal/model/do/comment.go +++ /dev/null @@ -1,23 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// Comment is the golang structure of table comment for DAO operations like Where/Data. -type Comment struct { - g.Meta `orm:"table:comment, do:true"` - Id interface{} // - WishId interface{} // 心愿ID - Jwcode interface{} // 评论人code - Content interface{} // 评论内容 - Image interface{} // 图片,多张图片用json格式保存 - ReplyNum interface{} // 回复数 - Pid interface{} // 父级评论ID - Delete interface{} // 0正常1删除 - CreatedAt interface{} // 评论时间 -} diff --git a/internal/model/do/comment_zan.go b/internal/model/do/comment_zan.go deleted file mode 100644 index 07000dc..0000000 --- a/internal/model/do/comment_zan.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// CommentZan is the golang structure of table comment_zan for DAO operations like Where/Data. -type CommentZan struct { - g.Meta `orm:"table:comment_zan, do:true"` - Id interface{} // - Jwcode interface{} // - CommentId interface{} // - CreatedAt interface{} // -} diff --git a/internal/model/do/experience_officer_sign.go b/internal/model/do/experience_officer_sign.go deleted file mode 100644 index 6c5042c..0000000 --- a/internal/model/do/experience_officer_sign.go +++ /dev/null @@ -1,24 +0,0 @@ -// ================================================================================= -// 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" -) - -// ExperienceOfficerSign is the golang structure of table experience_officer_sign for DAO operations like Where/Data. -type ExperienceOfficerSign struct { - g.Meta `orm:"table:experience_officer_sign, do:true"` - Id interface{} // - Jwcode interface{} // - Time interface{} // - State interface{} // 1 报名用户 - Location interface{} // 1 新加坡 2 马来 3 香港 4 美股 5 A股 - Identity interface{} // 1 博股会员 2 金卡会员 - ReservationCode interface{} // - Seat interface{} // - Date *gtime.Time // -} diff --git a/internal/model/do/experience_officer_vote.go b/internal/model/do/experience_officer_vote.go deleted file mode 100644 index 216d6cf..0000000 --- a/internal/model/do/experience_officer_vote.go +++ /dev/null @@ -1,24 +0,0 @@ -// ================================================================================= -// 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" -) - -// ExperienceOfficerVote is the golang structure of table experience_officer_vote for DAO operations like Where/Data. -type ExperienceOfficerVote struct { - g.Meta `orm:"table:experience_officer_vote, do:true"` - Id interface{} // - Jwcode interface{} // - Time interface{} // - State interface{} // 1 报名用户 - Location interface{} // 1 新加坡 2 马来 3 香港 4 美股 5 A股 - Identity interface{} // 1 博股会员 2 金卡会员 - ReservationCode interface{} // - Seat interface{} // - Date *gtime.Time // -} diff --git a/internal/model/do/hot_jwcode.go b/internal/model/do/hot_jwcode.go deleted file mode 100644 index 3e4369c..0000000 --- a/internal/model/do/hot_jwcode.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// HotJwcode is the golang structure of table hot_jwcode for DAO operations like Where/Data. -type HotJwcode struct { - g.Meta `orm:"table:hot_jwcode, do:true"` - Id interface{} // - Jwcode interface{} // 精网号 - Hot interface{} // 热度值 - UpdatedAt interface{} // -} diff --git a/internal/model/do/hot_subject.go b/internal/model/do/hot_subject.go deleted file mode 100644 index 2bb3f88..0000000 --- a/internal/model/do/hot_subject.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// HotSubject is the golang structure of table hot_subject for DAO operations like Where/Data. -type HotSubject struct { - g.Meta `orm:"table:hot_subject, do:true"` - Id interface{} // - SubjectId interface{} // 话题ID - Hot interface{} // 热度值 - UpdatedAt interface{} // -} diff --git a/internal/model/do/hot_wish.go b/internal/model/do/hot_wish.go deleted file mode 100644 index ae89673..0000000 --- a/internal/model/do/hot_wish.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// HotWish is the golang structure of table hot_wish for DAO operations like Where/Data. -type HotWish struct { - g.Meta `orm:"table:hot_wish, do:true"` - Id interface{} // - WishId interface{} // 心愿ID - Hot interface{} // 热度值 - UpdatedAt interface{} // -} diff --git a/internal/model/do/lecturers.go b/internal/model/do/lecturers.go deleted file mode 100644 index 456ab86..0000000 --- a/internal/model/do/lecturers.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// Lecturers is the golang structure of table lecturers for DAO operations like Where/Data. -type Lecturers struct { - g.Meta `orm:"table:lecturers, do:true"` - Id interface{} // - Jwcode interface{} // - Avatar interface{} // - Name interface{} // -} diff --git a/internal/model/do/manager.go b/internal/model/do/manager.go deleted file mode 100644 index 1eb3b15..0000000 --- a/internal/model/do/manager.go +++ /dev/null @@ -1,21 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// Manager is the golang structure of table manager for DAO operations like Where/Data. -type Manager struct { - g.Meta `orm:"table:manager, do:true"` - Id interface{} // - Jwcode interface{} // - Name interface{} // - Type interface{} // 产品ID - LanguageKey interface{} // - Enabled interface{} // - CreatedAt interface{} // -} diff --git a/internal/model/do/member_info.go b/internal/model/do/member_info.go deleted file mode 100644 index aa529ce..0000000 --- a/internal/model/do/member_info.go +++ /dev/null @@ -1,23 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// MemberInfo is the golang structure of table member_info for DAO operations like Where/Data. -type MemberInfo struct { - g.Meta `orm:"table:member_info, do:true"` - Id interface{} // - Jwcode interface{} // - Nickname interface{} // - Img interface{} // - Medal interface{} // 体验官勋章url - LocMarket interface{} // - Dept interface{} // - Shop interface{} // - BoguMember interface{} // 1:博股会员,0:不是 -} diff --git a/internal/model/do/notice.go b/internal/model/do/notice.go deleted file mode 100644 index c6d1e85..0000000 --- a/internal/model/do/notice.go +++ /dev/null @@ -1,23 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// Notice is the golang structure of table notice for DAO operations like Where/Data. -type Notice struct { - g.Meta `orm:"table:notice, do:true"` - Id interface{} // - Type interface{} // 1进度修改2评论3点赞 - WishId interface{} // 心愿ID - CommentId interface{} // - Jwcode interface{} // 操作人 - NoticeJwcode interface{} // 通知人 - State interface{} // 0新通知1已看 - WishState interface{} // 把心愿改成的状态 - CreatedAt interface{} // -} diff --git a/internal/model/do/product.go b/internal/model/do/product.go deleted file mode 100644 index 4a1eb09..0000000 --- a/internal/model/do/product.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// Product is the golang structure of table product for DAO operations like Where/Data. -type Product struct { - g.Meta `orm:"table:product, do:true"` - Id interface{} // - Name interface{} // - Enabled interface{} // - ZhCN interface{} // -} diff --git a/internal/model/do/subject.go b/internal/model/do/subject.go deleted file mode 100644 index e5d6d0b..0000000 --- a/internal/model/do/subject.go +++ /dev/null @@ -1,17 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// Subject is the golang structure of table subject for DAO operations like Where/Data. -type Subject struct { - g.Meta `orm:"table:subject, do:true"` - Id interface{} // - Type interface{} // - Content interface{} // -} diff --git a/internal/model/do/support.go b/internal/model/do/support.go deleted file mode 100644 index a07a974..0000000 --- a/internal/model/do/support.go +++ /dev/null @@ -1,19 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// Support is the golang structure of table support for DAO operations like Where/Data. -type Support struct { - g.Meta `orm:"table:support, do:true"` - Id interface{} // - Jwcode interface{} // 用户标识 - WishId interface{} // 心愿ID - Type interface{} // 1支持2反对 - CreatedAt interface{} // 时间 -} diff --git a/internal/model/do/transaction_lecturer_records.go b/internal/model/do/transaction_lecturer_records.go deleted file mode 100644 index a36d285..0000000 --- a/internal/model/do/transaction_lecturer_records.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// TransactionLecturerRecords is the golang structure of table transaction_lecturer_records for DAO operations like Where/Data. -type TransactionLecturerRecords struct { - g.Meta `orm:"table:transaction_lecturer_records, do:true"` - Id interface{} // - Jwcode interface{} // - LecturerJwcode interface{} // - Time interface{} // -} diff --git a/internal/model/do/transaction_plan_files.go b/internal/model/do/transaction_plan_files.go deleted file mode 100644 index 6d58ee3..0000000 --- a/internal/model/do/transaction_plan_files.go +++ /dev/null @@ -1,19 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// TransactionPlanFiles is the golang structure of table transaction_plan_files for DAO operations like Where/Data. -type TransactionPlanFiles struct { - g.Meta `orm:"table:transaction_plan_files, do:true"` - Id interface{} // - Jwcode interface{} // - Content interface{} // - Time interface{} // 提交时间 - EncryptionId interface{} // -} diff --git a/internal/model/do/vote_1_indicators.go b/internal/model/do/vote_1_indicators.go deleted file mode 100644 index d27d7a2..0000000 --- a/internal/model/do/vote_1_indicators.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// Vote1Indicators is the golang structure of table vote1_indicators for DAO operations like Where/Data. -type Vote1Indicators struct { - g.Meta `orm:"table:vote1_indicators, do:true"` - Id interface{} // - Title interface{} // - Description interface{} // - Img interface{} // -} diff --git a/internal/model/do/vote_1_records.go b/internal/model/do/vote_1_records.go deleted file mode 100644 index 08c2047..0000000 --- a/internal/model/do/vote_1_records.go +++ /dev/null @@ -1,20 +0,0 @@ -// ================================================================================= -// 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" -) - -// Vote1Records is the golang structure of table vote1_records for DAO operations like Where/Data. -type Vote1Records struct { - g.Meta `orm:"table:vote1_records, do:true"` - Id interface{} // - Jwcode interface{} // - VId interface{} // - VoteDate *gtime.Time // - Time interface{} // -} diff --git a/internal/model/do/vote_1_virtual_records.go b/internal/model/do/vote_1_virtual_records.go deleted file mode 100644 index 53fbfda..0000000 --- a/internal/model/do/vote_1_virtual_records.go +++ /dev/null @@ -1,20 +0,0 @@ -// ================================================================================= -// 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" -) - -// Vote1VirtualRecords is the golang structure of table vote1_virtual_records for DAO operations like Where/Data. -type Vote1VirtualRecords struct { - g.Meta `orm:"table:vote1_virtual_records, do:true"` - Id interface{} // - VId interface{} // - Votes interface{} // - VoteDate *gtime.Time // - Time interface{} // -} diff --git a/internal/model/do/vote_indicators.go b/internal/model/do/vote_indicators.go deleted file mode 100644 index e9ece08..0000000 --- a/internal/model/do/vote_indicators.go +++ /dev/null @@ -1,17 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// VoteIndicators is the golang structure of table vote_indicators for DAO operations like Where/Data. -type VoteIndicators struct { - g.Meta `orm:"table:vote_indicators, do:true"` - Id interface{} // - Title interface{} // - Num interface{} // 选择人数 -} diff --git a/internal/model/do/vote_records.go b/internal/model/do/vote_records.go deleted file mode 100644 index 7b9f4a0..0000000 --- a/internal/model/do/vote_records.go +++ /dev/null @@ -1,20 +0,0 @@ -// ================================================================================= -// 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" -) - -// VoteRecords is the golang structure of table vote_records for DAO operations like Where/Data. -type VoteRecords struct { - g.Meta `orm:"table:vote_records, do:true"` - Id interface{} // - Jwcode interface{} // - VoteDate *gtime.Time // - Time interface{} // - OptionsTitle interface{} // -} diff --git a/internal/model/do/wish.go b/internal/model/do/wish.go deleted file mode 100644 index 1a4031a..0000000 --- a/internal/model/do/wish.go +++ /dev/null @@ -1,41 +0,0 @@ -// ================================================================================= -// 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" -) - -// Wish is the golang structure of table wish for DAO operations like Where/Data. -type Wish struct { - g.Meta `orm:"table:wish, do:true"` - Id interface{} // - Jwcode interface{} // 用户标识 - Title interface{} // 心愿名称 - Content interface{} // 心愿内容 - Image interface{} // 图片,多张图片用json格式保存 - Type interface{} // 1精网2弘历软件3大财神4锦囊5L-2产品 - Status interface{} // 0隐藏1待处理2排期中3在开发4已上线 - Support interface{} // 点赞数 - Opposition interface{} // 反对数 - Comment interface{} // 评论数 - Fee interface{} // 打赏当午券数 - FeeNum interface{} // 打赏人数 - Vote interface{} // 总票数 - Zan interface{} // 点赞数 - See interface{} // 观看数 - Class interface{} // 1心愿2公告 - Label interface{} // 1软件bug2产品需求3市场建议 - Delete interface{} // 0正常1删除2隐藏 - ManagerJwcode interface{} // 负责人的jwcode - Order interface{} // 排序 - Coding interface{} // 是否经过开发 - DeadLine *gtime.Time // 上线日期 - Language interface{} // - SubjectId interface{} // 话题ID - CreatedAt interface{} // - UpdatedAt interface{} // -} diff --git a/internal/model/do/wish_cost.go b/internal/model/do/wish_cost.go deleted file mode 100644 index 777badb..0000000 --- a/internal/model/do/wish_cost.go +++ /dev/null @@ -1,21 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// WishCost is the golang structure of table wish_cost for DAO operations like Where/Data. -type WishCost struct { - g.Meta `orm:"table:wish_cost, do:true"` - Id interface{} // - Jwcode interface{} // - WishId interface{} // - Coin interface{} // - Status interface{} // 1新建2成功3未成功 - Msg interface{} // - CreatedAt interface{} // -} diff --git a/internal/model/do/wish_related.go b/internal/model/do/wish_related.go deleted file mode 100644 index f8b4d87..0000000 --- a/internal/model/do/wish_related.go +++ /dev/null @@ -1,17 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// WishRelated is the golang structure of table wish_related for DAO operations like Where/Data. -type WishRelated struct { - g.Meta `orm:"table:wish_related, do:true"` - Id interface{} // - WishId interface{} // 心愿ID - NoticeId interface{} // 公告ID -} diff --git a/internal/model/do/wish_state.go b/internal/model/do/wish_state.go deleted file mode 100644 index 4f86218..0000000 --- a/internal/model/do/wish_state.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// WishState is the golang structure of table wish_state for DAO operations like Where/Data. -type WishState struct { - g.Meta `orm:"table:wish_state, do:true"` - Id interface{} // - Language interface{} // - Type interface{} // - Name interface{} // -} diff --git a/internal/model/do/wish_translate.go b/internal/model/do/wish_translate.go deleted file mode 100644 index c67fd55..0000000 --- a/internal/model/do/wish_translate.go +++ /dev/null @@ -1,20 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// WishTranslate is the golang structure of table wish_translate for DAO operations like Where/Data. -type WishTranslate struct { - g.Meta `orm:"table:wish_translate, do:true"` - Id interface{} // - WishId interface{} // - SourceLanguage interface{} // - TargetLanguage interface{} // - Title interface{} // - Content interface{} // -} diff --git a/internal/model/do/wish_zan.go b/internal/model/do/wish_zan.go deleted file mode 100644 index 38e4f2e..0000000 --- a/internal/model/do/wish_zan.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package do - -import ( - "github.com/gogf/gf/v2/frame/g" -) - -// WishZan is the golang structure of table wish_zan for DAO operations like Where/Data. -type WishZan struct { - g.Meta `orm:"table:wish_zan, do:true"` - Id interface{} // - Jwcode interface{} // - WishId interface{} // - CreatedAt interface{} // -} diff --git a/internal/model/dto/Result.go b/internal/model/dto/Result.go new file mode 100644 index 0000000..67c0e2d --- /dev/null +++ b/internal/model/dto/Result.go @@ -0,0 +1,80 @@ +package dto + +// 定义响应结构 +type Result struct { + Code int `json:"code"` + Message string `json:"message"` + Data interface{} `json:"data"` // 修改为实体类型 +} + +/*成功,没有数据*/ +func Success() *Result { + return &Result{ + Code: 200, + Message: "success", + Data: nil, + } +} + +/*成功,自定义相应信息*/ +func SuccessWithMsg(msg string) *Result { + return &Result{ + Code: 200, + Message: msg, + Data: nil, + } +} + +/*成功,有数据*/ +func SuccessWithData(data interface{}) *Result { + return &Result{ + Code: 200, + Message: "success", + Data: data, + } +} + +/*成功,自定义信息和数据*/ +func SuccessWithMsgAndData(msg string, data interface{}) *Result { + return &Result{ + Code: 200, + Message: msg, + Data: data, + } +} + +/*错误,只有错误信息,错误码0*/ +func Error(msg string) *Result { + return &Result{ + Code: 400, // 错误码 + Message: msg, // 错误信息 + Data: nil, + } +} + +/*错误,有错误信息,有错误码*/ +func ErrorWithCode(code int, msg string) *Result { + return &Result{ + Code: code, // 错误码 + Message: msg, // 错误信息 + Data: nil, + } +} + +/*未授权,有错误信息,错误码为401*/ +func Unauthorized(msg string) *Result { + return &Result{ + Code: 401, // 错误码 + Message: msg, // 错误信息 + Data: nil, + } +} + +/*未授权,有错误信息,允许自定义错误码*/ +func UnauthorizedWithCode(code int, msg string) *Result { + return &Result{ + Code: code, // 错误码 + Message: msg, // 错误信息 + Data: nil, + } +} diff --git a/internal/model/dto/activityDto.go b/internal/model/dto/activityDto.go new file mode 100644 index 0000000..518a7f7 --- /dev/null +++ b/internal/model/dto/activityDto.go @@ -0,0 +1,13 @@ +package dto + +type Activity struct { + Id int `json:"id"` + Title string `json:"title"` + Detail string `json:"detail" dc:"活动详情" ` + VisitCount int `json:"visit_count" dc:"访问人数"` + VoteCount int `json:"vote_count" dc:"投票人数"` + Start string `json:"start" dc:"开始时间"` + End string `json:"end" dc:"结束时间"` + CreatedAt string `json:"created_at" dc:"创建时间"` + Status int `json:"status" dc:"活动状态"` +} diff --git a/internal/model/dto/voteDto.go b/internal/model/dto/voteDto.go new file mode 100644 index 0000000..89a9fc3 --- /dev/null +++ b/internal/model/dto/voteDto.go @@ -0,0 +1,12 @@ +package dto + +import "github.com/gogf/gf/v2/os/gtime" + +type VoteDto struct { + Id uint `json:"id"` + Jwcode string `json:"jwcode"` + Nickname string `json:"nickname"` + Dept string `json:"dept"` + OptionsTitle string `json:"options_title"` + Time *gtime.Time `json:"time"` +} diff --git a/internal/model/entity/able_sign_users.go b/internal/model/entity/able_sign_users.go deleted file mode 100644 index 45e79c6..0000000 --- a/internal/model/entity/able_sign_users.go +++ /dev/null @@ -1,12 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// AbleSignUsers is the golang structure for table able_sign_users. -type AbleSignUsers struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - Type int `json:"type" orm:"type" description:"1 博股会员 2 信息费5年 3 购买三个指标"` // 1 博股会员 2 信息费5年 3 购买三个指标 -} diff --git a/internal/model/entity/comment.go b/internal/model/entity/comment.go deleted file mode 100644 index 65227e2..0000000 --- a/internal/model/entity/comment.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// Comment is the golang structure for table comment. -type Comment struct { - Id uint `json:"id" orm:"id" description:""` // - WishId int `json:"wishId" orm:"wish_id" description:"心愿ID"` // 心愿ID - Jwcode int `json:"jwcode" orm:"jwcode" description:"评论人code"` // 评论人code - Content string `json:"content" orm:"content" description:"评论内容"` // 评论内容 - Image string `json:"image" orm:"image" description:"图片,多张图片用json格式保存"` // 图片,多张图片用json格式保存 - ReplyNum int `json:"replyNum" orm:"reply_num" description:"回复数"` // 回复数 - Pid int `json:"pid" orm:"pid" description:"父级评论ID"` // 父级评论ID - Delete int `json:"delete" orm:"delete" description:"0正常1删除"` // 0正常1删除 - CreatedAt int `json:"createdAt" orm:"created_at" description:"评论时间"` // 评论时间 -} diff --git a/internal/model/entity/comment_zan.go b/internal/model/entity/comment_zan.go deleted file mode 100644 index d367e6a..0000000 --- a/internal/model/entity/comment_zan.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// CommentZan is the golang structure for table comment_zan. -type CommentZan struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - CommentId int `json:"commentId" orm:"comment_id" description:""` // - CreatedAt int `json:"createdAt" orm:"created_at" description:""` // -} diff --git a/internal/model/entity/experience_officer_sign.go b/internal/model/entity/experience_officer_sign.go deleted file mode 100644 index 10ce64f..0000000 --- a/internal/model/entity/experience_officer_sign.go +++ /dev/null @@ -1,22 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -import ( - "github.com/gogf/gf/v2/os/gtime" -) - -// ExperienceOfficerSign is the golang structure for table experience_officer_sign. -type ExperienceOfficerSign struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - Time int `json:"time" orm:"time" description:""` // - State int `json:"state" orm:"state" description:"1 报名用户"` // 1 报名用户 - Location int `json:"location" orm:"location" description:"1 新加坡 2 马来 3 香港 4 美股 5 A股"` // 1 新加坡 2 马来 3 香港 4 美股 5 A股 - Identity int `json:"identity" orm:"identity" description:"1 博股会员 2 金卡会员"` // 1 博股会员 2 金卡会员 - ReservationCode string `json:"reservationCode" orm:"reservation_code" description:""` // - Seat string `json:"seat" orm:"seat" description:""` // - Date *gtime.Time `json:"date" orm:"date" description:""` // -} diff --git a/internal/model/entity/experience_officer_vote.go b/internal/model/entity/experience_officer_vote.go deleted file mode 100644 index 422b8f5..0000000 --- a/internal/model/entity/experience_officer_vote.go +++ /dev/null @@ -1,22 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -import ( - "github.com/gogf/gf/v2/os/gtime" -) - -// ExperienceOfficerVote is the golang structure for table experience_officer_vote. -type ExperienceOfficerVote struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - Time int `json:"time" orm:"time" description:""` // - State int `json:"state" orm:"state" description:"1 报名用户"` // 1 报名用户 - Location int `json:"location" orm:"location" description:"1 新加坡 2 马来 3 香港 4 美股 5 A股"` // 1 新加坡 2 马来 3 香港 4 美股 5 A股 - Identity int `json:"identity" orm:"identity" description:"1 博股会员 2 金卡会员"` // 1 博股会员 2 金卡会员 - ReservationCode string `json:"reservationCode" orm:"reservation_code" description:""` // - Seat string `json:"seat" orm:"seat" description:""` // - Date *gtime.Time `json:"date" orm:"date" description:""` // -} diff --git a/internal/model/entity/hot_jwcode.go b/internal/model/entity/hot_jwcode.go deleted file mode 100644 index a8a15fa..0000000 --- a/internal/model/entity/hot_jwcode.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// HotJwcode is the golang structure for table hot_jwcode. -type HotJwcode struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:"精网号"` // 精网号 - Hot int `json:"hot" orm:"hot" description:"热度值"` // 热度值 - UpdatedAt int `json:"updatedAt" orm:"updated_at" description:""` // -} diff --git a/internal/model/entity/hot_subject.go b/internal/model/entity/hot_subject.go deleted file mode 100644 index 1a3d935..0000000 --- a/internal/model/entity/hot_subject.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// HotSubject is the golang structure for table hot_subject. -type HotSubject struct { - Id uint `json:"id" orm:"id" description:""` // - SubjectId int `json:"subjectId" orm:"subject_id" description:"话题ID"` // 话题ID - Hot int `json:"hot" orm:"hot" description:"热度值"` // 热度值 - UpdatedAt int `json:"updatedAt" orm:"updated_at" description:""` // -} diff --git a/internal/model/entity/hot_wish.go b/internal/model/entity/hot_wish.go deleted file mode 100644 index 9a9d0c8..0000000 --- a/internal/model/entity/hot_wish.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// HotWish is the golang structure for table hot_wish. -type HotWish struct { - Id uint `json:"id" orm:"id" description:""` // - WishId int `json:"wishId" orm:"wish_id" description:"心愿ID"` // 心愿ID - Hot int `json:"hot" orm:"hot" description:"热度值"` // 热度值 - UpdatedAt int `json:"updatedAt" orm:"updated_at" description:""` // -} diff --git a/internal/model/entity/lecturers.go b/internal/model/entity/lecturers.go deleted file mode 100644 index 3e4bdd8..0000000 --- a/internal/model/entity/lecturers.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// Lecturers is the golang structure for table lecturers. -type Lecturers struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - Avatar string `json:"avatar" orm:"avatar" description:""` // - Name string `json:"name" orm:"name" description:""` // -} diff --git a/internal/model/entity/manager.go b/internal/model/entity/manager.go deleted file mode 100644 index 6f9b3df..0000000 --- a/internal/model/entity/manager.go +++ /dev/null @@ -1,16 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// Manager is the golang structure for table manager. -type Manager struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - Name string `json:"name" orm:"name" description:""` // - Type int `json:"type" orm:"type" description:"产品ID"` // 产品ID - LanguageKey string `json:"languageKey" orm:"language_key" description:""` // - Enabled int `json:"enabled" orm:"enabled" description:""` // - CreatedAt int `json:"createdAt" orm:"created_at" description:""` // -} diff --git a/internal/model/entity/member_info.go b/internal/model/entity/member_info.go deleted file mode 100644 index 15b3e7c..0000000 --- a/internal/model/entity/member_info.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// MemberInfo is the golang structure for table member_info. -type MemberInfo struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - Nickname string `json:"nickname" orm:"nickname" description:""` // - Img string `json:"img" orm:"img" description:""` // - Medal string `json:"medal" orm:"medal" description:"体验官勋章url"` // 体验官勋章url - LocMarket string `json:"locMarket" orm:"loc_market" description:""` // - Dept string `json:"dept" orm:"dept" description:""` // - Shop string `json:"shop" orm:"shop" description:""` // - BoguMember int `json:"boguMember" orm:"bogu_member" description:"1:博股会员,0:不是"` // 1:博股会员,0:不是 -} diff --git a/internal/model/entity/notice.go b/internal/model/entity/notice.go deleted file mode 100644 index 04f10f3..0000000 --- a/internal/model/entity/notice.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// Notice is the golang structure for table notice. -type Notice struct { - Id uint `json:"id" orm:"id" description:""` // - Type int `json:"type" orm:"type" description:"1进度修改2评论3点赞"` // 1进度修改2评论3点赞 - WishId int `json:"wishId" orm:"wish_id" description:"心愿ID"` // 心愿ID - CommentId int `json:"commentId" orm:"comment_id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:"操作人"` // 操作人 - NoticeJwcode int `json:"noticeJwcode" orm:"notice_jwcode" description:"通知人"` // 通知人 - State int `json:"state" orm:"state" description:"0新通知1已看"` // 0新通知1已看 - WishState int `json:"wishState" orm:"wish_state" description:"把心愿改成的状态"` // 把心愿改成的状态 - CreatedAt int `json:"createdAt" orm:"created_at" description:""` // -} diff --git a/internal/model/entity/product.go b/internal/model/entity/product.go deleted file mode 100644 index 427486a..0000000 --- a/internal/model/entity/product.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// Product is the golang structure for table product. -type Product struct { - Id uint `json:"id" orm:"id" description:""` // - Name string `json:"name" orm:"name" description:""` // - Enabled int `json:"enabled" orm:"enabled" description:""` // - ZhCN string `json:"zhCN" orm:"zh_CN" description:""` // -} diff --git a/internal/model/entity/subject.go b/internal/model/entity/subject.go deleted file mode 100644 index b180da9..0000000 --- a/internal/model/entity/subject.go +++ /dev/null @@ -1,12 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// Subject is the golang structure for table subject. -type Subject struct { - Id uint `json:"id" orm:"id" description:""` // - Type int `json:"type" orm:"type" description:""` // - Content string `json:"content" orm:"content" description:""` // -} diff --git a/internal/model/entity/support.go b/internal/model/entity/support.go deleted file mode 100644 index 95369e9..0000000 --- a/internal/model/entity/support.go +++ /dev/null @@ -1,14 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// Support is the golang structure for table support. -type Support struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:"用户标识"` // 用户标识 - WishId int `json:"wishId" orm:"wish_id" description:"心愿ID"` // 心愿ID - Type int `json:"type" orm:"type" description:"1支持2反对"` // 1支持2反对 - CreatedAt int `json:"createdAt" orm:"created_at" description:"时间"` // 时间 -} diff --git a/internal/model/entity/transaction_lecturer_records.go b/internal/model/entity/transaction_lecturer_records.go deleted file mode 100644 index d54ac91..0000000 --- a/internal/model/entity/transaction_lecturer_records.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// TransactionLecturerRecords is the golang structure for table transaction_lecturer_records. -type TransactionLecturerRecords struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode string `json:"jwcode" orm:"jwcode" description:""` // - LecturerJwcode string `json:"lecturerJwcode" orm:"lecturer_jwcode" description:""` // - Time int `json:"time" orm:"time" description:""` // -} diff --git a/internal/model/entity/transaction_plan_files.go b/internal/model/entity/transaction_plan_files.go deleted file mode 100644 index 7663596..0000000 --- a/internal/model/entity/transaction_plan_files.go +++ /dev/null @@ -1,14 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// TransactionPlanFiles is the golang structure for table transaction_plan_files. -type TransactionPlanFiles struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - Content string `json:"content" orm:"content" description:""` // - Time int `json:"time" orm:"time" description:"提交时间"` // 提交时间 - EncryptionId string `json:"encryptionId" orm:"encryption_id" description:""` // -} diff --git a/internal/model/entity/vote_1_indicators.go b/internal/model/entity/vote_1_indicators.go deleted file mode 100644 index 4a3c4ef..0000000 --- a/internal/model/entity/vote_1_indicators.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// Vote1Indicators is the golang structure for table vote1_indicators. -type Vote1Indicators struct { - Id uint `json:"id" orm:"id" description:""` // - Title string `json:"title" orm:"title" description:""` // - Description string `json:"description" orm:"description" description:""` // - Img string `json:"img" orm:"img" description:""` // -} diff --git a/internal/model/entity/vote_1_records.go b/internal/model/entity/vote_1_records.go deleted file mode 100644 index 759e38f..0000000 --- a/internal/model/entity/vote_1_records.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -import ( - "github.com/gogf/gf/v2/os/gtime" -) - -// Vote1Records is the golang structure for table vote1_records. -type Vote1Records struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode string `json:"jwcode" orm:"jwcode" description:""` // - VId int `json:"vId" orm:"v_id" description:""` // - VoteDate *gtime.Time `json:"voteDate" orm:"vote_date" description:""` // - Time int `json:"time" orm:"time" description:""` // -} diff --git a/internal/model/entity/vote_1_virtual_records.go b/internal/model/entity/vote_1_virtual_records.go deleted file mode 100644 index 9436c4f..0000000 --- a/internal/model/entity/vote_1_virtual_records.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -import ( - "github.com/gogf/gf/v2/os/gtime" -) - -// Vote1VirtualRecords is the golang structure for table vote1_virtual_records. -type Vote1VirtualRecords struct { - Id uint `json:"id" orm:"id" description:""` // - VId int `json:"vId" orm:"v_id" description:""` // - Votes int `json:"votes" orm:"votes" description:""` // - VoteDate *gtime.Time `json:"voteDate" orm:"vote_date" description:""` // - Time int `json:"time" orm:"time" description:""` // -} diff --git a/internal/model/entity/vote_indicators.go b/internal/model/entity/vote_indicators.go deleted file mode 100644 index c051a22..0000000 --- a/internal/model/entity/vote_indicators.go +++ /dev/null @@ -1,12 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// VoteIndicators is the golang structure for table vote_indicators. -type VoteIndicators struct { - Id uint `json:"id" orm:"id" description:""` // - Title string `json:"title" orm:"title" description:""` // - Num int `json:"num" orm:"num" description:"选择人数"` // 选择人数 -} diff --git a/internal/model/entity/vote_records.go b/internal/model/entity/vote_records.go deleted file mode 100644 index ba48bf3..0000000 --- a/internal/model/entity/vote_records.go +++ /dev/null @@ -1,18 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -import ( - "github.com/gogf/gf/v2/os/gtime" -) - -// VoteRecords is the golang structure for table vote_records. -type VoteRecords struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode string `json:"jwcode" orm:"jwcode" description:""` // - VoteDate *gtime.Time `json:"voteDate" orm:"vote_date" description:""` // - Time int `json:"time" orm:"time" description:""` // - OptionsTitle string `json:"optionsTitle" orm:"options_title" description:""` // -} diff --git a/internal/model/entity/wish.go b/internal/model/entity/wish.go deleted file mode 100644 index 3012e66..0000000 --- a/internal/model/entity/wish.go +++ /dev/null @@ -1,39 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -import ( - "github.com/gogf/gf/v2/os/gtime" -) - -// Wish is the golang structure for table wish. -type Wish struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:"用户标识"` // 用户标识 - Title string `json:"title" orm:"title" description:"心愿名称"` // 心愿名称 - Content string `json:"content" orm:"content" description:"心愿内容"` // 心愿内容 - Image string `json:"image" orm:"image" description:"图片,多张图片用json格式保存"` // 图片,多张图片用json格式保存 - Type int `json:"type" orm:"type" description:"1精网2弘历软件3大财神4锦囊5L-2产品"` // 1精网2弘历软件3大财神4锦囊5L-2产品 - Status int `json:"status" orm:"status" description:"0隐藏1待处理2排期中3在开发4已上线"` // 0隐藏1待处理2排期中3在开发4已上线 - Support int `json:"support" orm:"support" description:"点赞数"` // 点赞数 - Opposition int `json:"opposition" orm:"opposition" description:"反对数"` // 反对数 - Comment int `json:"comment" orm:"comment" description:"评论数"` // 评论数 - Fee float64 `json:"fee" orm:"fee" description:"打赏当午券数"` // 打赏当午券数 - FeeNum int `json:"feeNum" orm:"fee_num" description:"打赏人数"` // 打赏人数 - Vote int `json:"vote" orm:"vote" description:"总票数"` // 总票数 - Zan int `json:"zan" orm:"zan" description:"点赞数"` // 点赞数 - See int `json:"see" orm:"see" description:"观看数"` // 观看数 - Class int `json:"class" orm:"class" description:"1心愿2公告"` // 1心愿2公告 - Label uint `json:"label" orm:"label" description:"1软件bug2产品需求3市场建议"` // 1软件bug2产品需求3市场建议 - Delete int `json:"delete" orm:"delete" description:"0正常1删除2隐藏"` // 0正常1删除2隐藏 - ManagerJwcode int `json:"managerJwcode" orm:"manager_jwcode" description:"负责人的jwcode"` // 负责人的jwcode - Order uint `json:"order" orm:"order" description:"排序"` // 排序 - Coding int `json:"coding" orm:"coding" description:"是否经过开发"` // 是否经过开发 - DeadLine *gtime.Time `json:"deadLine" orm:"dead_line" description:"上线日期"` // 上线日期 - Language string `json:"language" orm:"language" description:""` // - SubjectId int `json:"subjectId" orm:"subject_id" description:"话题ID"` // 话题ID - CreatedAt int `json:"createdAt" orm:"created_at" description:""` // - UpdatedAt int `json:"updatedAt" orm:"updated_at" description:""` // -} diff --git a/internal/model/entity/wish_cost.go b/internal/model/entity/wish_cost.go deleted file mode 100644 index b9ec66a..0000000 --- a/internal/model/entity/wish_cost.go +++ /dev/null @@ -1,16 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// WishCost is the golang structure for table wish_cost. -type WishCost struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - WishId int `json:"wishId" orm:"wish_id" description:""` // - Coin float64 `json:"coin" orm:"coin" description:""` // - Status int `json:"status" orm:"status" description:"1新建2成功3未成功"` // 1新建2成功3未成功 - Msg string `json:"msg" orm:"msg" description:""` // - CreatedAt int `json:"createdAt" orm:"created_at" description:""` // -} diff --git a/internal/model/entity/wish_related.go b/internal/model/entity/wish_related.go deleted file mode 100644 index 50dd86b..0000000 --- a/internal/model/entity/wish_related.go +++ /dev/null @@ -1,12 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// WishRelated is the golang structure for table wish_related. -type WishRelated struct { - Id uint `json:"id" orm:"id" description:""` // - WishId int `json:"wishId" orm:"wish_id" description:"心愿ID"` // 心愿ID - NoticeId int `json:"noticeId" orm:"notice_id" description:"公告ID"` // 公告ID -} diff --git a/internal/model/entity/wish_state.go b/internal/model/entity/wish_state.go deleted file mode 100644 index 6c6442b..0000000 --- a/internal/model/entity/wish_state.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// WishState is the golang structure for table wish_state. -type WishState struct { - Id uint `json:"id" orm:"id" description:""` // - Language string `json:"language" orm:"language" description:""` // - Type int `json:"type" orm:"type" description:""` // - Name string `json:"name" orm:"name" description:""` // -} diff --git a/internal/model/entity/wish_translate.go b/internal/model/entity/wish_translate.go deleted file mode 100644 index b3a6dd3..0000000 --- a/internal/model/entity/wish_translate.go +++ /dev/null @@ -1,15 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// WishTranslate is the golang structure for table wish_translate. -type WishTranslate struct { - Id uint `json:"id" orm:"id" description:""` // - WishId int `json:"wishId" orm:"wish_id" description:""` // - SourceLanguage string `json:"sourceLanguage" orm:"source_language" description:""` // - TargetLanguage string `json:"targetLanguage" orm:"target_language" description:""` // - Title string `json:"title" orm:"title" description:""` // - Content string `json:"content" orm:"content" description:""` // -} diff --git a/internal/model/entity/wish_zan.go b/internal/model/entity/wish_zan.go deleted file mode 100644 index 542ccfc..0000000 --- a/internal/model/entity/wish_zan.go +++ /dev/null @@ -1,13 +0,0 @@ -// ================================================================================= -// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. -// ================================================================================= - -package entity - -// WishZan is the golang structure for table wish_zan. -type WishZan struct { - Id uint `json:"id" orm:"id" description:""` // - Jwcode int `json:"jwcode" orm:"jwcode" description:""` // - WishId int `json:"wishId" orm:"wish_id" description:""` // - CreatedAt string `json:"createdAt" orm:"created_at" description:""` // -} diff --git a/internal/service/vote.go b/internal/service/vote.go new file mode 100644 index 0000000..e4b7193 --- /dev/null +++ b/internal/service/vote.go @@ -0,0 +1,34 @@ +package service + +import ( + "VoteManage_Go/api/v1/vote" + "VoteManage_Go/internal/model/dto" + "context" + "github.com/gogf/gf/v2/net/ghttp" +) + +type ( + IVote interface { + //条件筛选 + GetVoteByCondition(ctx context.Context, req *vote.GetVoteDetailListReq) (votes []*dto.VoteDto, total int, err error) + // 导出拥有卡券的用户列表 + ExportVote(r *ghttp.Request, req *vote.GetVoteDetailListReq) + // 投票活动列表 + GetActivityList(ctx context.Context, req *vote.GetActivityListReq) (activityList []*dto.Activity, total int, err error) + } +) + +var ( + localVote IVote +) + +func Vote() IVote { + if localVote == nil { + panic("implement not found for interface ICoupon, forgot register?") + } + return localVote +} + +func RegisterVote(i IVote) { + localVote = i +} diff --git a/main.go b/main.go index b79b367..fca72b0 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,9 @@ package main import ( _ "VoteManage_Go/internal/packed" + _ "VoteManage_Go/internal/logic" + + _ "github.com/gogf/gf/contrib/drivers/mysql/v2" "github.com/gogf/gf/v2/os/gctx" "VoteManage_Go/internal/cmd" diff --git a/manifest/deploy/kustomize/base/deployment.yaml b/manifest/deploy/kustomize/base/deployment.yaml index 28f1d69..20e9818 100644 --- a/manifest/deploy/kustomize/base/deployment.yaml +++ b/manifest/deploy/kustomize/base/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: apps/vote kind: Deployment metadata: name: template-single diff --git a/manifest/deploy/kustomize/base/service.yaml b/manifest/deploy/kustomize/base/service.yaml index 608771c..1851ef6 100644 --- a/manifest/deploy/kustomize/base/service.yaml +++ b/manifest/deploy/kustomize/base/service.yaml @@ -1,4 +1,4 @@ -apiVersion: v1 +apiVersion: vote kind: Service metadata: name: template-single diff --git a/manifest/deploy/kustomize/overlays/develop/configmap.yaml b/manifest/deploy/kustomize/overlays/develop/configmap.yaml index 3b1d0af..83589e1 100644 --- a/manifest/deploy/kustomize/overlays/develop/configmap.yaml +++ b/manifest/deploy/kustomize/overlays/develop/configmap.yaml @@ -1,4 +1,4 @@ -apiVersion: v1 +apiVersion: vote kind: ConfigMap metadata: name: template-single-configmap diff --git a/manifest/deploy/kustomize/overlays/develop/deployment.yaml b/manifest/deploy/kustomize/overlays/develop/deployment.yaml index 04e4851..f70671d 100644 --- a/manifest/deploy/kustomize/overlays/develop/deployment.yaml +++ b/manifest/deploy/kustomize/overlays/develop/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: apps/vote kind: Deployment metadata: name: template-single