Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(changelog): add field seo to changelog #1344

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7696,6 +7696,9 @@ const docTemplate = `{
"product": {
"type": "string"
},
"seo_description": {
"type": "string"
},
"thumbnail_url": {
"type": "string"
},
Expand Down
3 changes: 3 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7688,6 +7688,9 @@
"product": {
"type": "string"
},
"seo_description": {
"type": "string"
},
"thumbnail_url": {
"type": "string"
},
Expand Down
2 changes: 2 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,8 @@ definitions:
type: string
product:
type: string
seo_description:
type: string
thumbnail_url:
type: string
title:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- +migrate Up
ALTER TABLE
product_changelogs
ADD
COLUMN seo_description TEXT;

-- +migrate Down
ALTER TABLE
product_changelogs DROP COLUMN seo_description;
4 changes: 3 additions & 1 deletion pkg/entities/product_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (

"github.com/bwmarrin/discordgo"
"github.com/consolelabs/mochi-typeset/typeset"
"github.com/defipod/mochi/pkg/kafka/message"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/ast"
"github.com/yuin/goldmark/text"
"gorm.io/gorm"

"github.com/defipod/mochi/pkg/kafka/message"
"github.com/defipod/mochi/pkg/logger"
"github.com/defipod/mochi/pkg/model"
"github.com/defipod/mochi/pkg/model/errors"
Expand Down Expand Up @@ -202,6 +202,8 @@ func (e *Entity) parseChangelogsContent(content string) *model.ProductChangelogs
changelogs.ThumbnailUrl = strings.TrimSpace(cRow[1])
case "field_version":
changelogs.Version = strings.TrimSpace(cRow[1])
case "seo_description":
changelogs.SeoDescription = strings.TrimSpace(cRow[1])
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/model/product_bot_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type ProductChangelogs struct {
FileName string `json:"file_name"`
IsExpired bool `json:"is_expired"`
Version string `json:"version"`
SeoDescription string `json:"seo_description"`
NextVersion string `json:"next_version" gorm:"-"`
PreviousVersion string `json:"previous_version" gorm:"-"`
CreatedAt time.Time `json:"created_at"`
Expand Down
Loading