Skip to content

Commit fbb8f60

Browse files
authored
Deprecate guild kind field (#38)
1 parent 184a017 commit fbb8f60

File tree

5 files changed

+5
-25
lines changed

5 files changed

+5
-25
lines changed

docs/openapi.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,8 @@
630630
},
631631
"kind": {
632632
"type": "string",
633-
"enum": [
634-
"Guild",
635-
"Clan"
636-
]
633+
"enum": [ "Guild" ],
634+
"deprecated": true
637635
},
638636
"population": {
639637
"type": "number",

handlers/getStatus.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
var initTime = time.Now()
14-
var version = "1.10.1"
14+
var version = "1.10.2"
1515

1616
func getStatus(w http.ResponseWriter, r *http.Request) {
1717
json.NewEncoder(w).Encode(map[string]interface{}{

models/GuildProfile.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "time"
55
type GuildProfile struct {
66
Name string `json:"name"`
77
Region string `json:"region,omitempty"`
8-
Kind string `json:"kind,omitempty"`
8+
Kind string `json:"kind,omitempty"` // Deprecated
99
CreatedOn *time.Time `json:"createdOn,omitempty"`
1010
Master *Profile `json:"master,omitempty"`
1111
Population uint8 `json:"population,omitempty"`

scraper/scrapeGuildSearch.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88

99
"bdo-rest-api/cache"
1010
"bdo-rest-api/models"
11-
"bdo-rest-api/translators"
1211
"bdo-rest-api/utils"
1312
)
1413

@@ -23,7 +22,7 @@ func scrapeGuildSearch(body *colly.HTMLElement, region, query string) {
2322
guildProfile := models.GuildProfile{
2423
Name: e.ChildText(".guild_title a"),
2524
Region: region,
26-
Kind: e.ChildText(".tag_label.guild_label"),
25+
Kind: "Guild", // TODO: Remove this deprecated field
2726
Master: &models.Profile{
2827
FamilyName: e.ChildText(".guild_info a"),
2928
ProfileTarget: extractProfileTarget(e.ChildAttr(".guild_info a", "href")),
@@ -35,10 +34,6 @@ func scrapeGuildSearch(body *colly.HTMLElement, region, query string) {
3534
guildProfile.Region = e.ChildText(".region_info")
3635
}
3736

38-
if region != "EU" && region != "NA" {
39-
translators.TranslateGuildKind(&guildProfile.Kind)
40-
}
41-
4237
if membersStr := e.ChildText(".member"); true {
4338
population, _ := strconv.Atoi(membersStr)
4439
guildProfile.Population = uint8(population)

translators/TranslateGuildKind.go

-13
This file was deleted.

0 commit comments

Comments
 (0)