-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes for mobile apps (agent & cus-regs) (#13)
* required changes for mobile apps (agent & cus-regs) * apply requested changes * apply requested changes
- Loading branch information
1 parent
169b5f0
commit c85f9aa
Showing
23 changed files
with
355 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,54 @@ | ||
server { | ||
listen 80; | ||
server_name staging.micropowermanager.com; | ||
root /var/www/html/dist; | ||
index index.php index.html index.htm; | ||
include /etc/nginx/mime.types; | ||
|
||
location / { | ||
server { | ||
listen 80; | ||
server_tokens off; | ||
|
||
location /.well-known/acme-challenge/ { | ||
root /var/www/certbot; | ||
} | ||
location / { | ||
return 301 https://$host$request_uri; | ||
} | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
server_tokens off; | ||
|
||
ssl_certificate /etc/letsencrypt/live/demo.micropowermanager.com/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/demo.micropowermanager.com/privkey.pem; | ||
include /etc/letsencrypt/options-ssl-nginx.conf; | ||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; | ||
|
||
error_log /var/log/nginx/error.log; | ||
access_log /var/log/nginx/access.log; | ||
root /var/www/html/dist; | ||
index index.php index.html index.htm; | ||
|
||
|
||
location / { | ||
try_files $uri /index.html; | ||
} | ||
} | ||
|
||
location /api/ { | ||
location /tickets/ { | ||
try_files $uri /index.php?$args; | ||
gzip_static on; | ||
} | ||
location /tickets/ { | ||
|
||
location /api/ { | ||
try_files $uri /index.php?$args; | ||
gzip_static on; | ||
} | ||
location ~ \.php$ { | ||
} | ||
|
||
location ~ \.php$ { | ||
root /var/www/html/mpmanager/public; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_pass laravel:9000; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
} | ||
} | ||
fastcgi_buffer_size 128k; | ||
fastcgi_buffers 4 256k; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
Website/htdocs/mpmanager/app/Http/Controllers/CustomerRegistrationAppController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Http\Requests\AndroidAppRequest; | ||
use App\Http\Resources\ApiResource; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Log; | ||
use MPM\Apps\CustomerRegistration\CustomerRegistrationAppService; | ||
|
||
class CustomerRegistrationAppController extends Controller | ||
{ | ||
|
||
public function __construct(private CustomerRegistrationAppService $customerRegistrationAppService) | ||
{ | ||
} | ||
|
||
public function store(AndroidAppRequest $request) | ||
{ | ||
try { | ||
DB::connection('shard')->beginTransaction(); | ||
$person = $this->customerRegistrationAppService->createCustomer($request); | ||
DB::connection('shard')->commit(); | ||
|
||
return ApiResource::make($person)->response()->setStatusCode(201); | ||
}catch (\Exception $e){ | ||
DB::connection('shard')->rollBack(); | ||
Log::critical('Error while adding new Customer', ['message' => $e->getMessage()]); | ||
throw new \Exception($e->getMessage()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.