.net9.0
This commit is contained in:
commit
f834fde1e4
Binary file not shown.
|
|
@ -0,0 +1,72 @@
|
|||
USE [OnlineAssessment]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[_drop_all_tables] Script Date: 8/22/2020 7:01:37 PM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
CREATE PROCEDURE [dbo].[_drop_all_tables]
|
||||
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
DECLARE @SQL NVARCHAR(MAX)
|
||||
DECLARE @SQL_DROP_TABLES NVARCHAR(MAX)
|
||||
DECLARE @TABLENAME SYSNAME
|
||||
DECLARE @FK_NAME SYSNAME
|
||||
DECLARE @OBJECT_ID BIGINT
|
||||
DECLARE @PARENT_ID BIGINT
|
||||
|
||||
DECLARE cursor_tables CURSOR
|
||||
FOR SELECT object_id, parent_object_id, name FROM sys.objects WHERE TYPE='U'
|
||||
|
||||
OPEN cursor_tables;
|
||||
|
||||
FETCH NEXT FROM cursor_tables INTO @OBJECT_ID, @PARENT_ID, @TABLENAME
|
||||
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
PRINT 'DROPING TABLE ====> ' + CAST(@TABLENAME AS varchar) + '@@PARENT_ID = ' + CAST(@PARENT_ID AS varchar) + '@@@OBJECT_ID = ' + CAST(@OBJECT_ID AS varchar);
|
||||
|
||||
|
||||
--REMOVE FOREIN KEYS BEFORE
|
||||
DECLARE cursor_fkeys CURSOR
|
||||
FOR SELECT name FROM sys.objects WHERE parent_object_id = @OBJECT_ID AND TYPE='F'
|
||||
|
||||
OPEN cursor_fkeys;
|
||||
FETCH NEXT FROM cursor_fkeys INTO @FK_NAME
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
SELECT @SQL = 'ALTER TABLE dbo.' + QUOTENAME(@TABLENAME) + ' DROP CONSTRAINT ' + @FK_NAME;
|
||||
EXEC sp_executesql @SQL;
|
||||
FETCH NEXT FROM cursor_fkeys INTO @FK_NAME;
|
||||
|
||||
END;
|
||||
|
||||
SELECT @SQL = 'DROP TABLE dbo.' + QUOTENAME(@TABLENAME) + '';
|
||||
EXEC sp_executesql @SQL;
|
||||
|
||||
CLOSE cursor_fkeys;
|
||||
|
||||
DEALLOCATE cursor_fkeys;
|
||||
PRINT 'DROPPED TABLE <=============================================================> '
|
||||
|
||||
--SELECT @SQL_DROP_TABLES = @SQL_DROP_TABLES + + CHAR(13)+CHAR(10) + 'DROP TABLE dbo.' + QUOTENAME(@TABLENAME) + '';
|
||||
|
||||
FETCH NEXT FROM cursor_tables INTO @OBJECT_ID, @PARENT_ID, @TABLENAME;
|
||||
END;
|
||||
|
||||
CLOSE cursor_tables;
|
||||
|
||||
DEALLOCATE cursor_tables;
|
||||
|
||||
|
||||
print @SQL_DROP_TABLES
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,3 @@
|
|||
USE odiproj1_oa
|
||||
|
||||
exec _drop_all_tables
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
--USE OnlineAssessment
|
||||
USE odiproj1_oa
|
||||
GO
|
||||
|
||||
--======================================================================================
|
||||
INSERT INTO Languages (code, name, created_by, updated_on, updated_by) VALUES
|
||||
('en','English',1,'2020-11-27T18:22:38.623',1),
|
||||
('od','Odia',1,'2020-11-27T18:22:38.623',1),
|
||||
('hi','Hindi',1,'2020-11-27T18:22:38.623',1),
|
||||
('ka','Kannada',1,'2020-11-27T18:22:38.623',1),
|
||||
('ta','Tamil',1,'2020-11-27T18:22:38.623',1),
|
||||
('te','Telugu',1,'2020-11-27T18:22:38.623',1),
|
||||
('be','Bengali',1,'2020-11-27T18:22:38.623',1),
|
||||
('ma','Malayallam',1,'2020-11-27T18:22:38.623',1),
|
||||
('gu','Gujrati',1,'2020-11-27T18:22:38.623',1),
|
||||
('mi','Marathi',1,'2020-11-27T18:22:38.623',1),
|
||||
('pu','Punjabi',1,'2020-11-27T18:22:38.623',1);
|
||||
|
||||
|
||||
|
||||
--======================================================================================
|
||||
set IDENTITY_INSERT States ON
|
||||
|
||||
INSERT INTO States (id,code,name, created_by, updated_on, updated_by) VALUES
|
||||
(1,'ANDAMAN AND NICOBAR ISLANDS', 'ANDAMAN AND NICOBAR ISLANDS',1,'2020-11-27T18:22:38.623',1),
|
||||
(2,'ANDHRA PRADESH', 'ANDHRA PRADESH',1,'2020-11-27T18:22:38.623',1),
|
||||
(3, 'ARUNACHAL PRADESH','ARUNACHAL PRADESH',1,'2020-11-27T18:22:38.623',1),
|
||||
(4,'ASSAM', 'ASSAM',1,'2020-11-27T18:22:38.623',1),
|
||||
(5, 'BIHAR','BIHAR',1,'2020-11-27T18:22:38.623',1),
|
||||
(6,'CHATTISGARH','CHATTISGARH',1,'2020-11-27T18:22:38.623',1),
|
||||
(7,'ODISHA', 'ODISHA',1,'2020-11-27T18:22:38.623',1);
|
||||
|
||||
set IDENTITY_INSERT States off;
|
||||
--======================================================================================
|
||||
|
||||
INSERT INTO Institutes (name, state_id, created_by, updated_on, updated_by) VALUES ('Odiware Technologies',7,1,'2020-11-27T18:22:38.623',1);
|
||||
--======================================================================================
|
||||
|
||||
INSERT INTO Plans (name) VALUES
|
||||
('Plan-1'),
|
||||
('Plan-2'),
|
||||
('Plan-3'),
|
||||
('Plan-4');
|
||||
|
||||
--======================================================================================
|
||||
INSERT INTO Subscriptions (institute_id, plan_id, name) VALUES (1, 1, 'Subsr');
|
||||
--======================================================================================
|
||||
INSERT INTO Roles (code, access_level, name) VALUES
|
||||
('SuperAdmin',1, 'Super Administrator'),
|
||||
('Admin',10, 'Administrator of the Institute'),
|
||||
('Teacher',100, 'Teaching Staff of the Institute'),
|
||||
('Student',200, 'Stuent of the Institute'),
|
||||
('Guest', 300,'General User of the Application');
|
||||
|
||||
--======================================================================================
|
||||
INSERT INTO QuestionTypes(code, name, created_by, updated_on, updated_by) VALUES
|
||||
('MCQ','Multiple Choice Questions',1,'2020-11-27T18:22:38.623',1),
|
||||
('MRQ','Multiple Response Questions',1,'2020-11-27T18:22:38.623',1),
|
||||
('TNF','True & False Questions',1,'2020-11-27T18:22:38.623',1),
|
||||
('SUB','Subjective Questions',1,'2020-11-27T18:22:38.623',1);
|
||||
|
||||
INSERT INTO ExamTypes(code, name) VALUES
|
||||
('Annual','Annual Examination'),
|
||||
('BiAnnual','Half Yearly Examination');
|
||||
|
||||
--=======================================================================================================
|
||||
INSERT INTO Users (role_id,institute_id,email_id,first_name, user_password, user_salt) VALUES
|
||||
(1, 1, 'sa@odiware.com','Chandra Sekhar','NvVqS5/OHFPAE1ekfpd8AQ==','1706e'),
|
||||
(2, 1, 'admin@odiware.com','Kishor Chandra','NvVqS5/OHFPAE1ekfpd8AQ==','1706e'),
|
||||
(3, 1, 'teacher@odiware.com','Sakti Prasanna','NvVqS5/OHFPAE1ekfpd8AQ==','1706e'),
|
||||
(4, 1, 'student@odiware.com','Amit Pattanaik','NvVqS5/OHFPAE1ekfpd8AQ==','1706e'),
|
||||
(5, 1, 'guest@odiware.com','Ranjan','NvVqS5/OHFPAE1ekfpd8AQ==','1706e'),
|
||||
(4, 1, 'pk@gmail.com','Puneet','NvVqS5/OHFPAE1ekfpd8AQ==','1706e'),
|
||||
(4, 1, 'ak@gmail.com','Alka','NvVqS5/OHFPAE1ekfpd8AQ==','1706e');
|
||||
|
||||
--=======================================================================================================
|
||||
|
||||
/*
|
||||
INSERT INTO Classes (institute_id,name,slug,created_on,created_by,updated_on,updated_by) VALUES
|
||||
(1,'RRB','rrb','2020-11-27T18:22:38.623',2,'2020-11-27T18:22:38.623',2),
|
||||
(1,'JEE','jee','2020-11-27T18:22:38.623',2,'2020-11-27T18:22:38.623',2),
|
||||
(1,'NTPC','ntpc','2020-11-27T18:22:38.623',2,'2020-11-27T18:22:38.623',2),
|
||||
(1,'UPSC','upsc','2020-11-27T18:22:38.623',2,'2020-11-27T18:22:38.623',2)
|
||||
|
||||
|
||||
INSERT INTO ClassLanguages (language_id,class_id,name,description) VALUES
|
||||
(1, 1, 'RRB', 'Railways Entrance'),
|
||||
(1, 2,'JEE', 'Engineering'),
|
||||
(1, 3, 'NTPC', 'National'),
|
||||
(1, 4, 'UPSC', 'Saptama sreni')
|
||||
|
||||
|
||||
INSERT INTO Subjects (class_id,name,slug,created_on,created_by,updated_on,updated_by) VALUES
|
||||
(1,'Arithmatic ability','arithmatic_ability','2020-11-27T18:22:38.623',2,'2020-11-27T18:22:38.623',2),
|
||||
(1,'English','english','2020-11-27T18:22:38.623',2,'2020-11-27T18:22:38.623',2),
|
||||
(1,'General awareness','general_awareness','2020-11-27T18:22:38.623',2,'2020-11-27T18:22:38.623',2),
|
||||
(1,'Reasoning','reasoning','2020-11-27T18:22:38.623',2,'2020-11-27T18:22:38.623',2);
|
||||
*/
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
--USE OnlineAssessment
|
||||
USE odiproj1_oa
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--INSERT INTO Institutes (name, state_id, created_by, updated_on, updated_by, domain) VALUES ('OTPL',7,1,'2020-11-27T18:22:38.623',1, 'otpl');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS dbo.ExamAttempts
|
||||
|
||||
CREATE TABLE dbo.ExamAttempts (
|
||||
[id] INT PRIMARY KEY IDENTITY (1, 1),
|
||||
[exam_id] INT NOT NULL,
|
||||
[remaining_time_seconds] INT NOT NULL,
|
||||
[score] INT,
|
||||
[average_time_seconds] INT,
|
||||
[status] VARCHAR(20) NOT NULL,
|
||||
[created_on] DATETIME DEFAULT GETDATE(),
|
||||
[created_by] INT NOT NULL,
|
||||
[updated_on] DATETIME NOT NULL,
|
||||
[updated_by] INT NOT NULL,
|
||||
[is_active] BIT DEFAULT (1),
|
||||
|
||||
CONSTRAINT FK_ExamAttempts_Exam FOREIGN KEY (exam_id) REFERENCES Exams (id)
|
||||
);
|
||||
GO
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
USE [SSASAP_NJLS]
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE FUNCTION [dbo].[fn_Split]
|
||||
(
|
||||
@Line nvarchar(MAX),
|
||||
@SplitOn nvarchar(5) = ','
|
||||
)
|
||||
RETURNS @RtnValue table
|
||||
(
|
||||
RowID INT NOT NULL IDENTITY(1,1) PRIMARY KEY CLUSTERED,
|
||||
Value varchar(100) NOT NULL
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
IF @Line IS NULL RETURN
|
||||
|
||||
DECLARE @split_on_len INT
|
||||
DECLARE @start_at INT
|
||||
DECLARE @end_at INT
|
||||
DECLARE @data_len INT
|
||||
DECLARE @Data varchar(100)
|
||||
set @split_on_len = LEN(@SplitOn)
|
||||
set @start_at = 1
|
||||
|
||||
WHILE 1=1
|
||||
BEGIN
|
||||
SET @end_at = CHARINDEX(@SplitOn,@Line,@start_at)
|
||||
SET @data_len = CASE @end_at WHEN 0 THEN LEN(@Line) ELSE @end_at-@start_at END
|
||||
INSERT INTO @RtnValue (Value) VALUES( SUBSTRING(@Line,@start_at,@data_len) );
|
||||
IF @end_at = 0 BREAK;
|
||||
SET @start_at = @end_at + @split_on_len
|
||||
END
|
||||
|
||||
RETURN
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
use Quiz
|
||||
go
|
||||
|
||||
SELECT
|
||||
[TableName] = so.name,
|
||||
[RowCount] = MAX(si.rows)
|
||||
FROM
|
||||
sysobjects so,
|
||||
sysindexes si
|
||||
WHERE
|
||||
so.xtype = 'U'
|
||||
AND
|
||||
si.id = OBJECT_ID(so.name)
|
||||
GROUP BY
|
||||
so.name
|
||||
ORDER BY
|
||||
2 DESC
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
use njls
|
||||
go
|
||||
|
||||
select * from
|
||||
(
|
||||
select
|
||||
name as name1,
|
||||
OBJECT_DEFINITION (object_id) as def,*
|
||||
from sys.all_objects
|
||||
--where type='P'
|
||||
) r
|
||||
where lower(r.def) like '%password%' -- '%bulkadd%'
|
||||
order by name1
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
SELECT *
|
||||
FROM USERS
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
SELECT
|
||||
CASE
|
||||
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '8%' THEN 'SQL2000'
|
||||
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '9%' THEN 'SQL2005'
|
||||
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '10.0%' THEN 'SQL2008'
|
||||
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '10.5%' THEN 'SQL2008 R2'
|
||||
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '11%' THEN 'SQL2012'
|
||||
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '12%' THEN 'SQL2014'
|
||||
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '13%' THEN 'SQL2016'
|
||||
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '14%' THEN 'SQL2017'
|
||||
WHEN CONVERT(VARCHAR(128), SERVERPROPERTY ('productversion')) like '15%' THEN 'SQL2019'
|
||||
ELSE 'unknown'
|
||||
END AS MajorVersion,
|
||||
SERVERPROPERTY('ProductLevel') AS ProductLevel,
|
||||
SERVERPROPERTY('Edition') AS Edition,
|
||||
SERVERPROPERTY('ProductVersion') AS ProductVersion
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectVersion>2.1</ProjectVersion>
|
||||
<DockerTargetOS>Linux</DockerTargetOS>
|
||||
<ProjectGuid>577dceb6-0c7e-4495-aa7e-9925b0af6fcf</ProjectGuid>
|
||||
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
|
||||
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}/swagger</DockerServiceUrl>
|
||||
<DockerServiceName>api.institute</DockerServiceName>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="docker-compose.override.yml">
|
||||
<DependentUpon>docker-compose.yml</DependentUpon>
|
||||
</None>
|
||||
<None Include="docker-compose.yml" />
|
||||
<None Include=".dockerignore" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
version: '3.4'
|
||||
|
||||
services:
|
||||
api.institute:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
ports:
|
||||
- "80"
|
||||
volumes:
|
||||
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
|
||||
api.teacher:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
ports:
|
||||
- "80"
|
||||
volumes:
|
||||
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
|
||||
|
||||
api.student:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
ports:
|
||||
- "80"
|
||||
volumes:
|
||||
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
|
||||
|
||||
api.user:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
ports:
|
||||
- "80"
|
||||
volumes:
|
||||
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
|
||||
|
||||
api.bucket:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
ports:
|
||||
- "80"
|
||||
volumes:
|
||||
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
|
||||
|
||||
api.admin:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
ports:
|
||||
- "80"
|
||||
volumes:
|
||||
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
|
||||
|
||||
api.gateway:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
ports:
|
||||
- "80"
|
||||
volumes:
|
||||
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
version: '3.4'
|
||||
|
||||
services:
|
||||
api.institute:
|
||||
image: ${DOCKER_REGISTRY-}apiinstitute
|
||||
build:
|
||||
context: .
|
||||
dockerfile: microservices/institute/Dockerfile
|
||||
|
||||
api.teacher:
|
||||
image: ${DOCKER_REGISTRY-}apiteacher
|
||||
build:
|
||||
context: .
|
||||
dockerfile: microservices/teacher/Dockerfile
|
||||
|
||||
|
||||
api.student:
|
||||
image: ${DOCKER_REGISTRY-}apistudent
|
||||
build:
|
||||
context: .
|
||||
dockerfile: microservices/student/Dockerfile
|
||||
|
||||
|
||||
api.user:
|
||||
image: ${DOCKER_REGISTRY-}apiuser
|
||||
build:
|
||||
context: .
|
||||
dockerfile: microservices/user/Dockerfile
|
||||
|
||||
|
||||
api.bucket:
|
||||
image: ${DOCKER_REGISTRY-}apibucket
|
||||
build:
|
||||
context: .
|
||||
dockerfile: microservices/S3Bucket/Dockerfile
|
||||
|
||||
api.admin:
|
||||
image: ${DOCKER_REGISTRY-}apiadmin
|
||||
build:
|
||||
context: .
|
||||
dockerfile: microservices/admin/Dockerfile
|
||||
|
||||
|
||||
api.gateway:
|
||||
image: ${DOCKER_REGISTRY-}apigateway
|
||||
build:
|
||||
context: .
|
||||
dockerfile: gateway/Dockerfile
|
||||
|
||||
sql-server-db:
|
||||
container_name: sql-server-db
|
||||
image: mcr.microsoft.com/mssql/server:2022-latest
|
||||
|
||||
ports:
|
||||
- "1433:1433"
|
||||
environment:
|
||||
SA_PASSWORD: "OdiOdi@1234"
|
||||
ACCEPT_EULA: "Y"
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,416 @@
|
|||
{
|
||||
"info": {
|
||||
"_postman_id": "392e7772-7681-457b-9556-213f876eb4e3",
|
||||
"name": "api.odiproject.com - Gateway",
|
||||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
||||
},
|
||||
"item": [
|
||||
{
|
||||
"name": "Users",
|
||||
"item": [
|
||||
{
|
||||
"name": "Create New User",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"roleId\": 1,\r\n \"instituteId\":1,\r\n \"languageId\": 1,\r\n \"registrationId\": 1,\r\n \"registrationDatetime\": \"2020-07-27T06:10:56.975Z\",\r\n \"firstName\": \"string\",\r\n \"lastName\": \"string\",\r\n \"dateOfBirth\": \"2020-07-27T06:10:56.975Z\",\r\n \"gender\": \"string\",\r\n \"emailId\": \"test1@gmail.com\",\r\n \"mobileNo\": \"string\",\r\n \"photo\": \"string\",\r\n \"address\": \"string\",\r\n \"city\": \"string\",\r\n \"stateId\": 26,\r\n \"pinCode\": \"string\",\r\n \"latitude\": \"string\",\r\n \"longitude\": \"string\",\r\n \"userPassword\": \"aaaa\"\r\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-user/v1/users",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-user",
|
||||
"v1",
|
||||
"users"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Sign In",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"EmailId\": \"sa@odiware.com\",\r\n \"UserPassword\": \"aaaa\"\r\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-user/v1/users/signin",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-user",
|
||||
"v1",
|
||||
"users",
|
||||
"signin"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get_One_User",
|
||||
"request": {
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"bearer": [
|
||||
{
|
||||
"key": "token",
|
||||
"value": "{{JWT_TOKEN}}",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJDaGFuZHJhIFNla2hhciBTdXBlckFkbWluIiwiZW1haWwiOiJzYUBvZGl3YXJlLmNvbSIsImp0aSI6ImQ4ZjMwMjIyLTMxZTUtNGY5Yi1iOTRiLWUwZWRlMjg3ZTkyMCIsIlVzZXJJZCI6IjEiLCJSb2xlSWQiOiIxIiwiSW5zdGl0dXRlSWQiOiIxIiwiZXhwIjoxNTk1ODE4MTU2LCJpc3MiOiJPZGl3YXJlIiwiYXVkIjoiT2Rpd2FyZSJ9.V258ykT8lKBhscsQFaK_cgLdPmrEXBYRr5nY2lMYgqg",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-user/v1/users/1012",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-user",
|
||||
"v1",
|
||||
"users",
|
||||
"1012"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "GetAll_Users",
|
||||
"request": {
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"bearer": [
|
||||
{
|
||||
"key": "token",
|
||||
"value": "{{JWT_TOKEN}}",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJLaXNob3IgQ2hhbmRyYSBBZG1pbiIsImVtYWlsIjoiYWRtaW5Ab2Rpd2FyZS5jb20iLCJqdGkiOiIwYjk3ZGJmZC04ODkzLTRjM2UtYmQ3ZS02YWQ5MTc3ZTI5N2UiLCJVc2VySWQiOiIyIiwiUm9sZUlkIjoiMiIsIkluc3RpdHV0ZUlkIjoiMSIsImV4cCI6MTU5NTkxNTQyMywiaXNzIjoiT2Rpd2FyZSIsImF1ZCI6Ik9kaXdhcmUifQ.W10oTLtJ3z2gdKfKv-Dc3uwMoKsSAwRNHKVEydX6w68",
|
||||
"type": "text",
|
||||
"disabled": true
|
||||
}
|
||||
],
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-user/v1/users",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-user",
|
||||
"v1",
|
||||
"users"
|
||||
],
|
||||
"query": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJLaXNob3IgQ2hhbmRyYSBBZG1pbiIsImVtYWlsIjoiYWRtaW5Ab2Rpd2FyZS5jb20iLCJqdGkiOiIwYjk3ZGJmZC04ODkzLTRjM2UtYmQ3ZS02YWQ5MTc3ZTI5N2UiLCJVc2VySWQiOiIyIiwiUm9sZUlkIjoiMiIsIkluc3RpdHV0ZUlkIjoiMSIsImV4cCI6MTU5NTkxNTQyMywiaXNzIjoiT2Rpd2FyZSIsImF1ZCI6Ik9kaXdhcmUifQ.W10oTLtJ3z2gdKfKv-Dc3uwMoKsSAwRNHKVEydX6w68",
|
||||
"disabled": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Update an user",
|
||||
"request": {
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"bearer": [
|
||||
{
|
||||
"key": "token",
|
||||
"value": "{{JWT_TOKEN}}",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"method": "PUT",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"Id\": 1012,\r\n \"roleId\": 2,\r\n \"instituteId\":1,\r\n \"languageId\": 1,\r\n \"registrationId\": 1,\r\n \"registrationDatetime\": \"2020-07-27T06:10:56.975Z\",\r\n \"firstName\": \"TEST NEW (KISHOR)\",\r\n \"lastName\": \"TRIPATHY\",\r\n \"dateOfBirth\": \"2020-07-27T06:10:56.975Z\",\r\n \"gender\": \"string\",\r\n \"emailId\": \"test1@gmail.com\",\r\n \"mobileNo\": \"string\",\r\n \"photo\": \"string\",\r\n \"address\": \"string\",\r\n \"city\": \"string\",\r\n \"stateId\": 26,\r\n \"pinCode\": \"string\",\r\n \"latitude\": \"string\",\r\n \"longitude\": \"string\",\r\n \"userPassword\": \"aaaa\"\r\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-user/v1/users/1012",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-user",
|
||||
"v1",
|
||||
"users",
|
||||
"1012"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Delete an user",
|
||||
"request": {
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"bearer": [
|
||||
{
|
||||
"key": "token",
|
||||
"value": "{{JWT_TOKEN}}",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"method": "DELETE",
|
||||
"header": [
|
||||
{
|
||||
"key": "",
|
||||
"value": "",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-user/v1/users/1002",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-user",
|
||||
"v1",
|
||||
"users",
|
||||
"1002"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
],
|
||||
"protocolProfileBehavior": {}
|
||||
},
|
||||
{
|
||||
"name": "Admin",
|
||||
"item": [
|
||||
{
|
||||
"name": "ExamTypes",
|
||||
"item": [
|
||||
{
|
||||
"name": "GetAll_ExamTyepes",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-admin/v1/examtypes",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-admin",
|
||||
"v1",
|
||||
"examtypes"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "GetAll_ExamTyepes_by_ID",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-admin/v1/examtypes/1",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-admin",
|
||||
"v1",
|
||||
"examtypes",
|
||||
"1"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "AddNew_ExamTyepes",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"code\": \"string 12 \",\r\n \"name\": \"string 12\",\r\n \"description\": \"string 12\",\r\n \"isActive\": true\r\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-admin/v1/examtypes",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-admin",
|
||||
"v1",
|
||||
"examtypes"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
],
|
||||
"protocolProfileBehavior": {},
|
||||
"_postman_isSubFolder": true
|
||||
},
|
||||
{
|
||||
"name": "GetAll_Institutes",
|
||||
"request": {
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"bearer": [
|
||||
{
|
||||
"key": "token",
|
||||
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJLaXNob3IgQ2hhbmRyYSBBZG1pbiIsImVtYWlsIjoiYWRtaW5Ab2Rpd2FyZS5jb20iLCJqdGkiOiIwYjk3ZGJmZC04ODkzLTRjM2UtYmQ3ZS02YWQ5MTc3ZTI5N2UiLCJVc2VySWQiOiIyIiwiUm9sZUlkIjoiMiIsIkluc3RpdHV0ZUlkIjoiMSIsImV4cCI6MTU5NTkxNTQyMywiaXNzIjoiT2Rpd2FyZSIsImF1ZCI6Ik9kaXdhcmUifQ.W10oTLtJ3z2gdKfKv-Dc3uwMoKsSAwRNHKVEydX6w68",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-admin/v1/institutes",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-admin",
|
||||
"v1",
|
||||
"institutes"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
],
|
||||
"protocolProfileBehavior": {}
|
||||
},
|
||||
{
|
||||
"name": "Institute",
|
||||
"item": [
|
||||
{
|
||||
"name": "GetAll_Institutes",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-institute/v1/Institutes/1/users",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-institute",
|
||||
"v1",
|
||||
"Institutes",
|
||||
"1",
|
||||
"users"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add New_Institutes",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "{{GATEWAY_API_URL}}/api-institute/v1/institutes",
|
||||
"host": [
|
||||
"{{GATEWAY_API_URL}}"
|
||||
],
|
||||
"path": [
|
||||
"api-institute",
|
||||
"v1",
|
||||
"institutes"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
],
|
||||
"protocolProfileBehavior": {}
|
||||
}
|
||||
],
|
||||
"event": [
|
||||
{
|
||||
"listen": "prerequest",
|
||||
"script": {
|
||||
"id": "1fe1b801-2d20-4fcd-82ef-5f31cedcd829",
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
""
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"id": "fe92aeff-c839-401d-b8a9-f8702191e257",
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"variable": [
|
||||
{
|
||||
"id": "d26274a9-cd96-4cc7-bb14-0686b54dbbcc",
|
||||
"key": "GATEWAY_API_URL",
|
||||
"value": "http://api.odiprojects.com"
|
||||
},
|
||||
{
|
||||
"id": "df75ef3b-0f94-4f71-b70f-b137a402e116",
|
||||
"key": "JWT_TOKEN",
|
||||
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJDaGFuZHJhIFNla2hhciBTdXBlckFkbWluIiwiZW1haWwiOiJzYUBvZGl3YXJlLmNvbSIsImp0aSI6IjczMmJhNTMyLTNiNzUtNGJhMC04NjRiLTU5ZDkyNGU1MGY3YyIsIlVzZXJJZCI6IjEiLCJSb2xlSWQiOiIxIiwiSW5zdGl0dXRlSWQiOiIxIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiU3VwZXJBZG1pbiIsImV4cCI6MTU5NjA3MDYyNSwiaXNzIjoiT2Rpd2FyZSIsImF1ZCI6Ik9kaXdhcmUifQ.duXAX-V37XDl9ADPLb5Ki8EHidMvmfoqYlnxRgEPftc"
|
||||
}
|
||||
],
|
||||
"protocolProfileBehavior": {}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "3.1.6",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<UserSecretsId>9c201306-d1c3-4367-972e-175cf4d4b941</UserSecretsId>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
|
||||
<PackageReference Include="Ocelot" Version="16.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
|
||||
WORKDIR /src
|
||||
COPY ["gateway/API.Gateway.csproj", "gateway/"]
|
||||
RUN dotnet restore "gateway/API.Gateway.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/gateway"
|
||||
RUN dotnet build "API.Gateway.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "API.Gateway.csproj" -c Release -o /app/publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "API.Gateway.dll"]
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace OnlineAssessment.Gateway
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
})
|
||||
.ConfigureAppConfiguration((hostingContext, config) =>
|
||||
{
|
||||
config
|
||||
.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath)
|
||||
.AddJsonFile(string.Format("appsettings{0}.json", (hostingContext.HostingEnvironment.EnvironmentName.Equals("Development") ? ".development" : "")), optional: false, reloadOnChange: true)
|
||||
.AddJsonFile(string.Format("ocelot{0}.json", (hostingContext.HostingEnvironment.EnvironmentName.Equals("Development") ? ".development" : "")), optional: false, reloadOnChange: true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish>http://api.odiprojects.com</SiteUrlToLaunchAfterPublish>
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<ProjectGuid>37885612-9a54-4cfe-8947-4aa74a052f57</ProjectGuid>
|
||||
<MSDeployServiceURL>https://api.odiprojects.com:8172/msdeploy.axd?site=api.odiprojects.com</MSDeployServiceURL>
|
||||
<DeployIisAppPath>api.odiprojects.com</DeployIisAppPath>
|
||||
<RemoteSitePhysicalPath />
|
||||
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
|
||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
||||
<UserName>odiproj1</UserName>
|
||||
<_SavePWD>True</_SavePWD>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<SelfContained>false</SelfContained>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:8000",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"OnlineAssessmentGateway": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:8000"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||
"publishAllPorts": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Ocelot.DependencyInjection;
|
||||
using Ocelot.Middleware;
|
||||
|
||||
namespace OnlineAssessment.Gateway
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddOcelot();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapGet("/", async context =>
|
||||
{
|
||||
await context.Response.WriteAsync(GetIndexPage());
|
||||
});
|
||||
});
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
await app.UseOcelot();
|
||||
}
|
||||
|
||||
public string GetIndexPage()
|
||||
{
|
||||
string indexPage = @"
|
||||
<div style='width: 80%; display: block; margin: 100px auto; border: none; text-align:center;font-family: arial'>
|
||||
<img style='height: 80px;' src='https://www.odiware.com/wp-content/uploads/2020/04/color_logo_transparent-scaled.jpg' srcset='https://www.odiware.com/wp-content/uploads/2020/04/color_logo_transparent-scaled.jpg 1x, https://www.odiware.com/wp-content/uploads/2020/04/color_logo_transparent-scaled.jpg 2x' alt='Odiware Technologies' class='logo logoDefault' />
|
||||
|
||||
<h3 style='color:green'>API Gateway (Online Assessment)</h3>
|
||||
<ul style='list-style-type:none;'>
|
||||
<li>
|
||||
User API <a href='http://api-user.odiprojects.com/swagger/index.html' target='_blank'>(api-user)</a>
|
||||
</li>
|
||||
<li style='height: 20px'> </li>
|
||||
<li>
|
||||
Admin API <a href='http://api-admin.odiprojects.com/swagger/index.html' target='_blank'>(api-admin)</a>
|
||||
</li>
|
||||
<li style='height: 20px'> </li>
|
||||
<li>
|
||||
Institute API <a href='http://api-institute.odiprojects.com/swagger/index.html' target='_blank'>(api-institute)</a>
|
||||
</li>
|
||||
<li style='height: 20px'> </li>
|
||||
<li>
|
||||
Student API <a href='http://api-student.odiprojects.com/swagger/index.html' target='_blank'>(api-institute)</a>
|
||||
</li>
|
||||
<li style='height: 20px'> </li>
|
||||
<li>
|
||||
Images API <a href='http://api-bucket.odiprojects.com/swagger/index.html' target='_blank'>(api-institute)</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
";
|
||||
return indexPage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<title>Odiware Technologies - API Gateway</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style='width: 600px; display: block; margin: 10px auto; border: solid 1px silver'>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='http://api-admin.odiprojects.com/swagger/index.html' target='_blank'>Admin API</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='http://api-institute.odiprojects.com/swagger/index.html' target='_blank'>Institute API</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='http://api-teacher.odiprojects.com/swagger/index.html' target='_blank'>Teacher API</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='http://api-user.odiprojects.com/swagger/index.html' target='_blank'>User API</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='http://api-exam.odiprojects.com/swagger/index.html' target='_blank'>Exam API</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
<img src='https://www.odiware.com/wp-content/uploads/2020/04/color_logo_transparent-scaled.jpg' srcset='https://www.odiware.com/wp-content/uploads/2020/04/color_logo_transparent-scaled.jpg 1x, https://www.odiware.com/wp-content/uploads/2020/04/color_logo_transparent-scaled.jpg 2x' alt='Odiware Technologies' class='logo logoDefault'>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"Routes": [
|
||||
//====================================================
|
||||
// APIS FOR AN ADMIN
|
||||
//====================================================
|
||||
{
|
||||
"DownstreamPathTemplate": "/api/v1/examtypes",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 8001
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/gateway/examtypes",
|
||||
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ]
|
||||
},
|
||||
{
|
||||
"DownstreamPathTemplate": "/api/v1/examtypes/{id}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 8001
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/gateway/examtypes/{id}",
|
||||
"UpstreamHttpMethod": [ "GET", "DELETE" ]
|
||||
},
|
||||
//====================================================
|
||||
// APIS FOR AN INSTITUTE
|
||||
//====================================================
|
||||
{
|
||||
"DownstreamPathTemplate": "/v1/users",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 8002
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/gateway/users",
|
||||
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ]
|
||||
}
|
||||
],
|
||||
"GlobalConfiguration": {
|
||||
"BaseUrl": "https://localhost:8000"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
{
|
||||
"Routes": [
|
||||
//====================================================
|
||||
// APIS FOR AN ADMIN
|
||||
//====================================================
|
||||
{
|
||||
"DownstreamPathTemplate": "/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "api-admin.odiprojects.com",
|
||||
"Port": 80
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/api-admin/{url}",
|
||||
"UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete", "Options" ],
|
||||
"Priority": 1,
|
||||
|
||||
"“AuthenticationOptions”": {
|
||||
"“AuthenticationProviderKey”": "IdentityApiKey",
|
||||
"“AllowedScopes”": []
|
||||
}
|
||||
},
|
||||
//====================================================
|
||||
// APIS FOR AN INSTITUTE
|
||||
//====================================================
|
||||
{
|
||||
"DownstreamPathTemplate": "/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "api-institute.odiprojects.com",
|
||||
"Port": 80
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/api-institute/{url}",
|
||||
"UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete", "Options" ],
|
||||
"Priority": 1
|
||||
},
|
||||
|
||||
|
||||
//====================================================
|
||||
// APIS FOR TEACHER
|
||||
//====================================================
|
||||
{
|
||||
"DownstreamPathTemplate": "/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "api-teacher.odiprojects.com",
|
||||
"Port": 80
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/api-teacher/{url}",
|
||||
"UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete", "Options" ],
|
||||
"Priority": 1
|
||||
},
|
||||
|
||||
//====================================================
|
||||
// APIS FOR AN USERS
|
||||
//====================================================
|
||||
{
|
||||
"DownstreamPathTemplate": "/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "api-user.odiprojects.com",
|
||||
"Port": 80
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/api-user/{url}",
|
||||
"UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete", "Options" ],
|
||||
"Priority": 1
|
||||
},
|
||||
//====================================================
|
||||
// APIS FOR S3BUCKET
|
||||
//====================================================
|
||||
{
|
||||
"DownstreamPathTemplate": "/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "api-bucket.odiprojects.com",
|
||||
"Port": 80
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/api-bucket/{url}",
|
||||
"UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete", "Options" ],
|
||||
"Priority": 1
|
||||
},
|
||||
|
||||
|
||||
//====================================================
|
||||
// APIS FOR STUDENT
|
||||
//====================================================
|
||||
{
|
||||
"DownstreamPathTemplate": "/{url}",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "api-student.odiprojects.com",
|
||||
"Port": 80
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/api-student/{url}",
|
||||
"UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete", "Options" ],
|
||||
"Priority": 1
|
||||
}
|
||||
|
||||
],
|
||||
"GlobalConfiguration": {
|
||||
"BaseUrl": "http://api.odiprojects.com"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<location path="." inheritInChildApplications="false">
|
||||
<system.webServer>
|
||||
<modules runAllManagedModulesForAllRequests="true">
|
||||
<remove name="WebDAVModule" />
|
||||
<!-- add this -->
|
||||
</modules>
|
||||
<handlers accessPolicy="Read, Execute, Script">
|
||||
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
|
||||
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="WebDAV" />
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<add name="aspNetCore" path="*" verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" />
|
||||
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
</handlers>
|
||||
<aspNetCore processPath="dotnet" arguments=".\API.Gateway.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
|
||||
</system.webServer>
|
||||
</location>
|
||||
</configuration>
|
||||
<!--ProjectGuid: 1b5442c0-5ab0-4c14-b7e7-300c86058073-->
|
||||
Binary file not shown.
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "6.0.1",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<Authors>Preet Parida</Authors>
|
||||
<Company>Odiware Technologies</Company>
|
||||
<Product>OnlineAssessment Web API</Product>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AssemblyName>API.Bucket</AssemblyName>
|
||||
<RootNamespace>API.Bucket</RootNamespace>
|
||||
<Platforms>AnyCPU;x86</Platforms>
|
||||
<UserSecretsId>ca763823-e93a-47d8-a5f0-5822278ae5bf</UserSecretsId>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>full</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin</OutputPath>
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
<DocumentationFile>bin\netcoreapp3.1\OnlineAssessment.xml</DocumentationFile>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
||||
<DebugType>full</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin</OutputPath>
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
<DocumentationFile>bin\netcoreapp3.1\OnlineAssessment.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>none</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<OutputPath>bin</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
||||
<DebugType>none</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<OutputPath>bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Logs\**" />
|
||||
<Content Remove="Logs\**" />
|
||||
<EmbeddedResource Remove="Logs\**" />
|
||||
<None Remove="Logs\**" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Content\custom.css" />
|
||||
<None Remove="Content\custom.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Content\custom.css">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Content\custom.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="11.0.0" />
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
|
||||
<PackageReference Include="AWSSDK.Core" Version="3.7.6.4" />
|
||||
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.1" />
|
||||
<PackageReference Include="AWSSDK.S3" Version="3.7.7.19" />
|
||||
<PackageReference Include="FluentValidation" Version="10.3.6" />
|
||||
<PackageReference Include="FluentValidation.AspNetCore" Version="10.3.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.1.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.6.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="files\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\_layers\common\Common.csproj" />
|
||||
<ProjectReference Include="..\_layers\data\Data.csproj" />
|
||||
<ProjectReference Include="..\_layers\domain\Domain.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#swagger-ui > section > div.topbar > div > div > form > label > span,
|
||||
.information-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.swagger-ui .opblock-tag {
|
||||
|
||||
background-image: linear-gradient(370deg, #f6f6f6 70%, #e9e9e9 4%);
|
||||
margin-top: 20px;
|
||||
margin-bottom: 5px;
|
||||
padding: 5px 10px !important;
|
||||
}
|
||||
|
||||
.swagger-ui .opblock-tag.no-desc span {
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.swagger-ui .info .title {
|
||||
font-size: 36px;
|
||||
margin: 0;
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
color: #0c4da1;
|
||||
}
|
||||
|
||||
.swagger-ui a.nostyle {
|
||||
color: navy !important;
|
||||
font-size: 0.9em !important;
|
||||
font-weight: normal !important;
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
}
|
||||
|
||||
#swagger-ui > section > div.topbar > div > div > a > img,
|
||||
img[alt="Swagger UI"] {
|
||||
display: block;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
content: url('/Content/logo.jpg');
|
||||
width: 154px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.swagger-ui .topbar {
|
||||
padding: 10px 0;
|
||||
background-color: #fff;
|
||||
color: navy;
|
||||
}
|
||||
.select-label {
|
||||
color: navy !important;
|
||||
}
|
||||
|
||||
.opblock-summary-description {
|
||||
font-size: 1em !important;
|
||||
color: navy !important;
|
||||
text-align:right;
|
||||
}
|
||||
pre.microlight {
|
||||
background-color: darkblue !important;
|
||||
}
|
||||
|
||||
span.model-box > div > span > span > span.inner-object > table > tbody > tr {
|
||||
border: solid 1px #ccc !important;
|
||||
padding: 5px 0px;
|
||||
}
|
||||
|
||||
.swagger-ui .topbar .download-url-wrapper .select-label select {
|
||||
border: solid 2px navy !important;
|
||||
}
|
||||
|
||||
.swagger-ui .opblock {
|
||||
margin: 2px 0px !important;
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
(function () {
|
||||
window.addEventListener("load", function () {
|
||||
setTimeout(function () {
|
||||
//Setting the title
|
||||
document.title = "Odiware Online Assessment (Examination Management System) RESTful Web API";
|
||||
|
||||
//var logo = document.getElementsByClassName('link');
|
||||
//logo[0].children[0].alt = "Logo";
|
||||
//logo[0].children[0].src = "/logo.png";
|
||||
|
||||
//Setting the favicon
|
||||
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
|
||||
link.type = 'image/png';
|
||||
link.rel = 'icon';
|
||||
link.href = 'https://www.odiware.com/wp-content/uploads/2020/04/logo-150x150.png';
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
|
||||
//Setting the meta tag - description
|
||||
var link = document.createElement('meta');
|
||||
link.setAttribute('name', 'description');
|
||||
link.content = 'Odiware Online Assessment (Examination Management) System - RESTful Web API';
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
|
||||
var link1 = document.createElement('meta');
|
||||
link1.setAttribute('name', 'keywords');
|
||||
link1.content = 'Odiware, Odiware Technologies, Examination Management, .Net Core Web API, Banaglore IT Company';
|
||||
document.getElementsByTagName('head')[0].appendChild(link1);
|
||||
|
||||
var link2 = document.createElement('meta');
|
||||
link2.setAttribute('name', 'author');
|
||||
link2.content = 'Chandra Sekhar Samal, Preet Parida, Shakti Pattanaik, Amit Pattanaik & Kishor Tripathy for Odiware Technologies';
|
||||
document.getElementsByTagName('head')[0].appendChild(link2);
|
||||
|
||||
var link3 = document.createElement('meta');
|
||||
link3.setAttribute('name', 'revised');
|
||||
link3.content = 'Odiware Technologies, 13 July 2020';
|
||||
document.getElementsByTagName('head')[0].appendChild(link3);
|
||||
});
|
||||
});
|
||||
})();
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
|
|
@ -0,0 +1,188 @@
|
|||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using OnlineAssessment.Models;
|
||||
using OnlineAssessment.Services;
|
||||
using System.Threading.Tasks;
|
||||
using OnlineAssessment.Common;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
|
||||
namespace OnlineAssessment.Controllers
|
||||
{
|
||||
[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
[EnableCors("OdiwarePolicy")]
|
||||
public class AWSS3FileController : ControllerBase
|
||||
{
|
||||
private readonly IAWSS3FileService _AWSS3FileService;
|
||||
public AWSS3FileController(IAWSS3FileService AWSS3FileService)
|
||||
{
|
||||
this._AWSS3FileService = AWSS3FileService;
|
||||
}
|
||||
[Route("uploadFile")]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> UploadFileAsync(string uploadFileName)
|
||||
{
|
||||
var result = await _AWSS3FileService.UploadFile(uploadFileName);
|
||||
return Ok(new { isSucess = result });
|
||||
}
|
||||
|
||||
/*
|
||||
[Route("uploadMyPic")]
|
||||
[HttpPost]
|
||||
[Authorize(Roles = "Admin,Teacher,Student")]
|
||||
public async Task<IActionResult> UploadProfileImageAsync([FromBody] UploadFilePath uploadFilePath)
|
||||
{
|
||||
int user_id = Security.GetIdFromJwtToken(UserClaim.UserId, HttpContext.User.Identity as ClaimsIdentity);
|
||||
int institute_id = int.Parse(Security.GetValueFromToken("InstituteId", HttpContext.User.Identity as ClaimsIdentity));
|
||||
var result = await _AWSS3FileService.UploadProfileImage(institute_id, user_id, uploadFilePath.file_path);
|
||||
return Ok(new { isSucess = result });
|
||||
}
|
||||
*/
|
||||
|
||||
[Route("uploadMyPic")]
|
||||
[HttpPost]
|
||||
[Authorize(Roles = "Admin,Teacher,Student")]
|
||||
public async Task<IActionResult> UploadProfileImageAsync(IFormFile file)
|
||||
{
|
||||
IActionResult returnResponse = null;
|
||||
|
||||
int user_id = Security.GetIdFromJwtToken(UserClaim.UserId, HttpContext.User.Identity as ClaimsIdentity);
|
||||
int institute_id = int.Parse(Security.GetValueFromToken("InstituteId", HttpContext.User.Identity as ClaimsIdentity));
|
||||
dynamic result = await _AWSS3FileService.UploadProfileImage(institute_id, user_id, file);
|
||||
|
||||
if (result is bool && result == true)
|
||||
{
|
||||
returnResponse = Ok(ReturnResponse.GetSuccessStatus(result));
|
||||
}
|
||||
|
||||
else if (result is bool && result == false)
|
||||
{
|
||||
returnResponse = Ok(ReturnResponse.GetFailureStatus(result));
|
||||
}
|
||||
else if (result is string)
|
||||
{
|
||||
returnResponse = Ok(ReturnResponse.GetFailureStatus(result));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
returnResponse = Ok(ReturnResponse.GetFailureStatus(result));
|
||||
}
|
||||
|
||||
return returnResponse;
|
||||
}
|
||||
|
||||
[Route("{exam_id}/uploadExamImage")]
|
||||
[HttpPost]
|
||||
[Authorize(Roles = "Admin,Teacher")]
|
||||
public async Task<IActionResult> UploadExamImageAsync(int exam_id, IFormFile file)
|
||||
{
|
||||
int institute_id = int.Parse(Security.GetValueFromToken("InstituteId", HttpContext.User.Identity as ClaimsIdentity));
|
||||
int user_id = Security.GetIdFromJwtToken(UserClaim.UserId, HttpContext.User.Identity as ClaimsIdentity);
|
||||
var result = await _AWSS3FileService.UploadExamImage(institute_id, user_id, exam_id, file);
|
||||
return Ok(new { isSucess = result });
|
||||
}
|
||||
|
||||
[Route("{practice_id}/uploadPracticeImage")]
|
||||
[HttpPost]
|
||||
[Authorize(Roles = "Admin,Teacher")]
|
||||
public async Task<IActionResult> UploadPracticeImageAsync(int practice_id, IFormFile file)
|
||||
{
|
||||
int institute_id = int.Parse(Security.GetValueFromToken("InstituteId", HttpContext.User.Identity as ClaimsIdentity));
|
||||
int user_id = Security.GetIdFromJwtToken(UserClaim.UserId, HttpContext.User.Identity as ClaimsIdentity);
|
||||
var result = await _AWSS3FileService.UploadPracticeImage(institute_id, user_id, practice_id, file);
|
||||
return Ok(new { isSucess = result });
|
||||
}
|
||||
|
||||
[Route("filesList")]
|
||||
[HttpGet]
|
||||
[Authorize(Roles = "Admin,Teacher")]
|
||||
public async Task<IActionResult> FilesListAsync()
|
||||
{
|
||||
var result = await _AWSS3FileService.FilesList();
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
[Route("getFile/{fileName}")]
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public async Task<IActionResult> GetFile(string fileName)
|
||||
{
|
||||
int institute_id = int.Parse(Security.GetValueFromToken("InstituteId", HttpContext.User.Identity as ClaimsIdentity));
|
||||
int user_id = Security.GetIdFromJwtToken(UserClaim.UserId, HttpContext.User.Identity as ClaimsIdentity);
|
||||
string folder = "/exams/";
|
||||
|
||||
try
|
||||
{
|
||||
var result = await _AWSS3FileService.GetFile(institute_id, user_id, folder, fileName);
|
||||
return File(result, "image/png");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return Ok("NoFile");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Route("getMyPic")]
|
||||
[HttpGet]
|
||||
[Authorize(Roles = "Admin,Teacher,Student")]
|
||||
public async Task<IActionResult> GetFile()
|
||||
{
|
||||
int user_id = Security.GetIdFromJwtToken(UserClaim.UserId, HttpContext.User.Identity as ClaimsIdentity);
|
||||
int institute_id = int.Parse(Security.GetValueFromToken("InstituteId", HttpContext.User.Identity as ClaimsIdentity));
|
||||
string folder = "/user-photo/";
|
||||
string fileName = $"{user_id.ToString()}";
|
||||
try
|
||||
{
|
||||
var result = await _AWSS3FileService.GetFile(institute_id, user_id, folder, fileName);
|
||||
return File(result, "image/png");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return Ok("NoFile");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Route("updateFile")]
|
||||
[HttpPut]
|
||||
public async Task<IActionResult> UpdateFile(UploadFileName uploadFileName, string fileName)
|
||||
{
|
||||
var result = await _AWSS3FileService.UpdateFile(uploadFileName, fileName);
|
||||
return Ok(new { isSucess = result });
|
||||
}
|
||||
|
||||
[Route("deleteMyPic")]
|
||||
[HttpDelete]
|
||||
[Authorize(Roles = "Admin,Teacher,Student")]
|
||||
public async Task<IActionResult> DeleteMyPic()
|
||||
{
|
||||
int user_id = Security.GetIdFromJwtToken(UserClaim.UserId, HttpContext.User.Identity as ClaimsIdentity);
|
||||
int institute_id = int.Parse(Security.GetValueFromToken("InstituteId", HttpContext.User.Identity as ClaimsIdentity));
|
||||
|
||||
try
|
||||
{
|
||||
var result = await _AWSS3FileService.DeleteProfileImage(institute_id, user_id);
|
||||
return Ok(new { isSucess = result });
|
||||
}
|
||||
catch
|
||||
{
|
||||
return Ok("NoFile");
|
||||
}
|
||||
}
|
||||
|
||||
[Route("deleteFile/{fileName}")]
|
||||
[HttpDelete]
|
||||
public async Task<IActionResult> DeleteFile(string fileName)
|
||||
{
|
||||
var result = await _AWSS3FileService.DeleteFile(fileName);
|
||||
return Ok(new { isSucess = result });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
|
||||
WORKDIR /src
|
||||
COPY ["microservices/S3Bucket/API.Bucket.csproj", "microservices/S3Bucket/"]
|
||||
COPY ["microservices/_layers/domain/Domain.csproj", "microservices/_layers/domain/"]
|
||||
COPY ["microservices/_layers/common/Common.csproj", "microservices/_layers/common/"]
|
||||
COPY ["microservices/_layers/data/Data.csproj", "microservices/_layers/data/"]
|
||||
RUN dotnet restore "microservices/S3Bucket/API.Bucket.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/microservices/S3Bucket"
|
||||
RUN dotnet build "API.Bucket.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "API.Bucket.csproj" -c Release -o /app/publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "API.Bucket.dll"]
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Newtonsoft.Json;
|
||||
using OnlineAssessment.Common;
|
||||
|
||||
namespace OnlineAssessment
|
||||
{
|
||||
public class ErrorHandlingMiddleware
|
||||
{
|
||||
private readonly RequestDelegate next;
|
||||
public ErrorHandlingMiddleware(RequestDelegate next)
|
||||
{
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public async Task Invoke(HttpContext context /* other dependencies */)
|
||||
{
|
||||
try
|
||||
{
|
||||
await next(context);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await HandleExceptionAsync(context, ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static Task HandleExceptionAsync(HttpContext context, Exception ex)
|
||||
{
|
||||
var code = HttpStatusCode.InternalServerError; // 500 if unexpected
|
||||
|
||||
if (ex is FormatException) code = HttpStatusCode.BadRequest;
|
||||
else if (ex is InvalidOperationException) code = HttpStatusCode.BadRequest;
|
||||
else if (ex is UriFormatException) code = HttpStatusCode.RequestUriTooLong;
|
||||
else if (ex is UnauthorizedAccessException) code = HttpStatusCode.Unauthorized;
|
||||
else if (ex is ArgumentNullException) code = HttpStatusCode.BadRequest;
|
||||
else if (ex is ArgumentException) code = HttpStatusCode.BadRequest;
|
||||
else if (ex is WebException) code = HttpStatusCode.BadRequest;
|
||||
else if (ex is EntryPointNotFoundException) code = HttpStatusCode.NotFound;
|
||||
|
||||
//else if (ex is ValueNotAcceptedException) code = HttpStatusCode.NotAcceptable;
|
||||
//else if (ex is UnauthorizedException) code = HttpStatusCode.Unauthorized;
|
||||
|
||||
string retStatusMessage = string.Empty;
|
||||
string retStatusCode = (((int)code) * -1).ToString();
|
||||
|
||||
if (ex.InnerException != null && ex.InnerException.Message.Length > 0)
|
||||
{
|
||||
retStatusMessage = string.Concat(ex.Message, " InnerException :- ", ex.InnerException.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
retStatusMessage = ex.Message;
|
||||
}
|
||||
|
||||
ReturnResponse returnResponse = new ReturnResponse();
|
||||
ReturnStatus retStatus = new ReturnStatus(retStatusCode, retStatusMessage);
|
||||
|
||||
returnResponse.Result = new object();
|
||||
returnResponse.Status = retStatus;
|
||||
|
||||
//var result = JsonConvert.SerializeObject(new { code, error = ex.Message });
|
||||
var result = JsonConvert.SerializeObject(returnResponse);
|
||||
|
||||
context.Response.ContentType = "application/json";
|
||||
context.Response.StatusCode = (int)code;
|
||||
return context.Response.WriteAsync(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "service_account",
|
||||
"project_id": "practice-kea-7cb5b",
|
||||
"private_key_id": "6e05200a3fe1990f29f748e1a00fda0835701da2",
|
||||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDRuujARe6pvo5E\njpynyv/u8dG9hSB35EwRxs/ate9CYmKkl6S24Mi7h2Qgp/5r4firaakiZcXDpBxh\n3T6LJ/kDqFMnG9TRZ9f7cZQ4gocurZjuAHlLocUx/yfInmW2Q6IVSNxRs+NsriEx\nmd8xtQy7tL2fM8diUkZZuEPgDKyY7Y38uWdoSeeSxMERiAqLDVsnsxGCa4ss0HCY\nAaOU14QExwsuylbJxEHy/D+x87sKwiIjdfpWSMbdOInaCORoyxyo2wZBlGw3myBd\nc4kqcxQ1azCdxqcX5j+/LLn4KhBCF7mXEC/CEZc+aZFNd9lBCxyIZeozW6oA8Zu1\nnx9M8iwbAgMBAAECggEADrZ7fH2LbBoDlfihMb4ybRtGuPJdYDvCQF7/ltq7gZ8w\nR1aiBfhH7KvnUMkoNn5AORos9M5J7NsW6KCiMhXoSKLmznAL4nLT+n4xxTMW86XW\n/B9JYw5irIq3SkIeZYZiGPcnCY5Cjo26o2WlfDG0xng78y6pNpMJ/2JHVLDe7M1g\n1rvHAXMQDnAMmKqCIqqcUZAE6WJeBfnFDW+n8tCEewGTqkYhB6E6e5La+TNtjdWl\nDgpEfFFTivI1zeY/DvuR7UCLi5UEdyYryBSnRnABM0P/wLvNOXo0KbY24cN8sYGU\nrSgBCgOp+mZZqGmujGAIbl7HeDX6GKuD/hrcSFHQTQKBgQD5dcZOikyBiojdsBc5\nEEPJZkT4kztiTdMDpToPeldZEqK6A98Zrup2AKbLBPuREAnZN+twYmdFa0BSqgfY\n0+DAFVTQAayg6D5Oik2h0Kh6Z0DdkS1wH3CKh3HyhITVMG6VDzbS7MXLFRCfwYpr\ngG4wdi6NenCtDacyPKdjY/l9TQKBgQDXOn27q4KI8e1fw2FZgIlsjNG292nhMEw+\nFIL001ckJrsRVgdQRegg7dUiCi/xjvaZgpb0YohIRaHdsyImmk88QzQz9aZA2Kr5\nSiUh1w+x7bnmif4HtV3P8zD82jhDOhImTJ7pvI/QY8uzqzO63pDLTrQZisKZ6TS2\n8qt7srs7BwKBgFb90Se2ZrON4eic7ZxCpcDn3wloHn9LcFiHF9Yp7afsLb78dqJ4\nMt7vnzqRBEEz/Js5Ous4BZdZrVamYJImYOvbBHZ8/vwlwQSWijfxka8NrrsVU2kU\nLaTBUuUlfUTy3L0yTwYC9364W9G6JlESulo//D/uALj4V+PW7vBj/q7JAoGADJ03\n+0TNDLupHuCzluxKoZsLO376rKEJBuZq2nB8ffjrI9P378N5HFz0Dd+s+apYV5zo\nvf/8Xsf9+aFjEgIfPLfvmk/+Y3SPaLbowDf7ioEVUSarRcZibiqhp2AexgnkQGxj\nL+3GO/9tU+Vnzb73m4LMWWbhiuW5GjPUyxYplQcCgYEAvm9v8Z34iuO8pB5P0jhr\nLRNy5a9MvkK6eWXLmhuaA12r/fHDEUhuflDwF/FTWgM8qqj6VbymfLrDWgnmydBL\nKaNrCvQjOpOaTpjX5BZJ6O6MwepU3HbuJFuWeOzNWGwlHqgn6tZC3GEf9QA9ycek\nj1RIetI2VkyHCgCXwH2fpa8=\n-----END PRIVATE KEY-----\n",
|
||||
"client_email": "firebase-adminsdk-e4h19@practice-kea-7cb5b.iam.gserviceaccount.com",
|
||||
"client_id": "107962410749665990322",
|
||||
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
||||
"token_uri": "https://oauth2.googleapis.com/token",
|
||||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
||||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-e4h19%40practice-kea-7cb5b.iam.gserviceaccount.com",
|
||||
"universe_domain": "googleapis.com"
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
using Amazon.S3;
|
||||
using Amazon.S3.Model;
|
||||
using Microsoft.Extensions.Options;
|
||||
using OnlineAssessment.Models;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace OnlineAssessment.Helpers
|
||||
{
|
||||
public interface IAWSS3BucketHelper
|
||||
{
|
||||
Task<bool> UploadFile(System.IO.Stream inputStream, string fileName);
|
||||
Task<bool> UploadFileWithMeta(System.IO.Stream inputStream, string fileName, string meta);
|
||||
Task<ListVersionsResponse> FilesList();
|
||||
Task<Stream> GetFile(string key);
|
||||
Task<GetObjectMetadataResponse> MetaDetail(string fileName);
|
||||
Task<bool> DeleteFile(string key);
|
||||
}
|
||||
public class AWSS3BucketHelper : IAWSS3BucketHelper
|
||||
{
|
||||
private readonly IAmazonS3 _amazonS3;
|
||||
private readonly ServiceConfiguration _settings;
|
||||
public AWSS3BucketHelper(IAmazonS3 s3Client, IOptions<ServiceConfiguration> settings)
|
||||
{
|
||||
this._amazonS3 = s3Client;
|
||||
this._settings = settings.Value;
|
||||
}
|
||||
public async Task<bool> UploadFile(System.IO.Stream inputStream, string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
PutObjectRequest request = new PutObjectRequest()
|
||||
{
|
||||
InputStream = inputStream,
|
||||
BucketName = _settings.AWSS3.BucketName,
|
||||
Key = fileName
|
||||
};
|
||||
PutObjectResponse response = await _amazonS3.PutObjectAsync(request);
|
||||
if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> UploadFileWithMeta(System.IO.Stream inputStream, string fileName, string meta)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
PutObjectRequest request = new PutObjectRequest()
|
||||
{
|
||||
InputStream = inputStream,
|
||||
BucketName = _settings.AWSS3.BucketName,
|
||||
Key = fileName
|
||||
};
|
||||
//request.Metadata.Add("meta-title", "someTitle");
|
||||
|
||||
PutObjectResponse response = await _amazonS3.PutObjectAsync(request);
|
||||
if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ListVersionsResponse> FilesList()
|
||||
{
|
||||
return await _amazonS3.ListVersionsAsync(_settings.AWSS3.BucketName);
|
||||
}
|
||||
|
||||
public async Task<GetObjectMetadataResponse> MetaDetail(string fileName)
|
||||
{
|
||||
GetObjectMetadataRequest request = new GetObjectMetadataRequest()
|
||||
{
|
||||
BucketName = _settings.AWSS3.BucketName,
|
||||
Key = fileName
|
||||
};
|
||||
|
||||
return await _amazonS3.GetObjectMetadataAsync(request);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<Stream> GetFile(string key)
|
||||
{
|
||||
string file = key + ".png";
|
||||
GetObjectResponse response = await _amazonS3.GetObjectAsync(_settings.AWSS3.BucketName, file);
|
||||
if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
|
||||
return response.ResponseStream;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteFile(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeleteObjectResponse response = await _amazonS3.DeleteObjectAsync(_settings.AWSS3.BucketName, key);
|
||||
if (response.HttpStatusCode == System.Net.HttpStatusCode.NoContent)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
using Amazon.S3.Model;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OnlineAssessment.Models
|
||||
{
|
||||
public enum UploadFileName
|
||||
{
|
||||
First = 1,
|
||||
Second = 2,
|
||||
Third = 3,
|
||||
Fourth = 4,
|
||||
Fifth = 5,
|
||||
}
|
||||
|
||||
public class UploadFilePath
|
||||
{
|
||||
public string file_path { get; set; }
|
||||
}
|
||||
|
||||
public class KeyValue
|
||||
{
|
||||
public string key { get; set; }
|
||||
public string value { get; set; }
|
||||
}
|
||||
|
||||
public class FilePathWithMeta
|
||||
{
|
||||
public string file_path { get; set; }
|
||||
public List<KeyValue> listmetadata { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
namespace OnlineAssessment.Models
|
||||
{
|
||||
public class ServiceConfiguration
|
||||
{
|
||||
public AWSS3Configuration AWSS3 { get; set; }
|
||||
}
|
||||
public class AWSS3Configuration
|
||||
{
|
||||
public string BucketName { get; set; }
|
||||
public string Region { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace OnlineAssessment
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
//webBuilder.ConfigureLogging(logBuilder =>
|
||||
//{
|
||||
// logBuilder.ClearProviders(); // removes all providers from LoggerFactory
|
||||
// logBuilder.AddConsole();
|
||||
// logBuilder.AddTraceSource("Information, ActivityTracing"); // Add Trace listener provider
|
||||
//});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish>http://api-bucket.odiprojects.com</SiteUrlToLaunchAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<ProjectGuid>45352e1b-f517-4f18-a1d6-3331ddee171e</ProjectGuid>
|
||||
<SelfContained>true</SelfContained>
|
||||
<MSDeployServiceURL>https://api-bucket.odiprojects.com:8172/msdeploy.axd?site=api-bucket.odiprojects.com</MSDeployServiceURL>
|
||||
<DeployIisAppPath>api-bucket.odiprojects.com</DeployIisAppPath>
|
||||
<RemoteSitePhysicalPath />
|
||||
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
|
||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
||||
<UserName>odiproj1</UserName>
|
||||
<_SavePWD>True</_SavePWD>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:8006",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"ancmHostingModel": "InProcess"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
|
||||
"publishAllPorts": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30225.117
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "S3BucketDemo", "S3BucketDemo.csproj", "{130F8A04-892E-4F6A-AA86-F9AE1DB14EBD}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer", "..\IdentityServer\IdentityServer.csproj", "{387B144C-9411-41D1-A67D-EEADF86B5ACC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Movies.Client", "..\Movies.Client\Movies.Client.csproj", "{66F9DCE0-6852-44D7-981D-B25085D59061}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServerDBUser", "..\IdentityServerDBUser\IdentityServerDBUser.csproj", "{86505CA2-42A6-43C0-BA78-D75C92B542E0}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ISDB", "..\ISDB\ISDB.csproj", "{A20D324D-2B6C-411E-99AF-2F10B1265804}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{130F8A04-892E-4F6A-AA86-F9AE1DB14EBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{130F8A04-892E-4F6A-AA86-F9AE1DB14EBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{130F8A04-892E-4F6A-AA86-F9AE1DB14EBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{130F8A04-892E-4F6A-AA86-F9AE1DB14EBD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{387B144C-9411-41D1-A67D-EEADF86B5ACC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{387B144C-9411-41D1-A67D-EEADF86B5ACC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{387B144C-9411-41D1-A67D-EEADF86B5ACC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{387B144C-9411-41D1-A67D-EEADF86B5ACC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{66F9DCE0-6852-44D7-981D-B25085D59061}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{66F9DCE0-6852-44D7-981D-B25085D59061}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{66F9DCE0-6852-44D7-981D-B25085D59061}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{66F9DCE0-6852-44D7-981D-B25085D59061}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{86505CA2-42A6-43C0-BA78-D75C92B542E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{86505CA2-42A6-43C0-BA78-D75C92B542E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{86505CA2-42A6-43C0-BA78-D75C92B542E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{86505CA2-42A6-43C0-BA78-D75C92B542E0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A20D324D-2B6C-411E-99AF-2F10B1265804}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A20D324D-2B6C-411E-99AF-2F10B1265804}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A20D324D-2B6C-411E-99AF-2F10B1265804}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A20D324D-2B6C-411E-99AF-2F10B1265804}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A6C2FE60-6CD7-46A9-88F4-C4ACCE7297D8}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -0,0 +1,250 @@
|
|||
using Amazon.S3.Model;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using OnlineAssessment.Helpers;
|
||||
using OnlineAssessment.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OnlineAssessment.Services
|
||||
{
|
||||
public interface IAWSS3FileService
|
||||
{
|
||||
Task<bool> UploadFile(string uploadFileName);
|
||||
//Task<bool> UploadProfileImage(int institute_id, int user_id, string uploadFileName);
|
||||
Task<Object> UploadProfileImage(int institute_id, int user_id, IFormFile file);
|
||||
Task<Object> UploadExamImage(int institute_id, int user_id, int exam_id, IFormFile file);
|
||||
Task<Object> UploadPracticeImage(int institute_id, int user_id, int practice_id, IFormFile file);
|
||||
|
||||
Task<List<FilePathWithMeta>> FilesList();
|
||||
Task<Stream> GetFile(int institute_id, int user_id, string folder, string key);
|
||||
Task<bool> UpdateFile(UploadFileName uploadFileName, string key);
|
||||
Task<bool> DeleteFile(string key);
|
||||
Task<bool> DeleteProfileImage(int institute_id, int user_id);
|
||||
}
|
||||
public class AWSS3FileService : IAWSS3FileService
|
||||
{
|
||||
private readonly IAWSS3BucketHelper _AWSS3BucketHelper;
|
||||
|
||||
public AWSS3FileService(IAWSS3BucketHelper AWSS3BucketHelper)
|
||||
{
|
||||
this._AWSS3BucketHelper = AWSS3BucketHelper;
|
||||
}
|
||||
public async Task<bool> UploadFile(string uploadFileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var path = Path.Combine(uploadFileName.ToString());
|
||||
using (FileStream fsSource = new FileStream(path, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
string fileExtension = Path.GetExtension(path);
|
||||
string fileName = string.Empty;
|
||||
fileName = $"{DateTime.Now.Ticks}{fileExtension}";
|
||||
return await _AWSS3BucketHelper.UploadFile(fsSource, path);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
/*
|
||||
public async Task<bool> UploadProfileImage(int institute_id, int user_id, string uploadFileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var path = Path.Combine(uploadFileName.ToString());
|
||||
using (FileStream fsSource = new FileStream(path, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
string fileExtension = Path.GetExtension(path);
|
||||
string fileName = string.Empty;
|
||||
string folder = "/user-photo/";
|
||||
fileName = $"{institute_id.ToString()}{folder}{user_id.ToString()}{fileExtension}";
|
||||
return await _AWSS3BucketHelper.UploadFile(fsSource, fileName);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public async Task<Object> UploadProfileImage(int institute_id, int user_id, IFormFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
IList<string> AllowedFileExtensions = new List<string> { ".png", ".jpg" };
|
||||
string fileExtension = Path.GetExtension(file.FileName.ToString()).ToLower();
|
||||
if (!AllowedFileExtensions.Contains(fileExtension))
|
||||
{
|
||||
var message = string.Format("Please Upload image of type .png or .jpg");
|
||||
return message;
|
||||
}
|
||||
fileExtension = ".png";
|
||||
string fileName = string.Empty;
|
||||
string folder = "/user-photo/";
|
||||
fileName = $"{institute_id.ToString()}{folder}{user_id.ToString()}{fileExtension}";
|
||||
return await _AWSS3BucketHelper.UploadFile(file.OpenReadStream(), fileName);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<Object> UploadExamImage(int institute_id, int user_id, int exam_id, IFormFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
IList<string> AllowedFileExtensions = new List<string> { ".png" };
|
||||
string fileExtension = Path.GetExtension(file.FileName.ToString()).ToLower();
|
||||
if (!AllowedFileExtensions.Contains(fileExtension))
|
||||
{
|
||||
var message = string.Format("Please Upload image of type .png.");
|
||||
return message;
|
||||
}
|
||||
string fileName = string.Empty;
|
||||
string folder = "/exams/";
|
||||
fileName = $"{institute_id.ToString()}{folder}{exam_id.ToString()}{fileExtension}";
|
||||
return await _AWSS3BucketHelper.UploadFile(file.OpenReadStream(), fileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<Object> UploadPracticeImage(int institute_id, int user_id, int practice_id, IFormFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
IList<string> AllowedFileExtensions = new List<string> { ".png" };
|
||||
string fileExtension = Path.GetExtension(file.FileName.ToString()).ToLower();
|
||||
if (!AllowedFileExtensions.Contains(fileExtension))
|
||||
{
|
||||
var message = string.Format("Please Upload image of type .png.");
|
||||
return message;
|
||||
}
|
||||
string fileName = string.Empty;
|
||||
string folder = "/practices/";
|
||||
fileName = $"{institute_id.ToString()}{folder}{practice_id.ToString()}{fileExtension}";
|
||||
return await _AWSS3BucketHelper.UploadFile(file.OpenReadStream(), fileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<FilePathWithMeta>> FilesList()
|
||||
{
|
||||
try
|
||||
{
|
||||
GetObjectMetadataResponse meta = new GetObjectMetadataResponse();
|
||||
KeyValue kv = new KeyValue();
|
||||
List<KeyValue> lkv = new List<KeyValue>();
|
||||
FilePathWithMeta metaFile = new FilePathWithMeta();
|
||||
List<FilePathWithMeta> listMetaFile = new List<FilePathWithMeta>();
|
||||
|
||||
ListVersionsResponse listVersions = await _AWSS3BucketHelper.FilesList();
|
||||
List<string> filenamelist = listVersions.Versions.Select(c => c.Key).ToList();
|
||||
filenamelist = filenamelist.Where(r => r.EndsWith("png")).ToList();
|
||||
|
||||
foreach(string name in filenamelist)
|
||||
{
|
||||
meta = await _AWSS3BucketHelper.MetaDetail(name);
|
||||
foreach (string key in meta.Metadata.Keys)
|
||||
{
|
||||
kv.key = key;
|
||||
kv.value = meta.Metadata[key];
|
||||
lkv.Add(kv);
|
||||
}
|
||||
|
||||
metaFile.file_path = name;
|
||||
metaFile.listmetadata = lkv;
|
||||
listMetaFile.Add(metaFile);
|
||||
}
|
||||
|
||||
return listMetaFile;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
public async Task<Stream> GetFile(int institute_id, int user_id, string folder, string key)
|
||||
{
|
||||
//string fileExtension = ".png";
|
||||
string fileName = string.Empty;
|
||||
fileName = $"{institute_id.ToString()}{folder}{key.ToString()}";
|
||||
|
||||
try
|
||||
{
|
||||
Stream fileStream = await _AWSS3BucketHelper.GetFile(fileName);
|
||||
if (fileStream == null)
|
||||
{
|
||||
Exception ex = new Exception("File Not Found");
|
||||
throw ex;
|
||||
}
|
||||
else
|
||||
{
|
||||
return fileStream;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
public async Task<bool> UpdateFile(UploadFileName uploadFileName, string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
var path = Path.Combine("Files", uploadFileName.ToString() + ".png");
|
||||
using (FileStream fsSource = new FileStream(path, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
return await _AWSS3BucketHelper.UploadFile(fsSource, key);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteProfileImage(int institute_id, int user_id)
|
||||
{
|
||||
try
|
||||
{
|
||||
string fileExtension = ".png";
|
||||
string fileName = string.Empty;
|
||||
string folder = "/user-photo/";
|
||||
fileName = $"{institute_id.ToString()}{folder}{user_id.ToString()}{fileExtension}";
|
||||
|
||||
return await _AWSS3BucketHelper.DeleteFile(fileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteFile(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _AWSS3BucketHelper.DeleteFile(key);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,277 @@
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Amazon.S3;
|
||||
using AutoMapper;
|
||||
using FluentValidation.AspNetCore;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
||||
using Microsoft.AspNetCore.Mvc.Versioning;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using OnlineAssessment.Common;
|
||||
using OnlineAssessment.Data;
|
||||
using OnlineAssessment.Data.EFCore;
|
||||
using OnlineAssessment.Helpers;
|
||||
using OnlineAssessment.Services;
|
||||
using OnlineAssessment.Models;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
using FirebaseAdmin;
|
||||
using Google.Apis.Auth.OAuth2;
|
||||
|
||||
namespace OnlineAssessment
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
public Startup(IConfiguration configuration, IWebHostEnvironment env)
|
||||
{
|
||||
//Getting Response Messages From Config File (appresponsemessages.json)
|
||||
dynamic builder;
|
||||
if (env.EnvironmentName.Equals("Development"))
|
||||
{
|
||||
builder = new ConfigurationBuilder()
|
||||
.SetBasePath(env.ContentRootPath)
|
||||
.AddJsonFile("appsettings.Development.json", optional: true, reloadOnChange: true)
|
||||
.AddJsonFile("appresponsemessages.json", optional: false, reloadOnChange: true)
|
||||
.AddEnvironmentVariables();
|
||||
}
|
||||
else
|
||||
{
|
||||
builder = new ConfigurationBuilder()
|
||||
.SetBasePath(env.ContentRootPath)
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
|
||||
.AddJsonFile("appresponsemessages.json", optional: false, reloadOnChange: true)
|
||||
.AddEnvironmentVariables();
|
||||
}
|
||||
configuration = builder.Build();
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApiVersionDescriptionProvider provider)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
/*
|
||||
app.UseStaticFiles();
|
||||
app.UseStaticFiles(new StaticFileOptions()
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(
|
||||
Path.Combine(Directory.GetCurrentDirectory(), "Content")),
|
||||
RequestPath = "/Content"
|
||||
});
|
||||
*/
|
||||
// Enable middleware to serve generated Swagger as a JSON endpoint.
|
||||
app.UseSwagger();
|
||||
|
||||
// Enable middleware to serve swagger-ui
|
||||
app.UseSwaggerUI(
|
||||
options =>
|
||||
{
|
||||
options.InjectStylesheet("/Content/custom.css");
|
||||
// build a swagger endpoint for each discovered API version
|
||||
foreach (var description in provider.ApiVersionDescriptions)
|
||||
{
|
||||
options.SwaggerEndpoint($"/swagger/{description.GroupName}/swagger.json", description.GroupName.ToUpperInvariant());
|
||||
}
|
||||
});
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseCors();
|
||||
|
||||
app.UseAuthentication();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseMiddleware(typeof(ErrorHandlingMiddleware));
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
//Firebase
|
||||
FirebaseApp.Create(new AppOptions
|
||||
{
|
||||
Credential = GoogleCredential.FromFile(@"Firebase//practice-kea-7cb5b-firebase-adminsdk-e4h19-6e05200a3f.json")
|
||||
});
|
||||
|
||||
//services.AddAutoMapper(typeof(AutoMapping));
|
||||
services.AddDbConnections(Configuration);
|
||||
|
||||
//
|
||||
|
||||
//services
|
||||
// .AddScoped<AWSS3FileService>();
|
||||
// .AddScoped<EfCoreCommonRepository>()
|
||||
// .AddScoped<EFCoreInstituteRepository>()
|
||||
// .AddScoped<EFCoreQuestionRepository>()
|
||||
// .AddScoped<EFCoreUserGroupRepository>()
|
||||
// .AddScoped<EFCoreExamRepository>()
|
||||
// .AddScoped<EFCorePracticeRepository>();
|
||||
|
||||
|
||||
//
|
||||
|
||||
services.AddCors(o => o.AddPolicy("OdiwarePolicy", builder =>
|
||||
{
|
||||
builder
|
||||
.AllowAnyOrigin()
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader()
|
||||
//.AllowCredentials()
|
||||
.Build();
|
||||
}));
|
||||
|
||||
//Firebase
|
||||
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||
.AddJwtBearer(options =>
|
||||
{
|
||||
options.Authority = "https://securetoken.google.com/practice-kea-7cb5b";
|
||||
options.TokenValidationParameters = new TokenValidationParameters
|
||||
{
|
||||
ValidateIssuer = true,
|
||||
ValidIssuer = "https://securetoken.google.com/practice-kea-7cb5b",
|
||||
ValidateAudience = true,
|
||||
ValidAudience = "practice-kea-7cb5b",
|
||||
ValidateLifetime = true,
|
||||
ValidateIssuerSigningKey = true
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||
.AddJwtBearer(options =>
|
||||
{
|
||||
options.TokenValidationParameters = new TokenValidationParameters
|
||||
{
|
||||
ValidateIssuer = false,
|
||||
ValidateAudience = false,
|
||||
ValidateLifetime = true,
|
||||
ValidateIssuerSigningKey = true,
|
||||
//ValidIssuer = Configuration["Jwt:Issuer"],
|
||||
//ValidAudience = Configuration["Jwt:Issuer"],
|
||||
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["Jwt:Key"]))
|
||||
};
|
||||
});
|
||||
*/
|
||||
|
||||
//
|
||||
|
||||
services.AddControllers()
|
||||
.AddFluentValidation(fv => fv.RegisterValidatorsFromAssemblyContaining<Startup>())
|
||||
.AddNewtonsoftJson(option => option.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
|
||||
|
||||
//
|
||||
|
||||
var appSettingsSection = Configuration.GetSection("ServiceConfiguration");
|
||||
services.AddDefaultAWSOptions(Configuration.GetAWSOptions());
|
||||
services.AddAWSService<IAmazonS3>();
|
||||
services.Configure<ServiceConfiguration>(appSettingsSection);
|
||||
services.AddTransient<IAWSS3FileService, AWSS3FileService>();
|
||||
services.AddTransient<IAWSS3BucketHelper, AWSS3BucketHelper>();
|
||||
|
||||
services.AddApiVersioning(
|
||||
options =>
|
||||
{
|
||||
// reporting api versions will return the headers "api-supported-versions" and "api-deprecated-versions"
|
||||
//options.ReportApiVersions = true;
|
||||
|
||||
// Specify the default API Version as 1.0
|
||||
options.DefaultApiVersion = new ApiVersion(1, 0);
|
||||
|
||||
// If the client hasn't specified the API version in the request, use the default API version number
|
||||
options.AssumeDefaultVersionWhenUnspecified = true;
|
||||
|
||||
// Advertise the API versions supported for the particular endpoint
|
||||
// Reporting api versions will return the headers "api-supported-versions" and "api-deprecated-versions"
|
||||
options.ReportApiVersions = true;
|
||||
|
||||
// Supporting multiple versioning scheme
|
||||
//config.ApiVersionReader = ApiVersionReader.Combine(new HeaderApiVersionReader("X-version"), new QueryStringApiVersionReader("api-version"));
|
||||
options.ApiVersionReader = ApiVersionReader.Combine(new HeaderApiVersionReader("X-version"));
|
||||
});
|
||||
|
||||
//
|
||||
|
||||
services.AddVersionedApiExplorer(
|
||||
options =>
|
||||
{
|
||||
// add the versioned api explorer, which also adds IApiVersionDescriptionProvider service
|
||||
// note: the specified format code will format the version as "'v'major[.minor][-status]"
|
||||
options.GroupNameFormat = "'v'VVV";
|
||||
|
||||
// note: this option is only necessary when versioning by url segment. the SubstitutionFormat
|
||||
// can also be used to control the format of the API version in route templates
|
||||
options.SubstituteApiVersionInUrl = true;
|
||||
});
|
||||
|
||||
//
|
||||
|
||||
services.AddTransient<IConfigureOptions<SwaggerGenOptions>, SwaggerConfigureOptions>();
|
||||
services.AddSwaggerGen(
|
||||
options =>
|
||||
{
|
||||
// add a custom operation filter which sets default values
|
||||
options.OperationFilter<SwaggerDefaultValues>();
|
||||
|
||||
// integrate xml comments
|
||||
//options.IncludeXmlComments(XmlCommentsFilePath);
|
||||
});
|
||||
|
||||
|
||||
//
|
||||
|
||||
services.AddSingleton(Configuration.GetSection("ResponseMessage").Get<ResponseMessage>());
|
||||
services.Configure<ResponseMessage>((setting) =>
|
||||
{
|
||||
Configuration.GetSection("ResponseMessage").Bind(setting);
|
||||
});
|
||||
services.Configure<ApiBehaviorOptions>(a => a.InvalidModelStateResponseFactory = actionContext =>
|
||||
{
|
||||
return new BadRequestObjectResult(new
|
||||
ReturnResponse(string.Empty,
|
||||
new ReturnStatus(
|
||||
"-1",
|
||||
actionContext.ModelState.Values.SelectMany(x => x.Errors)
|
||||
.Select(x => x.ErrorMessage)
|
||||
)
|
||||
));
|
||||
});
|
||||
}
|
||||
static string XmlCommentsFilePath
|
||||
{
|
||||
get
|
||||
{
|
||||
var basePath = PlatformServices.Default.Application.ApplicationBasePath;
|
||||
var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml";
|
||||
return Path.Combine(basePath, fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
using System;
|
||||
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
|
||||
namespace OnlineAssessment
|
||||
{
|
||||
/// <summary>
|
||||
/// Configures the Swagger generation options.
|
||||
/// </summary>
|
||||
/// <remarks>This allows API versioning to define a Swagger document per API version after the
|
||||
/// <see cref="IApiVersionDescriptionProvider"/> service has been resolved from the service container.</remarks>
|
||||
public class SwaggerConfigureOptions : IConfigureOptions<SwaggerGenOptions>
|
||||
{
|
||||
private const string OdiwareApiTitle = "API - BUCKET";
|
||||
private const string OdiwareApiDescription = "Odiware Online Assessment System - RESTful APIs for the users of an institution";
|
||||
readonly IApiVersionDescriptionProvider provider;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SwaggerConfigureOptions"/> class.
|
||||
/// </summary>
|
||||
/// <param name="provider">The <see cref="IApiVersionDescriptionProvider">provider</see> used to generate Swagger documents.</param>
|
||||
public SwaggerConfigureOptions(IApiVersionDescriptionProvider provider) => this.provider = provider;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Configure(SwaggerGenOptions options)
|
||||
{
|
||||
// add a swagger document for each discovered API version
|
||||
// note: you might choose to skip or document deprecated API versions differently
|
||||
foreach (var description in provider.ApiVersionDescriptions)
|
||||
{
|
||||
options.SwaggerDoc(description.GroupName, CreateInfoForApiVersion(description));
|
||||
}
|
||||
}
|
||||
|
||||
static OpenApiInfo CreateInfoForApiVersion(ApiVersionDescription description)
|
||||
{
|
||||
var info = new OpenApiInfo()
|
||||
{
|
||||
Title = OdiwareApiTitle,
|
||||
Version = description.ApiVersion.ToString(),
|
||||
Description = OdiwareApiDescription,
|
||||
Contact = new OpenApiContact() { Name = "Odiware Technologies", Email = "hr@odiware.com" },
|
||||
License = new OpenApiLicense() { Name = "MIT", Url = new Uri("https://opensource.org/licenses/MIT") }
|
||||
};
|
||||
|
||||
if (description.IsDeprecated)
|
||||
{
|
||||
info.Description += " This API version has been deprecated.";
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
||||
using Microsoft.OpenApi.Any;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
|
||||
namespace OnlineAssessment
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the Swagger/Swashbuckle operation filter used to document the implicit API version parameter.
|
||||
/// </summary>
|
||||
/// <remarks>This <see cref="IOperationFilter"/> is only required due to bugs in the <see cref="SwaggerGenerator"/>.
|
||||
/// Once they are fixed and published, this class can be removed.</remarks>
|
||||
public class SwaggerDefaultValues : IOperationFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// Applies the filter to the specified operation using the given context.
|
||||
/// </summary>
|
||||
/// <param name="operation">The operation to apply the filter to.</param>
|
||||
/// <param name="context">The current operation filter context.</param>
|
||||
public void Apply(OpenApiOperation operation, OperationFilterContext context)
|
||||
{
|
||||
var apiDescription = context.ApiDescription;
|
||||
|
||||
operation.Deprecated |= apiDescription.IsDeprecated();
|
||||
|
||||
if (operation.Parameters == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// REF: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/412
|
||||
// REF: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/413
|
||||
foreach (var parameter in operation.Parameters)
|
||||
{
|
||||
var description = apiDescription.ParameterDescriptions.First(p => p.Name == parameter.Name);
|
||||
|
||||
if (parameter.Description == null)
|
||||
{
|
||||
parameter.Description = description.ModelMetadata?.Description;
|
||||
}
|
||||
|
||||
if (parameter.Schema.Default == null && description.DefaultValue != null)
|
||||
{
|
||||
parameter.Schema.Default = new OpenApiString(description.DefaultValue.ToString());
|
||||
}
|
||||
|
||||
parameter.Required |= description.IsRequired;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"ResponseMessage": {
|
||||
"Values": {
|
||||
"Success": "Successful!",
|
||||
"Failure": "Failure!",
|
||||
"NoData": "No Record(s) Found!",
|
||||
"InvalidInput": "Invalid Input",
|
||||
"InvalidOperation": "Invalid Operation",
|
||||
"EmptyValue": "Can't be empty'",
|
||||
|
||||
"ObjectNotFound": "{0} not found!",
|
||||
|
||||
"ObjectNotAdded": "Failed to add {0}",
|
||||
"ObjectNotUpdated": "Failed to update the {0}",
|
||||
"ObjectNotDeleted": "Failed to delete the {0}",
|
||||
|
||||
"ObjectAddedSuccessfully": "{0} added successfully",
|
||||
"ObjectUpdatedSuccessfully": "{0} updated successfully",
|
||||
"ObjectDeleteSuccessfully": "{0} deleted successfully",
|
||||
|
||||
"FailedToAdd": "Failed to add the record!",
|
||||
"FailedToUpdate": "Failed to update the record!",
|
||||
"FailedToDelete": "Failed to delete the record!",
|
||||
"FailedToAttach": "Failed to attach the record!",
|
||||
"FailedToDetach": "Failed to detach the record!",
|
||||
|
||||
"MustNotEmpty": "This is a required field and must not be empty",
|
||||
"MustNotNull": "This is a required field and must not be null",
|
||||
"MustGreaterThanZero": "The value must be greater than zero",
|
||||
|
||||
"InvalidUser": "The user is not valid",
|
||||
"InvalidPasword": "Invalid login credential",
|
||||
"UserNotActive": "User is not active",
|
||||
|
||||
"IdMismatchBetweenBodyAndQueryString": "Id Mismatch Between Body And Query String",
|
||||
"NotAllowedToResource": "You are not authorised for this operation!",
|
||||
"NotAllowedToAddResourceOtherThanYours": "You can only add resources for your institution only.",
|
||||
"NotAllowedToUpdateResourceOtherThanYours": "You can only update the resources of your institution only.",
|
||||
"NotAllowedToDeleteResourceOtherThanYours": "You can only delete the resources of your institution only.",
|
||||
"NotAllowedToViewResourceOtherThanYours": "You can only view the resources of your institution only."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
//"DefaultConnectionString": "yV213mRnQngKYPWcDvOoPbSopWdQ0VutXa7+S2RRjoI4G3nsjIF0PYPmwJffxL1WCdb+20HrHyf1t+DCMnGtzz6WWiwQ0oHWB26iCqTKLgQi53fmcRWMJsZkkxh4u8zKueZuEi6c/Er2MrTF4lwdqFkQmA3Wi/FzJAsifsqVer717EJkhhnz+h0pC4bQkX7P+y2TmirFPhJNWLb/uFFc5XIuKMYvuggyIOQoo84mLnX4s0Nn+FbzzmkLgVO1+dnrJAgWVJoiHcEvbdcQkfNw4LlvJ4qHS7oiBo2erYpo2USX4EwaBHnYA4xginfbudlv"
|
||||
"DefaultConnectionString": "B58MwWJom8ajCI4ia0DN+uXUcjx9/6VSwwwQLNRr0ALJmE2hmLwzJV6FYk3YezpmAQxcFLiBG1mToDKYxumHzWoyyr3/8JrMxcxJWctehH6XLaoreNgAG4pfVoNqXdy2LLDfxrh+MfXMe5vTzSRd/wgsiNcfFYzvoOA6ecg/K15a6/aM4CBWkylwwihQdCn/u567QL8IlAeUkPSM97dI6OGUYDzuGNoubGBDd2bBEKpY+HZ5gdF+hOxiC68XlkSykjk7vCDg5oIO2wNXvi2D0BmwEpXxhCMUFNaqJN7qpmo="
|
||||
},
|
||||
"Jwt": {
|
||||
"Key": "THIS_IS_ODIWARE_SECRET_KEY",
|
||||
"Issuer": "Odiware"
|
||||
},
|
||||
"ServiceConfiguration": {
|
||||
"AWSS3": {
|
||||
"BucketName": "s3bucket-for-oa"
|
||||
}
|
||||
},
|
||||
"AWS": {
|
||||
"Profile": "default",
|
||||
"Region": "ap-south-1",
|
||||
"ProfilesLocation": "awss3credentials"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnectionString": "B58MwWJom8ajCI4ia0DN+uXUcjx9/6VSwwwQLNRr0ALJmE2hmLwzJV6FYk3YezpmAQxcFLiBG1mToDKYxumHzWoyyr3/8JrMxcxJWctehH6XLaoreNgAG4pfVoNqXdy2LLDfxrh+MfXMe5vTzSRd/wgsiNcfFYzvoOA6ecg/K15a6/aM4CBWkylwwihQdCn/u567QL8IlAeUkPSM97dI6OGUYDzuGNoubGBDd2bBEKpY+HZ5gdF+hOxiC68XlkSykjk7vCDg5oIO2wNXvi2D0BmwEpXxhCMUFNaqJN7qpmo="
|
||||
},
|
||||
"Jwt": {
|
||||
"Key": "THIS_IS_ODIWARE_SECRET_KEY",
|
||||
"Issuer": "Odiware"
|
||||
},
|
||||
"ServiceConfiguration": {
|
||||
"AWSS3": {
|
||||
"BucketName": "s3bucket-for-oa"
|
||||
}
|
||||
},
|
||||
"AWS": {
|
||||
"Profile": "default",
|
||||
"Region": "ap-south-1",
|
||||
"ProfilesLocation": "awss3credentials"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[default]
|
||||
aws_access_key_id = AKIA4MV5DUUIKZXEXB3K
|
||||
aws_secret_access_key = nDcHkU4xvSYOsUsrUxEp+xshMXIqikfMjvN+w7gT
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net9.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "9.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App",
|
||||
"version": "9.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.GC.Server": true,
|
||||
"System.Reflection.NullabilityInfoContext.IsSupported": true,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"Version": 1,
|
||||
"ManifestType": "Build",
|
||||
"Endpoints": []
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "service_account",
|
||||
"project_id": "practice-kea-7cb5b",
|
||||
"private_key_id": "6e05200a3fe1990f29f748e1a00fda0835701da2",
|
||||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDRuujARe6pvo5E\njpynyv/u8dG9hSB35EwRxs/ate9CYmKkl6S24Mi7h2Qgp/5r4firaakiZcXDpBxh\n3T6LJ/kDqFMnG9TRZ9f7cZQ4gocurZjuAHlLocUx/yfInmW2Q6IVSNxRs+NsriEx\nmd8xtQy7tL2fM8diUkZZuEPgDKyY7Y38uWdoSeeSxMERiAqLDVsnsxGCa4ss0HCY\nAaOU14QExwsuylbJxEHy/D+x87sKwiIjdfpWSMbdOInaCORoyxyo2wZBlGw3myBd\nc4kqcxQ1azCdxqcX5j+/LLn4KhBCF7mXEC/CEZc+aZFNd9lBCxyIZeozW6oA8Zu1\nnx9M8iwbAgMBAAECggEADrZ7fH2LbBoDlfihMb4ybRtGuPJdYDvCQF7/ltq7gZ8w\nR1aiBfhH7KvnUMkoNn5AORos9M5J7NsW6KCiMhXoSKLmznAL4nLT+n4xxTMW86XW\n/B9JYw5irIq3SkIeZYZiGPcnCY5Cjo26o2WlfDG0xng78y6pNpMJ/2JHVLDe7M1g\n1rvHAXMQDnAMmKqCIqqcUZAE6WJeBfnFDW+n8tCEewGTqkYhB6E6e5La+TNtjdWl\nDgpEfFFTivI1zeY/DvuR7UCLi5UEdyYryBSnRnABM0P/wLvNOXo0KbY24cN8sYGU\nrSgBCgOp+mZZqGmujGAIbl7HeDX6GKuD/hrcSFHQTQKBgQD5dcZOikyBiojdsBc5\nEEPJZkT4kztiTdMDpToPeldZEqK6A98Zrup2AKbLBPuREAnZN+twYmdFa0BSqgfY\n0+DAFVTQAayg6D5Oik2h0Kh6Z0DdkS1wH3CKh3HyhITVMG6VDzbS7MXLFRCfwYpr\ngG4wdi6NenCtDacyPKdjY/l9TQKBgQDXOn27q4KI8e1fw2FZgIlsjNG292nhMEw+\nFIL001ckJrsRVgdQRegg7dUiCi/xjvaZgpb0YohIRaHdsyImmk88QzQz9aZA2Kr5\nSiUh1w+x7bnmif4HtV3P8zD82jhDOhImTJ7pvI/QY8uzqzO63pDLTrQZisKZ6TS2\n8qt7srs7BwKBgFb90Se2ZrON4eic7ZxCpcDn3wloHn9LcFiHF9Yp7afsLb78dqJ4\nMt7vnzqRBEEz/Js5Ous4BZdZrVamYJImYOvbBHZ8/vwlwQSWijfxka8NrrsVU2kU\nLaTBUuUlfUTy3L0yTwYC9364W9G6JlESulo//D/uALj4V+PW7vBj/q7JAoGADJ03\n+0TNDLupHuCzluxKoZsLO376rKEJBuZq2nB8ffjrI9P378N5HFz0Dd+s+apYV5zo\nvf/8Xsf9+aFjEgIfPLfvmk/+Y3SPaLbowDf7ioEVUSarRcZibiqhp2AexgnkQGxj\nL+3GO/9tU+Vnzb73m4LMWWbhiuW5GjPUyxYplQcCgYEAvm9v8Z34iuO8pB5P0jhr\nLRNy5a9MvkK6eWXLmhuaA12r/fHDEUhuflDwF/FTWgM8qqj6VbymfLrDWgnmydBL\nKaNrCvQjOpOaTpjX5BZJ6O6MwepU3HbuJFuWeOzNWGwlHqgn6tZC3GEf9QA9ycek\nj1RIetI2VkyHCgCXwH2fpa8=\n-----END PRIVATE KEY-----\n",
|
||||
"client_email": "firebase-adminsdk-e4h19@practice-kea-7cb5b.iam.gserviceaccount.com",
|
||||
"client_id": "107962410749665990322",
|
||||
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
||||
"token_uri": "https://oauth2.googleapis.com/token",
|
||||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
||||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-e4h19%40practice-kea-7cb5b.iam.gserviceaccount.com",
|
||||
"universe_domain": "googleapis.com"
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue