Skip to content

Commit 2ebc441

Browse files
authored
Merge pull request #44 from Vercin-G/develop
Emergency Hotfix for broken API
2 parents 165e9a5 + a374fce commit 2ebc441

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

datastores/mysql.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func (ds Mysql) generateProtoProfile(profile milpacs.Profile) (*proto.Profile, e
161161
RankFull: profile.Rank.Title,
162162
RankImageUrl: profile.Rank.ImageURL(),
163163
},
164-
RealName: profile.RealName,
164+
RealName: profile.UnmarshalCustomFields().RealName,
165165
UniformUrl: profile.UniformUrl(),
166166
Roster: proto.RosterType(profile.RosterId),
167167
Primary: &proto.Position{
@@ -292,7 +292,7 @@ func (ds Mysql) generateLiteProtoProfile(profile milpacs.Profile) (*proto.LitePr
292292
RankFull: profile.Rank.Title,
293293
RankImageUrl: profile.Rank.ImageURL(),
294294
},
295-
RealName: profile.RealName,
295+
RealName: profile.UnmarshalCustomFields().RealName,
296296
UniformUrl: profile.UniformUrl(),
297297
Roster: proto.RosterType(profile.RosterId),
298298
Primary: &proto.Position{
@@ -380,7 +380,7 @@ func (ds Mysql) generateS1UniformsProtoProfile(profile milpacs.Profile) (*proto.
380380
RankFull: profile.Rank.Title,
381381
RankImageUrl: profile.Rank.ImageURL(),
382382
},
383-
RealName: profile.RealName,
383+
RealName: profile.UnmarshalCustomFields().RealName,
384384
UniformUrl: profile.UniformUrl(),
385385
UniformDate: getUniformDate(profile),
386386
UniformUpdateTriggerDate: getUniformUpdateTriggerDate(profile),

milpacs/profiles.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type Profile struct {
3232
RosterId uint64
3333
UserID uint64
3434
Username string
35-
RealName string
35+
//RealName string RealName is now a custom field
3636
PositionID uint64
3737
SecondaryPositionIds string
3838
RankID uint64
@@ -59,6 +59,7 @@ func (profile *Profile) UniformUrl() string {
5959
}
6060

6161
type CustomFields struct {
62+
RealName string `json:"realName"`
6263
JoinDate string `json:"joinDate"`
6364
PromoDate string `json:"promoDate"`
6465
ConsoleGamertag string `json:"consoleGamertag"`

servers/server.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ package servers
2020

2121
import (
2222
"fmt"
23+
"io"
24+
"log"
25+
"net"
26+
"net/http"
27+
"os"
28+
2329
"github.com/7cav/api/cache"
2430
"github.com/7cav/api/datastores"
2531
milpacs "github.com/7cav/api/proto"
@@ -30,14 +36,9 @@ import (
3036
"google.golang.org/grpc/grpclog"
3137
"gorm.io/driver/mysql"
3238
"gorm.io/gorm"
33-
"io"
34-
"log"
35-
"net"
36-
"net/http"
37-
"os"
3839
)
3940

40-
const version = "1.7.5"
41+
const version = "1.7.6"
4142

4243
type MicroServer struct {
4344
addr string

third_party/OpenAPI/milpacs.swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"swagger": "2.0",
33
"info": {
44
"title": "milpacs.proto",
5-
"version": "1.7.5"
5+
"version": "1.7.6"
66
},
77
"tags": [
88
{

0 commit comments

Comments
 (0)