Compare commits

...
Author SHA1 Message Date
phoenix ec95780487 bump: textsender-models
Go Release / build-and-release (pull_request) Successful in 6s
Go CI / Test and Lint (pull_request) Successful in 7s
Go CI / Test and Lint (push) Successful in 17s
2026-05-27 22:57:50 -04:00
phoenix dc2eeb3bf8 go fmt 2026-05-27 22:56:52 -04:00
phoenix 446583d705 Whoops
Go CI / Test and Lint (push) Successful in 6s
Go Release / build-and-release (pull_request) Successful in 6s
Go CI / Test and Lint (pull_request) Successful in 6s
2026-05-27 22:56:03 -04:00
phoenix 8544a69eb1 Changing type of fields
Go Release / build-and-release (pull_request) Successful in 6s
Go CI / Test and Lint (pull_request) Failing after 7s
Go CI / Test and Lint (push) Failing after 17s
2026-05-27 22:55:31 -04:00
3 changed files with 31 additions and 32 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
run: | run: |
echo "Creating version" echo "Creating version"
VERSION="0.2.2" VERSION="0.2.3"
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10) PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
BRANCH_REF="${{ gitea.ref }}" BRANCH_REF="${{ gitea.ref }}"
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3) BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
+8 -8
View File
@@ -7,14 +7,14 @@ import (
) )
type User struct { type User struct {
Id uuid.UUID `json:"id"` Id uuid.UUID `json:"id"`
PhoneNumber string `json:"phone_number"` PhoneNumber string `json:"phone_number"`
Username string `json:"username"` Username string `json:"username"`
Password string `json:"password"` Password string `json:"password"`
// Firstname is a pointer // Firstname is a pointer
Firstname *string `json:"first_name,omitempty"` Firstname *string `json:"first_name,omitempty"`
// Lastname is a pointer // Lastname is a pointer
Lastname *string `json:"last_name,omitempty"` Lastname *string `json:"last_name,omitempty"`
Created time.Time `json:"created"` Created time.Time `json:"created"`
LastLogin *time.Time `json:"last_login,omitempty"` LastLogin *time.Time `json:"last_login,omitempty"`
} }
+22 -23
View File
@@ -7,36 +7,35 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
) )
// TODO: Replace Usr with all the fields from User, except Password and other sensitive fields
type UserProfile struct { type UserProfile struct {
UserId uuid.UUID `json:"user_id"` UserId uuid.UUID `json:"user_id"`
PhoneNumber string `json:"phone_number"` PhoneNumber string `json:"phone_number"`
Username string `json:"username"` Username string `json:"username"`
Firstname string `json:"firstname"` Firstname *string `json:"firstname,omitempty"`
Lastname string `json:"lastname"` Lastname *string `json:"lastname,omitempty"`
Created time.Time `json:"created"` Created time.Time `json:"created"`
LastLogin *time.Time `json:"last_login,omitempty"` LastLogin *time.Time `json:"last_login,omitempty"`
} }
func InitUserProfile(usr *User) (usrProfile *UserProfile, err error) { func InitUserProfile(usr *User) (usrProfile *UserProfile, err error) {
if usr == nil { if usr == nil {
return nil, fmt.Errorf("User is empty") return nil, fmt.Errorf("User is empty")
} else { } else {
usrProfile = new(UserProfile) usrProfile = new(UserProfile)
usrProfile.UserId = usr.Id usrProfile.UserId = usr.Id
usrProfile.PhoneNumber = usr.PhoneNumber usrProfile.PhoneNumber = usr.PhoneNumber
usrProfile.Username = usr.Username usrProfile.Username = usr.Username
if usr.Firstname != nil { if usr.Firstname != nil {
usrProfile.Firstname = *usr.Firstname usrProfile.Firstname = usr.Firstname
} }
if usr.Lastname != nil { if usr.Lastname != nil {
usrProfile.Lastname = *usr.Lastname usrProfile.Lastname = usr.Lastname
} }
usrProfile.Created = usr.Created usrProfile.Created = usr.Created
if usr.LastLogin != nil { if usr.LastLogin != nil {
usrProfile.LastLogin = usr.LastLogin usrProfile.LastLogin = usr.LastLogin
} }
return usrProfile, nil return usrProfile, nil
} }
} }