some progress in sms panel changes
This commit is contained in:
parent
b72981b103
commit
3c1dfd7d0d
|
@ -14,6 +14,7 @@ use App\Entity\StoreroomTicket;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Entity\WalletTransaction;
|
use App\Entity\WalletTransaction;
|
||||||
use App\Service\Jdate;
|
use App\Service\Jdate;
|
||||||
|
use App\Service\JsonResp;
|
||||||
use App\Service\Notification;
|
use App\Service\Notification;
|
||||||
use App\Service\Provider;
|
use App\Service\Provider;
|
||||||
use App\Service\registryMGR;
|
use App\Service\registryMGR;
|
||||||
|
@ -199,6 +200,9 @@ class AdminController extends AbstractController
|
||||||
{
|
{
|
||||||
|
|
||||||
$resp = [];
|
$resp = [];
|
||||||
|
$resp['username'] = $registryMGR->get('sms','username');
|
||||||
|
$resp['password'] = $registryMGR->get('sms','password');
|
||||||
|
$resp['token'] = $registryMGR->get('sms','token');
|
||||||
$resp['walletpay'] = $registryMGR->get('sms','walletPay');
|
$resp['walletpay'] = $registryMGR->get('sms','walletPay');
|
||||||
$resp['changePassword'] = $registryMGR->get('sms','changePassword');
|
$resp['changePassword'] = $registryMGR->get('sms','changePassword');
|
||||||
$resp['f2a'] = $registryMGR->get('sms','f2a');
|
$resp['f2a'] = $registryMGR->get('sms','f2a');
|
||||||
|
@ -210,6 +214,41 @@ class AdminController extends AbstractController
|
||||||
return $this->json($resp);
|
return $this->json($resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/api/admin/sms/plan/info/save', name: 'admin_sms_plan_info_save')]
|
||||||
|
public function admin_sms_plan_info_save(registryMGR $registryMGR,Jdate $jdate,#[CurrentUser] ?User $user,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response
|
||||||
|
{
|
||||||
|
$params = [];
|
||||||
|
if ($content = $request->getContent()) {
|
||||||
|
$params = json_decode($content, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(array_key_exists('username',$params))
|
||||||
|
$registryMGR->update('sms','username',$params['username']);
|
||||||
|
if(array_key_exists('password',$params))
|
||||||
|
$registryMGR->update('sms','password',$params['password']);
|
||||||
|
if(array_key_exists('token',$params))
|
||||||
|
$registryMGR->update('sms','token',$params['token']);
|
||||||
|
|
||||||
|
if(array_key_exists('walletpay',$params))
|
||||||
|
$registryMGR->update('sms','walletpay',$params['walletpay']);
|
||||||
|
if(array_key_exists('changePassword',$params))
|
||||||
|
$registryMGR->update('sms','changePassword',$params['changePassword']);
|
||||||
|
if(array_key_exists('f2a',$params))
|
||||||
|
$registryMGR->update('sms','f2a',$params['f2a']);
|
||||||
|
if(array_key_exists('ticketReplay',$params))
|
||||||
|
$registryMGR->update('sms','ticketReplay',$params['ticketReplay']);
|
||||||
|
if(array_key_exists('ticketRec',$params))
|
||||||
|
$registryMGR->update('sms','ticketRec',$params['ticketRec']);
|
||||||
|
if(array_key_exists('fromNum',$params))
|
||||||
|
$registryMGR->update('sms','fromNum',$params['fromNum']);
|
||||||
|
if(array_key_exists('sharefaktor',$params))
|
||||||
|
$registryMGR->update('sms','sharefaktor',$params['sharefaktor']);
|
||||||
|
if(array_key_exists('plan',$params))
|
||||||
|
$registryMGR->update('sms','plan',$params['plan']);
|
||||||
|
|
||||||
|
return $this->json(JsonResp::success());
|
||||||
|
}
|
||||||
|
|
||||||
#[Route('/api/admin/settings/system/info', name: 'admin_settings_system_info')]
|
#[Route('/api/admin/settings/system/info', name: 'admin_settings_system_info')]
|
||||||
public function admin_settings_system_info(Jdate $jdate,#[CurrentUser] ?User $user,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response
|
public function admin_settings_system_info(Jdate $jdate,#[CurrentUser] ?User $user,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response
|
||||||
{
|
{
|
||||||
|
@ -370,7 +409,7 @@ class AdminController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/api/admin/wallets/transactions/insert', name: 'app_admin_wallets_transactions_insert')]
|
#[Route('/api/admin/wallets/transactions/insert', name: 'app_admin_wallets_transactions_insert')]
|
||||||
public function app_admin_wallets_transactions_insert(SMS $SMS,Jdate $jdate,Notification $notification,Request $request,EntityManagerInterface $entityManager): JsonResponse
|
public function app_admin_wallets_transactions_insert(registryMGR $registryMGR, SMS $SMS,Jdate $jdate,Notification $notification,Request $request,EntityManagerInterface $entityManager): JsonResponse
|
||||||
{
|
{
|
||||||
$params = [];
|
$params = [];
|
||||||
if ($content = $request->getContent()) {
|
if ($content = $request->getContent()) {
|
||||||
|
@ -394,7 +433,11 @@ class AdminController extends AbstractController
|
||||||
$entityManager->persist($item);
|
$entityManager->persist($item);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
$notification->insert('تسویه کیف پول انجام شد.','/acc/wallet/view',$bid,$bid->getOwner());
|
$notification->insert('تسویه کیف پول انجام شد.','/acc/wallet/view',$bid,$bid->getOwner());
|
||||||
$SMS->send([$bid->getName()],174225,$bid->getOwner()->getMobile());
|
$SMS->send(
|
||||||
|
[$bid->getName()],
|
||||||
|
$registryMGR->get('sms','walletpay'),
|
||||||
|
$bid->getOwner()->getMobile()
|
||||||
|
);
|
||||||
return $this->json(['result' => 1]);
|
return $this->json(['result' => 1]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ use Symfony\Component\Security\Core\Exception\UserNotFoundException;
|
||||||
use Symfony\Component\Security\Http\Attribute\CurrentUser;
|
use Symfony\Component\Security\Http\Attribute\CurrentUser;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Security\EmailVerifier;
|
use App\Security\EmailVerifier;
|
||||||
|
use App\Service\registryMGR;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||||
use Symfony\Component\Form\FormError;
|
use Symfony\Component\Form\FormError;
|
||||||
|
@ -206,7 +207,7 @@ class UserController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/api/user/register', name: 'api_user_register')]
|
#[Route('/api/user/register', name: 'api_user_register')]
|
||||||
public function api_user_register(SMS $SMS,MailerInterface $mailer,Request $request, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager): Response
|
public function api_user_register(registryMGR $registryMGR,SMS $SMS,MailerInterface $mailer,Request $request, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$params = [];
|
$params = [];
|
||||||
if ($content = $request->getContent()) {
|
if ($content = $request->getContent()) {
|
||||||
|
@ -243,6 +244,11 @@ class UserController extends AbstractController
|
||||||
$entityManager->persist($user);
|
$entityManager->persist($user);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
$SMS->send([$user->getVerifyCode()],'162246',$user->getMobile());
|
$SMS->send([$user->getVerifyCode()],'162246',$user->getMobile());
|
||||||
|
$SMS->send(
|
||||||
|
[$user->getVerifyCode()],
|
||||||
|
$registryMGR->get('sms','f2a'),
|
||||||
|
$user->getMobile()
|
||||||
|
);
|
||||||
try {
|
try {
|
||||||
$email = (new Email())
|
$email = (new Email())
|
||||||
->to($user->getEmail())
|
->to($user->getEmail())
|
||||||
|
|
|
@ -14,11 +14,6 @@ class Settings
|
||||||
#[ORM\Column]
|
#[ORM\Column]
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
|
||||||
private ?string $payamakUsername = null;
|
|
||||||
|
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
|
||||||
private ?string $payamakPassword = null;
|
|
||||||
|
|
||||||
#[ORM\Column(nullable: true)]
|
#[ORM\Column(nullable: true)]
|
||||||
private ?bool $activeSendSms = null;
|
private ?bool $activeSendSms = null;
|
||||||
|
@ -32,9 +27,6 @@ class Settings
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $storagePrice = null;
|
private ?string $storagePrice = null;
|
||||||
|
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
|
||||||
private ?string $melipayamakToken = null;
|
|
||||||
|
|
||||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||||
private ?string $siteKeywords = null;
|
private ?string $siteKeywords = null;
|
||||||
|
|
||||||
|
@ -58,30 +50,6 @@ class Settings
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPayamakUsername(): ?string
|
|
||||||
{
|
|
||||||
return $this->payamakUsername;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setPayamakUsername(?string $payamakUsername): static
|
|
||||||
{
|
|
||||||
$this->payamakUsername = $payamakUsername;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPayamakPassword(): ?string
|
|
||||||
{
|
|
||||||
return $this->payamakPassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setPayamakPassword(?string $payamakPassword): static
|
|
||||||
{
|
|
||||||
$this->payamakPassword = $payamakPassword;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isActiveSendSms(): ?bool
|
public function isActiveSendSms(): ?bool
|
||||||
{
|
{
|
||||||
return $this->activeSendSms;
|
return $this->activeSendSms;
|
||||||
|
@ -130,18 +98,6 @@ class Settings
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMelipayamakToken(): ?string
|
|
||||||
{
|
|
||||||
return $this->melipayamakToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setMelipayamakToken(?string $melipayamakToken): static
|
|
||||||
{
|
|
||||||
$this->melipayamakToken = $melipayamakToken;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSiteKeywords(): ?string
|
public function getSiteKeywords(): ?string
|
||||||
{
|
{
|
||||||
return $this->siteKeywords;
|
return $this->siteKeywords;
|
||||||
|
|
|
@ -27,4 +27,8 @@ class JsonResp
|
||||||
'tempStatus' => $hesabdariDoc->getTempStatus(),
|
'tempStatus' => $hesabdariDoc->getTempStatus(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function success(){
|
||||||
|
return ['error'=>0];
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue