Browse Source

投票名单列表

master
maziyang 1 week ago
parent
commit
8d6eecc0da
  1. 19
      api/vote_record/v1/vote_record.go
  2. 1
      api/vote_record/vote_record.go
  3. 2
      hack/config.yaml
  4. 2
      internal/cmd/cmd.go
  5. 12
      internal/controller/vote_record/vote_record_v1_get_export_file.go
  6. 2
      internal/dao/internal/article.go
  7. 8
      internal/dao/internal/user.go
  8. 4
      internal/dao/internal/vote_poll.go
  9. 10
      internal/dao/internal/vote_record.go
  10. 64
      internal/logic/vote_record/get_export_file.go
  11. 10
      internal/logic/vote_record/get_index.go
  12. 6
      internal/logic/vote_record/get_vote.go
  13. 8
      internal/logic/vote_record/get_vote_detail.go
  14. 2
      internal/model/do/article.go
  15. 7
      internal/model/do/user.go
  16. 2
      internal/model/do/vote_poll.go
  17. 8
      internal/model/do/vote_record.go
  18. 2
      internal/model/entity/article.go
  19. 15
      internal/model/entity/user.go
  20. 2
      internal/model/entity/vote_poll.go
  21. 14
      internal/model/entity/vote_record.go
  22. 1
      internal/service/vote_record.go
  23. 10
      manifest/config/config.yaml

19
api/vote_record/v1/vote_record.go

@ -5,9 +5,16 @@ import (
"github.com/gogf/gf/v2/os/gtime" "github.com/gogf/gf/v2/os/gtime"
) )
type GetVoteDetailListRes struct {
VoteList []*GetVoteDetailRes `json:"voteList"`
TotalCount int `json:"totalCount"`
type GetExportFileReq struct {
g.Meta `path:"/getExportVoteDetail" method:"get" tags:"获取投票名单列表"`
VoteId int `p:"voteId" v:"required" dc:"投票活动ID"`
Username string `p:"username" dc:"<用户名>"`
Account string `p:"account" dc:"<精网号>"`
Area string `p:"area" dc:"地区"`
OptionContent string `p:"optionContent" dc:"<选项>"`
}
type GetExportFileRes struct {
VoteList []*GetVoteDetailRes `json:"voteList"`
} }
type GetVoteDetailReq struct { type GetVoteDetailReq struct {
g.Meta `path:"/getAllVoteDetail" method:"get" tags:"获取投票名单列表"` g.Meta `path:"/getAllVoteDetail" method:"get" tags:"获取投票名单列表"`
@ -16,6 +23,7 @@ type GetVoteDetailReq struct {
Size int `p:"size" dc:"每页数量" default:"50"` Size int `p:"size" dc:"每页数量" default:"50"`
Username string `p:"username" dc:"<用户名>"` Username string `p:"username" dc:"<用户名>"`
Account string `p:"account" dc:"<精网号>"` Account string `p:"account" dc:"<精网号>"`
Area string `p:"area" dc:"地区"`
OptionContent string `p:"optionContent" dc:"<选项>"` OptionContent string `p:"optionContent" dc:"<选项>"`
} }
@ -24,9 +32,14 @@ type GetVoteDetailRes struct {
Account string `json:"account" dc:"精网号"` Account string `json:"account" dc:"精网号"`
//VoteTitle string `json:"voteTitle" dc:"投票标题"` //VoteTitle string `json:"voteTitle" dc:"投票标题"`
//ArticleTitle string `json:"articleTitle" dc:"文章/视频标题"` //ArticleTitle string `json:"articleTitle" dc:"文章/视频标题"`
Area string `json:"area" dc:"地区"`
OptionContents string `json:"optionContents" dc:"选项名称"` OptionContents string `json:"optionContents" dc:"选项名称"`
CreateTime *gtime.Time `json:"createTime" dc:"投票时间"` CreateTime *gtime.Time `json:"createTime" dc:"投票时间"`
} }
type GetVoteDetailListRes struct {
VoteList []*GetVoteDetailRes `json:"voteList"`
TotalCount int `json:"totalCount"`
}
type GetVoteReq struct { type GetVoteReq struct {
g.Meta `path:"/getVote" method:"get" tags:"<获取文章及投票活动>"` g.Meta `path:"/getVote" method:"get" tags:"<获取文章及投票活动>"`
ArticleId int `p:"articleId" v:"required" dc:"<文章>ID"` ArticleId int `p:"articleId" v:"required" dc:"<文章>ID"`

1
api/vote_record/vote_record.go

@ -11,6 +11,7 @@ import (
) )
type IVoteRecordV1 interface { type IVoteRecordV1 interface {
GetExportFile(ctx context.Context, req *v1.GetExportFileReq) (res *v1.GetExportFileRes, err error)
GetVoteDetail(ctx context.Context, req *v1.GetVoteDetailReq) (res *v1.GetVoteDetailListRes, err error) GetVoteDetail(ctx context.Context, req *v1.GetVoteDetailReq) (res *v1.GetVoteDetailListRes, err error)
GetVote(ctx context.Context, req *v1.GetVoteReq) (res *v1.GetVoteRes, err error) GetVote(ctx context.Context, req *v1.GetVoteReq) (res *v1.GetVoteRes, err error)
GetIndex(ctx context.Context, req *v1.GetIndexReq) (res *v1.GetIndexRes, err error) GetIndex(ctx context.Context, req *v1.GetIndexReq) (res *v1.GetIndexRes, err error)

2
hack/config.yaml

@ -4,7 +4,7 @@
gfcli: gfcli:
gen: gen:
dao: dao:
- link: "mysql:root:root@tcp(127.0.0.1:3306)/link_test"
- link: "mysql:root:123456@tcp(127.0.0.1:3306)/link_test"
descriptionTag: true descriptionTag: true
docker: docker:

2
internal/cmd/cmd.go

@ -29,7 +29,7 @@ var (
s.Group("/", func(group *ghttp.RouterGroup) { s.Group("/", func(group *ghttp.RouterGroup) {
group.Middleware(ghttp.MiddlewareHandlerResponse) group.Middleware(ghttp.MiddlewareHandlerResponse)
group.Bind(article.ArticlecController)
group.Bind(article.ArticleController)
}) })
s.Group("/vote", func(group *ghttp.RouterGroup) { s.Group("/vote", func(group *ghttp.RouterGroup) {

12
internal/controller/vote_record/vote_record_v1_get_export_file.go

@ -0,0 +1,12 @@
package vote_record
import (
"context"
"practice_ArticleVote_Go/internal/service"
"practice_ArticleVote_Go/api/vote_record/v1"
)
func (c *ControllerV1) GetExportFile(ctx context.Context, req *v1.GetExportFileReq) (res *v1.GetExportFileRes, err error) {
return service.NewVoteRecordService().ExportVoteDetail(ctx, req)
}

2
internal/dao/internal/article.go

@ -22,7 +22,7 @@ type ArticleDao struct {
// ArticleColumns defines and stores column names for the table article. // ArticleColumns defines and stores column names for the table article.
type ArticleColumns struct { type ArticleColumns struct {
Id string // Id string //
UserId string // 用户ID
UserId string //
ArticleTitle string // 文章/视频标题 ArticleTitle string // 文章/视频标题
ArticleContent string // 文章/视频内容 ArticleContent string // 文章/视频内容
VoteStatus string // 是否发起投票:1发起,0不发起 VoteStatus string // 是否发起投票:1发起,0不发起

8
internal/dao/internal/user.go

@ -22,9 +22,10 @@ type UserDao struct {
// UserColumns defines and stores column names for the table user. // UserColumns defines and stores column names for the table user.
type UserColumns struct { type UserColumns struct {
Id string // Id string //
Account string // 精网号
Password string // 用户密码
Username string // 用户名
Account string //
Password string //
Username string //
Area string //
Status string // Status string //
CreateTime string // CreateTime string //
UpdateTime string // UpdateTime string //
@ -36,6 +37,7 @@ var userColumns = UserColumns{
Account: "account", Account: "account",
Password: "password", Password: "password",
Username: "username", Username: "username",
Area: "area",
Status: "status", Status: "status",
CreateTime: "create_time", CreateTime: "create_time",
UpdateTime: "update_time", UpdateTime: "update_time",

4
internal/dao/internal/vote_poll.go

@ -27,8 +27,8 @@ type VotePollColumns struct {
MultiOption string // 是否开启多选:1多选,0不多选 MultiOption string // 是否开启多选:1多选,0不多选
DeadlineTime string // 截止时间 DeadlineTime string // 截止时间
CreateTime string // CreateTime string //
UpdateTime string //
Status string // 投票活动状态:1:进行中,0已结束 Status string // 投票活动状态:1:进行中,0已结束
UpdateTime string //
} }
// votePollColumns holds the columns for the table vote_poll. // votePollColumns holds the columns for the table vote_poll.
@ -39,8 +39,8 @@ var votePollColumns = VotePollColumns{
MultiOption: "multi_option", MultiOption: "multi_option",
DeadlineTime: "deadline_time", DeadlineTime: "deadline_time",
CreateTime: "create_time", CreateTime: "create_time",
UpdateTime: "update_time",
Status: "status", Status: "status",
UpdateTime: "update_time",
} }
// NewVotePollDao creates and returns a new DAO object for table data access. // NewVotePollDao creates and returns a new DAO object for table data access.

10
internal/dao/internal/vote_record.go

@ -22,11 +22,11 @@ type VoteRecordDao struct {
// VoteRecordColumns defines and stores column names for the table vote_record. // VoteRecordColumns defines and stores column names for the table vote_record.
type VoteRecordColumns struct { type VoteRecordColumns struct {
Id string // Id string //
UserId string // 用户ID
VoteId string // 投票活动ID
OptionId string // 投票选项ID
VoteIndex string // 已投票次数
UserId string //
VoteId string //
OptionId string //
CreateTime string // CreateTime string //
VoteIndex string //
UpdateTime string // UpdateTime string //
} }
@ -36,8 +36,8 @@ var voteRecordColumns = VoteRecordColumns{
UserId: "user_id", UserId: "user_id",
VoteId: "vote_id", VoteId: "vote_id",
OptionId: "option_id", OptionId: "option_id",
VoteIndex: "vote_index",
CreateTime: "create_time", CreateTime: "create_time",
VoteIndex: "vote_index",
UpdateTime: "update_time", UpdateTime: "update_time",
} }

64
internal/logic/vote_record/get_export_file.go

@ -0,0 +1,64 @@
package vote_record
import (
"context"
"github.com/gogf/gf/v2/frame/g"
v1 "practice_ArticleVote_Go/api/vote_record/v1"
)
func (l *VoteRecordLogic) ExportVoteDetail(ctx context.Context, req *v1.GetExportFileReq) (res *v1.GetExportFileRes, err error) {
query := `
SELECT
u.username,
u.account,
u.area,
uv.option_contents,
uv.create_time
FROM (
SELECT
vr.user_id,
vr.vote_index,
DATE(vr.create_time) AS vote_date,
MAX(vr.create_time) AS create_time,
GROUP_CONCAT(o.option_content ORDER BY o.id SEPARATOR ',') AS option_contents
FROM vote_record vr
JOIN vote_option o
ON vr.option_id = o.id
WHERE vr.vote_id = ?
GROUP BY vr.user_id, vr.vote_index, vote_date
) AS uv
JOIN user u ON u.id = uv.user_id
WHERE 1=1
`
conditions := []interface{}{req.VoteId}
if req.OptionContent != "" {
query += " AND uv.option_contents LIKE ?"
conditions = append(conditions, "%"+req.OptionContent+"%")
}
if req.Username != "" {
query += " AND u.username LIKE ?"
conditions = append(conditions, "%"+req.Username+"%")
}
if req.Account != "" {
query += " AND u.account LIKE ?"
conditions = append(conditions, "%"+req.Account+"%")
}
if req.Area != "" {
query += " AND u.area LIKE ?"
conditions = append(conditions, "%"+req.Area+"%")
}
query += " ORDER BY uv.create_time DESC "
var voteList []*v1.GetVoteDetailRes
err = g.DB().Ctx(ctx).
Raw(query, conditions...).
Scan(&voteList)
if err != nil {
return nil, err
}
res = &v1.GetExportFileRes{
VoteList: voteList,
}
return res, err
}

10
internal/logic/vote_record/get_index.go

@ -2,6 +2,8 @@ package vote_record
import ( import (
"context" "context"
"fmt"
"github.com/gogf/gf/v2/frame/g"
v1 "practice_ArticleVote_Go/api/vote_record/v1" v1 "practice_ArticleVote_Go/api/vote_record/v1"
"practice_ArticleVote_Go/internal/consts" "practice_ArticleVote_Go/internal/consts"
"practice_ArticleVote_Go/internal/dao" "practice_ArticleVote_Go/internal/dao"
@ -11,6 +13,14 @@ import (
func (l *VoteRecordLogic) GetIndex(ctx context.Context, req *v1.GetIndexReq) (res *v1.GetIndexRes, err error) { func (l *VoteRecordLogic) GetIndex(ctx context.Context, req *v1.GetIndexReq) (res *v1.GetIndexRes, err error) {
today := time.Now().Format("2006-01-02") today := time.Now().Format("2006-01-02")
redis := g.Redis()
_, err = redis.Set(ctx, "key", "Hello, GoFrame!")
value, err := redis.Get(ctx, "key")
fmt.Println(value)
if err != nil {
fmt.Println("Set error:", err)
return
}
record, err := dao.VoteRecord. record, err := dao.VoteRecord.
Ctx(ctx). Ctx(ctx).
Fields("vote_index"). Fields("vote_index").

6
internal/logic/vote_record/get_vote.go

@ -58,10 +58,10 @@ func (l *VoteRecordLogic) GetVote(ctx context.Context, req *v1.GetVoteReq) (res
res.DeadlineTime = votePoll[dao.VotePoll.Columns().DeadlineTime].GTime() res.DeadlineTime = votePoll[dao.VotePoll.Columns().DeadlineTime].GTime()
res.ParticipationNumber = votePoll["totalCount"].Int() res.ParticipationNumber = votePoll["totalCount"].Int()
res.VotePollStatus = votePoll[dao.VotePoll.Columns().Status].Int() res.VotePollStatus = votePoll[dao.VotePoll.Columns().Status].Int()
if res.DeadlineTime.Before(gtime.Now()) && res.VotePollStatus != 0 {
res.VotePollStatus = 0
if res.DeadlineTime.Before(gtime.Now()) && res.VotePollStatus != 2 {
res.VotePollStatus = 2
_, err = dao.VotePoll.Ctx(ctx).Data(g.Map{ _, err = dao.VotePoll.Ctx(ctx).Data(g.Map{
dao.VotePoll.Columns().Status: 0,
dao.VotePoll.Columns().Status: 2,
}).WherePri(res.VoteId).Update() }).WherePri(res.VoteId).Update()
if err != nil { if err != nil {
return nil, err return nil, err

8
internal/logic/vote_record/get_vote_detail.go

@ -46,6 +46,7 @@ func (l *VoteRecordLogic) GetVoteDetail(ctx context.Context, req *v1.GetVoteDeta
SELECT SELECT
u.username, u.username,
u.account, u.account,
u.area,
uv.option_contents, uv.option_contents,
uv.create_time uv.create_time
FROM ( FROM (
@ -61,8 +62,7 @@ func (l *VoteRecordLogic) GetVoteDetail(ctx context.Context, req *v1.GetVoteDeta
WHERE vr.vote_id = ? WHERE vr.vote_id = ?
GROUP BY vr.user_id, vr.vote_index, vote_date GROUP BY vr.user_id, vr.vote_index, vote_date
) AS uv ) AS uv
JOIN ` + "`user`" + ` u
ON u.id = uv.user_id
JOIN user u ON u.id = uv.user_id
WHERE 1=1 WHERE 1=1
` `
@ -80,6 +80,10 @@ func (l *VoteRecordLogic) GetVoteDetail(ctx context.Context, req *v1.GetVoteDeta
query += " AND u.account LIKE ?" query += " AND u.account LIKE ?"
conditions = append(conditions, "%"+req.Account+"%") conditions = append(conditions, "%"+req.Account+"%")
} }
if req.Area != "" {
query += " AND u.area LIKE ?"
conditions = append(conditions, "%"+req.Area+"%")
}
countQuery := "SELECT COUNT(*) AS cnt FROM ( " + query + " ) AS subquery" countQuery := "SELECT COUNT(*) AS cnt FROM ( " + query + " ) AS subquery"
var cntResult struct{ Cnt int } var cntResult struct{ Cnt int }
err = g.DB().Ctx(ctx).Raw(countQuery, conditions...).Scan(&cntResult) err = g.DB().Ctx(ctx).Raw(countQuery, conditions...).Scan(&cntResult)

2
internal/model/do/article.go

@ -13,7 +13,7 @@ import (
type Article struct { type Article struct {
g.Meta `orm:"table:article, do:true"` g.Meta `orm:"table:article, do:true"`
Id interface{} // Id interface{} //
UserId interface{} // 用户ID
UserId interface{} //
ArticleTitle interface{} // 文章/视频标题 ArticleTitle interface{} // 文章/视频标题
ArticleContent interface{} // 文章/视频内容 ArticleContent interface{} // 文章/视频内容
VoteStatus interface{} // 是否发起投票:1发起,0不发起 VoteStatus interface{} // 是否发起投票:1发起,0不发起

7
internal/model/do/user.go

@ -13,9 +13,10 @@ import (
type User struct { type User struct {
g.Meta `orm:"table:user, do:true"` g.Meta `orm:"table:user, do:true"`
Id interface{} // Id interface{} //
Account interface{} // 精网号
Password interface{} // 用户密码
Username interface{} // 用户名
Account interface{} //
Password interface{} //
Username interface{} //
Area interface{} //
Status interface{} // Status interface{} //
CreateTime *gtime.Time // CreateTime *gtime.Time //
UpdateTime *gtime.Time // UpdateTime *gtime.Time //

2
internal/model/do/vote_poll.go

@ -18,6 +18,6 @@ type VotePoll struct {
MultiOption interface{} // 是否开启多选:1多选,0不多选 MultiOption interface{} // 是否开启多选:1多选,0不多选
DeadlineTime *gtime.Time // 截止时间 DeadlineTime *gtime.Time // 截止时间
CreateTime *gtime.Time // CreateTime *gtime.Time //
UpdateTime *gtime.Time //
Status interface{} // 投票活动状态:1:进行中,0已结束 Status interface{} // 投票活动状态:1:进行中,0已结束
UpdateTime *gtime.Time //
} }

8
internal/model/do/vote_record.go

@ -13,10 +13,10 @@ import (
type VoteRecord struct { type VoteRecord struct {
g.Meta `orm:"table:vote_record, do:true"` g.Meta `orm:"table:vote_record, do:true"`
Id interface{} // Id interface{} //
UserId interface{} // 用户ID
VoteId interface{} // 投票活动ID
OptionId interface{} // 投票选项ID
VoteIndex interface{} // 已投票次数
UserId interface{} //
VoteId interface{} //
OptionId interface{} //
CreateTime *gtime.Time // CreateTime *gtime.Time //
VoteIndex interface{} //
UpdateTime *gtime.Time // UpdateTime *gtime.Time //
} }

2
internal/model/entity/article.go

@ -11,7 +11,7 @@ import (
// Article is the golang structure for table article. // Article is the golang structure for table article.
type Article struct { type Article struct {
Id int64 `json:"id" orm:"id" description:""` // Id int64 `json:"id" orm:"id" description:""` //
UserId int64 `json:"userId" orm:"user_id" description:"用户ID"` // 用户ID
UserId int64 `json:"userId" orm:"user_id" description:""` //
ArticleTitle string `json:"articleTitle" orm:"article_title" description:"文章/视频标题"` // 文章/视频标题 ArticleTitle string `json:"articleTitle" orm:"article_title" description:"文章/视频标题"` // 文章/视频标题
ArticleContent string `json:"articleContent" orm:"article_content" description:"文章/视频内容"` // 文章/视频内容 ArticleContent string `json:"articleContent" orm:"article_content" description:"文章/视频内容"` // 文章/视频内容
VoteStatus int `json:"voteStatus" orm:"vote_status" description:"是否发起投票:1发起,0不发起"` // 是否发起投票:1发起,0不发起 VoteStatus int `json:"voteStatus" orm:"vote_status" description:"是否发起投票:1发起,0不发起"` // 是否发起投票:1发起,0不发起

15
internal/model/entity/user.go

@ -10,11 +10,12 @@ import (
// User is the golang structure for table user. // User is the golang structure for table user.
type User struct { type User struct {
Id int64 `json:"id" orm:"id" description:""` //
Account string `json:"account" orm:"account" description:"精网号"` // 精网号
Password string `json:"password" orm:"password" description:"用户密码"` // 用户密码
Username string `json:"username" orm:"username" description:"用户名"` // 用户名
Status uint `json:"status" orm:"status" description:""` //
CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:""` //
UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:""` //
Id int64 `json:"id" orm:"id" description:""` //
Account string `json:"account" orm:"account" description:""` //
Password string `json:"password" orm:"password" description:""` //
Username string `json:"username" orm:"username" description:""` //
Area string `json:"area" orm:"area" description:""` //
Status uint `json:"status" orm:"status" description:""` //
CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:""` //
UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:""` //
} }

2
internal/model/entity/vote_poll.go

@ -16,6 +16,6 @@ type VotePoll struct {
MultiOption int `json:"multiOption" orm:"multi_option" description:"是否开启多选:1多选,0不多选"` // 是否开启多选:1多选,0不多选 MultiOption int `json:"multiOption" orm:"multi_option" description:"是否开启多选:1多选,0不多选"` // 是否开启多选:1多选,0不多选
DeadlineTime *gtime.Time `json:"deadlineTime" orm:"deadline_time" description:"截止时间"` // 截止时间 DeadlineTime *gtime.Time `json:"deadlineTime" orm:"deadline_time" description:"截止时间"` // 截止时间
CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:""` // CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:""` //
UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:""` //
Status int `json:"status" orm:"status" description:"投票活动状态:1:进行中,0已结束"` // 投票活动状态:1:进行中,0已结束 Status int `json:"status" orm:"status" description:"投票活动状态:1:进行中,0已结束"` // 投票活动状态:1:进行中,0已结束
UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:""` //
} }

14
internal/model/entity/vote_record.go

@ -10,11 +10,11 @@ import (
// VoteRecord is the golang structure for table vote_record. // VoteRecord is the golang structure for table vote_record.
type VoteRecord struct { type VoteRecord struct {
Id int64 `json:"id" orm:"id" description:""` //
UserId int64 `json:"userId" orm:"user_id" description:"用户ID"` // 用户ID
VoteId int64 `json:"voteId" orm:"vote_id" description:"投票活动ID"` // 投票活动ID
OptionId int64 `json:"optionId" orm:"option_id" description:"投票选项ID"` // 投票选项ID
VoteIndex int `json:"voteIndex" orm:"vote_index" description:"已投票次数"` // 已投票次数
CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:""` //
UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:""` //
Id int64 `json:"id" orm:"id" description:""` //
UserId int64 `json:"userId" orm:"user_id" description:""` //
VoteId int64 `json:"voteId" orm:"vote_id" description:""` //
OptionId int64 `json:"optionId" orm:"option_id" description:""` //
CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:""` //
VoteIndex int `json:"voteIndex" orm:"vote_index" description:""` //
UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:""` //
} }

1
internal/service/vote_record.go

@ -7,6 +7,7 @@ import (
) )
type IVoteRecord interface { type IVoteRecord interface {
ExportVoteDetail(ctx context.Context, req *v1.GetExportFileReq) (res *v1.GetExportFileRes, err error)
GetIndex(ctx context.Context, req *v1.GetIndexReq) (res *v1.GetIndexRes, err error) GetIndex(ctx context.Context, req *v1.GetIndexReq) (res *v1.GetIndexRes, err error)
AddRecord(ctx context.Context, req *v1.AddRecordReq) (res *v1.AddRecordRes, err error) AddRecord(ctx context.Context, req *v1.AddRecordReq) (res *v1.AddRecordRes, err error)
GetVote(ctx context.Context, req *v1.GetVoteReq) (res *v1.GetVoteRes, err error) GetVote(ctx context.Context, req *v1.GetVoteReq) (res *v1.GetVoteRes, err error)

10
manifest/config/config.yaml

@ -15,3 +15,13 @@ database:
link: "mysql:root:123456@tcp(127.0.0.1:3306)/link_test" link: "mysql:root:123456@tcp(127.0.0.1:3306)/link_test"
createdAt: "create_time" createdAt: "create_time"
updatedAt: "update_time" updatedAt: "update_time"
redis:
default: # 默认实例,用于常规操作
address: "127.0.0.1:6379"
db: 0
password: ""
cache: # 缓存专用实例
address: "127.0.0.1:6379"
db: 1
password: ""
Loading…
Cancel
Save