binhonglee/GlobeTrotte

View on GitHub
src/wings/struct/new_user.wings

Summary

Maintainability
Test Coverage
go-filepath src/turbine/wings
ts-filepath src/cockpit/wings

ts-import { IWingsStruct }:wings-ts-util

ts-implement IWingsStruct

# Basic information for user registeration.

struct NewUser {
  id        int   -1
  username  str
  name      str
  email     str
  bio       str
  password  str
}

go-func(
  // GetID (istruct) - Returns the trip ID.
  func (newUser NewUser) GetID() int {
    return newUser.ID
  }

  // SetID (istruct) - Sets the trip ID.
  func (newUser *NewUser) SetID(id int) {
    newUser.ID = id
  }
)

ts-func(
    public register(data: any): void {
        this.name = data.name;
        this.username = data.username;
        this.email = data.email;
        this.password = data.password;
    }
)