userids and asset ids are uint64

This commit is contained in:
Quaternions 2024-12-10 19:18:04 -08:00
parent b49ae10a10
commit 3e58d75b87
3 changed files with 19 additions and 19 deletions

View File

@ -25,10 +25,10 @@ type Submission struct {
GameID int32
CreatedAt time.Time
UpdatedAt time.Time
Submitter int64 // UserID
AssetID int64
AssetVersion int64
Submitter uint64 // UserID
AssetID uint64
AssetVersion uint64
Completed bool // Has this version of the map been completed at least once on maptest
TargetAssetID int64 // where to upload map fix. if the TargetAssetID is 0, it's a new map.
TargetAssetID uint64 // where to upload map fix. if the TargetAssetID is 0, it's a new map.
StatusID Status
}

View File

@ -33,10 +33,10 @@ type Roles struct {
type UserInfo struct {
Roles Roles
UserID int64
UserID uint64
}
func (usr UserInfo) IsSubmitter(submitter int64) bool{
func (usr UserInfo) IsSubmitter(submitter uint64) bool{
return usr.UserID == submitter
}
@ -88,7 +88,7 @@ func (svc SecurityHandler) HandleCookieAuth(ctx context.Context, operationName a
newCtx := context.WithValue(ctx, "UserInfo", UserInfo{
Roles: roles,
UserID: int64(session.UserID),
UserID: session.UserID,
})
return newCtx, nil

View File

@ -25,11 +25,11 @@ func (svc *Service) CreateSubmission(ctx context.Context, request *api.Submissio
DisplayName: request.DisplayName,
Creator: request.Creator,
GameID: request.GameID,
Submitter: int64(userInfo.UserID),
AssetID: request.AssetID,
AssetVersion: request.AssetVersion,
Submitter: userInfo.UserID,
AssetID: uint64(request.AssetID),
AssetVersion: uint64(request.AssetVersion),
Completed: false,
TargetAssetID: request.TargetAssetID.Value,
TargetAssetID: uint64(request.TargetAssetID.Value),
StatusID: model.StatusUnderConstruction,
})
if err != nil{
@ -57,11 +57,11 @@ func (svc *Service) GetSubmission(ctx context.Context, params api.GetSubmissionP
GameID: submission.GameID,
CreatedAt: submission.CreatedAt.Unix(),
UpdatedAt: submission.UpdatedAt.Unix(),
Submitter: submission.Submitter,
AssetID: submission.AssetID,
AssetVersion: submission.AssetVersion,
Submitter: int64(submission.Submitter),
AssetID: int64(submission.AssetID),
AssetVersion: int64(submission.AssetVersion),
Completed: submission.Completed,
TargetAssetID: api.NewOptInt64(submission.TargetAssetID),
TargetAssetID: api.NewOptInt64(int64(submission.TargetAssetID)),
StatusID: int32(submission.StatusID),
}, nil
}
@ -97,11 +97,11 @@ func (svc *Service) ListSubmissions(ctx context.Context, request api.ListSubmiss
GameID: items[i].GameID,
CreatedAt: items[i].CreatedAt.Unix(),
UpdatedAt: items[i].UpdatedAt.Unix(),
Submitter: items[i].Submitter,
AssetID: items[i].AssetID,
AssetVersion: items[i].AssetVersion,
Submitter: int64(items[i].Submitter),
AssetID: int64(items[i].AssetID),
AssetVersion: int64(items[i].AssetVersion),
Completed: items[i].Completed,
TargetAssetID: api.NewOptInt64(items[i].TargetAssetID),
TargetAssetID: api.NewOptInt64(int64(items[i].TargetAssetID)),
StatusID: int32(items[i].StatusID),
})
}