Browse Source

gf框架搭建

master
maziyang 2 weeks ago
parent
commit
c8f56e6b09
  1. 4
      internal/dao/internal/vote_poll.go
  2. 2
      internal/model/do/vote_poll.go
  3. 2
      internal/model/entity/vote_poll.go
  4. 15
      manifest/config/config.yaml

4
internal/dao/internal/vote_poll.go

@ -22,7 +22,7 @@ type VotePollDao struct {
// VotePollColumns defines and stores column names for the table vote_poll.
type VotePollColumns struct {
Id string //
PostId string // 文章/视频ID
ArticleId string // 文章/视频ID
VoteTitle string // 投票活动标题
MultiOption string // 是否开启多选:1多选,0不多选
DeadlineTime string // 截止时间
@ -34,7 +34,7 @@ type VotePollColumns struct {
// votePollColumns holds the columns for the table vote_poll.
var votePollColumns = VotePollColumns{
Id: "id",
PostId: "post_id",
ArticleId: "article_id",
VoteTitle: "vote_title",
MultiOption: "multi_option",
DeadlineTime: "deadline_time",

2
internal/model/do/vote_poll.go

@ -13,7 +13,7 @@ import (
type VotePoll struct {
g.Meta `orm:"table:vote_poll, do:true"`
Id interface{} //
PostId interface{} // 文章/视频ID
ArticleId interface{} // 文章/视频ID
VoteTitle interface{} // 投票活动标题
MultiOption interface{} // 是否开启多选:1多选,0不多选
DeadlineTime *gtime.Time // 截止时间

2
internal/model/entity/vote_poll.go

@ -11,7 +11,7 @@ import (
// VotePoll is the golang structure for table vote_poll.
type VotePoll struct {
Id int64 `json:"id" orm:"id" description:""` //
PostId int64 `json:"postId" orm:"post_id" description:"文章/视频ID"` // 文章/视频ID
ArticleId int64 `json:"articleId" orm:"article_id" description:"文章/视频ID"` // 文章/视频ID
VoteTitle string `json:"voteTitle" orm:"vote_title" description:"投票活动标题"` // 投票活动标题
MultiOption int `json:"multiOption" orm:"multi_option" description:"是否开启多选:1多选,0不多选"` // 是否开启多选:1多选,0不多选
DeadlineTime *gtime.Time `json:"deadlineTime" orm:"deadline_time" description:"截止时间"` // 截止时间

15
manifest/config/config.yaml

@ -0,0 +1,15 @@
# https://goframe.org/docs/web/server-config-file-template
server:
address: ":8000"
openapiPath: "/api.json"
swaggerPath: "/swagger"
# https://goframe.org/docs/core/glog-config
logger:
level : "all"
stdout: true
# https://goframe.org/docs/core/gdb-config-file
database:
default:
link: "mysql:root:123456@tcp(127.0.0.1:3306)/link_test"
Loading…
Cancel
Save