增加 emoji 表情计数字段
This commit is contained in:
		@@ -27,6 +27,11 @@ type Article struct {
 | 
				
			|||||||
	PraiseCount  int       `json:"praise_count"  gorm:"column:praise_num"`
 | 
						PraiseCount  int       `json:"praise_count"  gorm:"column:praise_num"`
 | 
				
			||||||
	CreateTime   time.Time `json:"create_time"   db:"create_time"`
 | 
						CreateTime   time.Time `json:"create_time"   db:"create_time"`
 | 
				
			||||||
	UpdateTime   time.Time `json:"update_time"   db:"update_time"`
 | 
						UpdateTime   time.Time `json:"update_time"   db:"update_time"`
 | 
				
			||||||
 | 
						Emoji1       int       `json:"emoji1"`
 | 
				
			||||||
 | 
						Emoji2       int       `json:"emoji2"`
 | 
				
			||||||
 | 
						Emoji3       int       `json:"emoji3"`
 | 
				
			||||||
 | 
						Emoji4       int       `json:"emoji4"`
 | 
				
			||||||
 | 
						Emoji5       int       `json:"emoji5"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (Article) TableName() string {
 | 
					func (Article) TableName() string {
 | 
				
			||||||
@@ -50,6 +55,11 @@ var articleType = graphql.NewObject(graphql.ObjectConfig{
 | 
				
			|||||||
		"collect":       &graphql.Field{Type: graphql.Boolean, Description: "当前用户是否收藏"},
 | 
							"collect":       &graphql.Field{Type: graphql.Boolean, Description: "当前用户是否收藏"},
 | 
				
			||||||
		"praise_count":  &graphql.Field{Type: graphql.Int, Description: "点赞数"},
 | 
							"praise_count":  &graphql.Field{Type: graphql.Int, Description: "点赞数"},
 | 
				
			||||||
		"collect_count": &graphql.Field{Type: graphql.Int, Description: "收藏数"},
 | 
							"collect_count": &graphql.Field{Type: graphql.Int, Description: "收藏数"},
 | 
				
			||||||
 | 
							"emoji1":        &graphql.Field{Type: graphql.Int, Description: "表情1数量"},
 | 
				
			||||||
 | 
							"emoji2":        &graphql.Field{Type: graphql.Int, Description: "表情2数量"},
 | 
				
			||||||
 | 
							"emoji3":        &graphql.Field{Type: graphql.Int, Description: "表情3数量"},
 | 
				
			||||||
 | 
							"emoji4":        &graphql.Field{Type: graphql.Int, Description: "表情4数量"},
 | 
				
			||||||
 | 
							"emoji5":        &graphql.Field{Type: graphql.Int, Description: "表情5数量"},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								api/game.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								api/game.go
									
									
									
									
									
								
							@@ -33,6 +33,11 @@ type Game struct {
 | 
				
			|||||||
	TextList     []string  `json:"text_list"     gorm:"-"`
 | 
						TextList     []string  `json:"text_list"     gorm:"-"`
 | 
				
			||||||
	CreateTime   time.Time `json:"create_time"`
 | 
						CreateTime   time.Time `json:"create_time"`
 | 
				
			||||||
	UpdateTime   time.Time `json:"update_time"`
 | 
						UpdateTime   time.Time `json:"update_time"`
 | 
				
			||||||
 | 
						Emoji1       int       `json:"emoji1"`
 | 
				
			||||||
 | 
						Emoji2       int       `json:"emoji2"`
 | 
				
			||||||
 | 
						Emoji3       int       `json:"emoji3"`
 | 
				
			||||||
 | 
						Emoji4       int       `json:"emoji4"`
 | 
				
			||||||
 | 
						Emoji5       int       `json:"emoji5"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (Game) TableName() string {
 | 
					func (Game) TableName() string {
 | 
				
			||||||
@@ -60,6 +65,11 @@ var gameType = graphql.NewObject(graphql.ObjectConfig{
 | 
				
			|||||||
		"collect_count": &graphql.Field{Type: graphql.Int, Description: "收藏数"},
 | 
							"collect_count": &graphql.Field{Type: graphql.Int, Description: "收藏数"},
 | 
				
			||||||
		"text_count":    &graphql.Field{Type: graphql.Int, Description: "文字数量"},
 | 
							"text_count":    &graphql.Field{Type: graphql.Int, Description: "文字数量"},
 | 
				
			||||||
		"text_list":     &graphql.Field{Type: graphql.NewList(graphql.String), Description: "文字列表"},
 | 
							"text_list":     &graphql.Field{Type: graphql.NewList(graphql.String), Description: "文字列表"},
 | 
				
			||||||
 | 
							"emoji1":        &graphql.Field{Type: graphql.Int, Description: "表情1数量"},
 | 
				
			||||||
 | 
							"emoji2":        &graphql.Field{Type: graphql.Int, Description: "表情2数量"},
 | 
				
			||||||
 | 
							"emoji3":        &graphql.Field{Type: graphql.Int, Description: "表情3数量"},
 | 
				
			||||||
 | 
							"emoji4":        &graphql.Field{Type: graphql.Int, Description: "表情4数量"},
 | 
				
			||||||
 | 
							"emoji5":        &graphql.Field{Type: graphql.Int, Description: "表情5数量"},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								api/image.go
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								api/image.go
									
									
									
									
									
								
							@@ -37,6 +37,11 @@ type Image struct {
 | 
				
			|||||||
	User         User      `json:"user" gorm:"foreignKey:UserID"`
 | 
						User         User      `json:"user" gorm:"foreignKey:UserID"`
 | 
				
			||||||
	Article      Article   `json:"article" gorm:"foreignKey:ArticleID"`
 | 
						Article      Article   `json:"article" gorm:"foreignKey:ArticleID"`
 | 
				
			||||||
	Activity     bool      `json:"activity"`
 | 
						Activity     bool      `json:"activity"`
 | 
				
			||||||
 | 
						Emoji1       int       `json:"emoji1"`
 | 
				
			||||||
 | 
						Emoji2       int       `json:"emoji2"`
 | 
				
			||||||
 | 
						Emoji3       int       `json:"emoji3"`
 | 
				
			||||||
 | 
						Emoji4       int       `json:"emoji4"`
 | 
				
			||||||
 | 
						Emoji5       int       `json:"emoji5"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (Image) TableName() string {
 | 
					func (Image) TableName() string {
 | 
				
			||||||
@@ -150,7 +155,12 @@ var imageType = graphql.NewObject(graphql.ObjectConfig{
 | 
				
			|||||||
				return p.Source.(Image).Text, nil
 | 
									return p.Source.(Image).Text, nil
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		"user": &graphql.Field{Type: userType, Description: "图像所属用户"},
 | 
							"user":   &graphql.Field{Type: userType, Description: "图像所属用户"},
 | 
				
			||||||
 | 
							"emoji1": &graphql.Field{Type: graphql.Int, Description: "表情1数量"},
 | 
				
			||||||
 | 
							"emoji2": &graphql.Field{Type: graphql.Int, Description: "表情2数量"},
 | 
				
			||||||
 | 
							"emoji3": &graphql.Field{Type: graphql.Int, Description: "表情3数量"},
 | 
				
			||||||
 | 
							"emoji4": &graphql.Field{Type: graphql.Int, Description: "表情4数量"},
 | 
				
			||||||
 | 
							"emoji5": &graphql.Field{Type: graphql.Int, Description: "表情5数量"},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								api/work.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								api/work.go
									
									
									
									
									
								
							@@ -29,6 +29,11 @@ type Work struct {
 | 
				
			|||||||
	PraiseCount  int       `json:"praise_count"  gorm:"column:praise_num"`
 | 
						PraiseCount  int       `json:"praise_count"  gorm:"column:praise_num"`
 | 
				
			||||||
	CreateTime   time.Time `json:"create_time"`
 | 
						CreateTime   time.Time `json:"create_time"`
 | 
				
			||||||
	UpdateTime   time.Time `json:"update_time"`
 | 
						UpdateTime   time.Time `json:"update_time"`
 | 
				
			||||||
 | 
						Emoji1       int       `json:"emoji1"`
 | 
				
			||||||
 | 
						Emoji2       int       `json:"emoji2"`
 | 
				
			||||||
 | 
						Emoji3       int       `json:"emoji3"`
 | 
				
			||||||
 | 
						Emoji4       int       `json:"emoji4"`
 | 
				
			||||||
 | 
						Emoji5       int       `json:"emoji5"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (Work) TableName() string {
 | 
					func (Work) TableName() string {
 | 
				
			||||||
@@ -49,6 +54,11 @@ var workType = graphql.NewObject(graphql.ObjectConfig{
 | 
				
			|||||||
		"collect":       &graphql.Field{Type: graphql.Boolean, Description: "当前用户是否收藏"},
 | 
							"collect":       &graphql.Field{Type: graphql.Boolean, Description: "当前用户是否收藏"},
 | 
				
			||||||
		"praise_count":  &graphql.Field{Type: graphql.Int, Description: "点赞数"},
 | 
							"praise_count":  &graphql.Field{Type: graphql.Int, Description: "点赞数"},
 | 
				
			||||||
		"collect_count": &graphql.Field{Type: graphql.Int, Description: "收藏数"},
 | 
							"collect_count": &graphql.Field{Type: graphql.Int, Description: "收藏数"},
 | 
				
			||||||
 | 
							"emoji1":        &graphql.Field{Type: graphql.Int, Description: "表情1数量"},
 | 
				
			||||||
 | 
							"emoji2":        &graphql.Field{Type: graphql.Int, Description: "表情2数量"},
 | 
				
			||||||
 | 
							"emoji3":        &graphql.Field{Type: graphql.Int, Description: "表情3数量"},
 | 
				
			||||||
 | 
							"emoji4":        &graphql.Field{Type: graphql.Int, Description: "表情4数量"},
 | 
				
			||||||
 | 
							"emoji5":        &graphql.Field{Type: graphql.Int, Description: "表情5数量"},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user