Skip to content

Commit

Permalink
updates and add badoo
Browse files Browse the repository at this point in the history
  • Loading branch information
Xusifob committed Jan 6, 2020
1 parent bfef975 commit cca7c2e
Show file tree
Hide file tree
Showing 18 changed files with 1,085 additions and 174 deletions.
1 change: 1 addition & 0 deletions config/packages/lexik_jwt_authentication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ lexik_jwt_authentication:
secret_key: '%env(resolve:JWT_SECRET_KEY)%'
public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
pass_phrase: '%env(JWT_PASSPHRASE)%'
token_ttl: 2592000 #30 Days
Binary file added public/assets/images/badoo_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/bumble_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/assets/images/tinder_logo.jpg
Binary file not shown.
Binary file added public/assets/images/tinder_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 33 additions & 28 deletions src/Controller/ApiController.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Entity/Discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function jsonSerialize()
return array(
'appId' => $this->getAppId(),
'profile' => $this->getProfile(),
'createdDate' => $this->getCreatedDate()->format(\DateTime::ISO8601),
'createdDate' => $this->getCreatedDate() ? $this->getCreatedDate()->format(\DateTime::ISO8601) : null,
'messages' => $this->getMessages(),
'app' => $this->getApp(),
);
Expand Down
8 changes: 4 additions & 4 deletions src/Entity/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function setProfile(Profile $profile): void
*/
public function getContent()
{
return $this->content;
return trim($this->content);
}

/**
Expand Down Expand Up @@ -90,7 +90,7 @@ public function setAppId(string $appId): void
/**
* @return mixed
*/
public function getSentDate() : \DateTime
public function getSentDate() : ?\DateTime
{
return $this->sentDate;
}
Expand Down Expand Up @@ -138,8 +138,8 @@ public function jsonSerialize()
return array(
'appId' => $this->getAppId(),
'content' => $this->getContent(),
'profile' => $this->getProfile()->toArray('small'),
'sentDate' => $this->getSentDate()->format(\DateTime::ISO8601),
'profile' => $this->getProfile() ? $this->getProfile()->toArray('small') : array(),
'sentDate' => $this->getSentDate() ? $this->getSentDate()->format(\DateTime::ISO8601) : null,
'app' => $this->getApp(),
);
}
Expand Down
80 changes: 33 additions & 47 deletions src/Entity/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ class Profile extends Entity implements \JsonSerializable
*/
protected $bio;

/**
* @var string
* @ORM\Column(type="string", length=64,nullable=true)
*/
protected $jobTitle;

/**
* @var int
Expand All @@ -61,11 +56,6 @@ class Profile extends Entity implements \JsonSerializable
protected $distance;


/**
* @var string
* @ORM\Column(type="string", length=64,nullable=true)
*/
protected $school;


/**
Expand Down Expand Up @@ -94,6 +84,12 @@ class Profile extends Entity implements \JsonSerializable
*/
protected $appId;

/**
* @var array
* @ORM\Column(type="array")
*/
protected $profileFields = array();


/**
* @var User
Expand Down Expand Up @@ -178,23 +174,7 @@ public function setBio(?string $bio)
return $this;
}

/**
* @return string
*/
public function getJobTitle(): ?string
{
return $this->jobTitle;
}

/**
* @param string $jobTitle
*/
public function setJobTitle(?string $jobTitle)
{
$this->jobTitle = $jobTitle;

return $this;
}

/**
* @return int
Expand Down Expand Up @@ -301,25 +281,6 @@ public function setAppId(string $appId)
return $this;
}

/**
* @return string
*/
public function getSchool(): ?string
{
return $this->school;
}

/**
* @param string $school
*
* @return $this
*/
public function setSchool(?string $school)
{
$this->school = $school;

return $this;
}

/**
* @return array
Expand Down Expand Up @@ -377,6 +338,32 @@ public function setOwner(User $owner): void
$this->owner = $owner;
}

/**
* @return array
*/
public function getProfileFields(): array
{
return is_array($this->profileFields) ? $this->profileFields : array();
}

/**
* @param array $profileFields
*/
public function setProfileFields(array $profileFields): void
{
$this->profileFields = $profileFields;
}


/**
* @param string $key
* @param string $value
*/
public function addProfileField(string $key, string $value) : void
{
$this->profileFields[$key] = $value;
}


/**
* @param string $group
Expand Down Expand Up @@ -407,9 +394,8 @@ public function jsonSerialize()
'isFavorite' => $this->isFavorite(),
'pictures' => $this->getPictures(),
'distance' => $this->getDistance(),
'jobTitle' => $this->getJobTitle(),
'school' => $this->getSchool(),
'attributes' => $this->getAttributes(),
'profileFields' => $this->getProfileFields(),
);
}
}
68 changes: 48 additions & 20 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ class User extends Entity implements UserInterface, \JsonSerializable
*/
protected $tinder_token;

/**
* @ORM\Column(type="string", length=128,nullable=true)
*/
protected $bumble_refresh_token;

/**
* @ORM\Column(type="string", length=128,nullable=true)
*/
Expand All @@ -85,6 +80,21 @@ class User extends Entity implements UserInterface, \JsonSerializable
protected $next_super_like;


/**
* @var string
*
* @ORM\Column(type="string", length=64,nullable=true)
*/
protected $bumble_user_id;

/**
* @var string
*
* @ORM\Column(type="string", length=64,nullable=true)
*/
protected $badoo_user_id;



public function getSalt()
{
Expand Down Expand Up @@ -168,21 +178,6 @@ public function setTinderRefreshToken($tinder_refresh_token): void
$this->tinder_refresh_token = $tinder_refresh_token;
}

/**
* @return mixed
*/
public function getBumbleRefreshToken()
{
return $this->bumble_refresh_token;
}

/**
* @param mixed $bumble_refresh_token
*/
public function setBumbleRefreshToken($bumble_refresh_token): void
{
$this->bumble_refresh_token = $bumble_refresh_token;
}

/**
* @return mixed
Expand Down Expand Up @@ -282,6 +277,39 @@ public function setNextSuperLike($next_super_like): void
$this->next_super_like = $next_super_like;
}

/**
* @return string
*/
public function getBumbleUserId(): ?string
{
return $this->bumble_user_id;
}

/**
* @param string $bumble_user_id
*/
public function setBumbleUserId(?string $bumble_user_id): void
{
$this->bumble_user_id = $bumble_user_id;
}

/**
* @return string
*/
public function getBadooUserId(): ?string
{
return $this->badoo_user_id;
}

/**
* @param string $badoo_user_id
*/
public function setBadooUserId(?string $badoo_user_id): void
{
$this->badoo_user_id = $badoo_user_id;
}





Expand Down
37 changes: 37 additions & 0 deletions src/Migrations/Version20200103132841.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200103132841 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}

public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE profile ADD profile_fields LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', DROP job_title, DROP school');
$this->addSql('ALTER TABLE users DROP bumble_refresh_token');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE profile ADD job_title VARCHAR(64) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD school VARCHAR(64) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, DROP profile_fields');
$this->addSql('ALTER TABLE users ADD bumble_refresh_token VARCHAR(128) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
}
}
35 changes: 35 additions & 0 deletions src/Migrations/Version20200103155423.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200103155423 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}

public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE users ADD bumble_user_id VARCHAR(64) DEFAULT NULL');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE users DROP bumble_user_id');
}
}
35 changes: 35 additions & 0 deletions src/Migrations/Version20200105114304.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200105114304 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}

public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE users ADD badoo_user_id VARCHAR(64) DEFAULT NULL');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE users DROP badoo_user_id');
}
}
Loading

0 comments on commit cca7c2e

Please sign in to comment.