Skip to content

CSharp webapi for EarthFusion, project of Database course design, Tongji SSE, Jul 2020

License

Notifications You must be signed in to change notification settings

NeverRaR/earthfusion-backend

Repository files navigation

earthfusion-backend

Build Status CodeFactor FOSSA Status

CSharp webapi for EarthFusion, project of Database course design, Tongji SSE, Jul 2020

Init

dotnet add package Oracle.ManagedDataAccess.Core --version 2.19.70
dotnet add package Sendgrid --version 9.18.0
dotnet add package StackExchange.Redis --version 2.1.58
dotnet add package LettuceEncrypt --version 1.0.0 # if you want to automatically obtain Let's Encrypt's certs

Setup

Put your https certificate(certificate.pfx) under project root.

Consult your DB Administrator for DB conference.

I assume your spatial admin's account is spatial_admin, and your geom data is in nemo's schema.

CREATE TABLE earthfusion_users(
            user_id NUMBER,
            user_name VARCHAR2(50),
            user_email VARCHAR2(50),
            user_password_hashed VARCHAR2(66),
            user_status VARCHAR2(50),
            user_role VARCHAR2(50),
            PRIMARY KEY(user_id)
            );

Run

Firstly, create an ini file under project root.

Contents for config.ini:

EARTH_FUSION_EMAIL_API_KEY=***
EARTH_FUSION_SPATIAL_DB_USERNAME=***
EARTH_FUSION_SPATIAL_DB_PASSWORD=***
EARTH_FUSION_SPATIAL_ADMIN_DB_USERNAME=***
EARTH_FUSION_SPATIAL_ADMIN_DB_PASSWORD=***

Build and run:

#!/bin/bash
#
# no longer need this as we has ini config
# export EARTH_FUSION_EMAIL_API_KEY="***" # Sendgrid API Key
# export EARTH_FUSION_SPATIAL_DB_USERNAME="***" # Oracle
# export EARTH_FUSION_SPATIAL_DB_PASSWORD="***" # Oracle
# export EARTH_FUSION_SPATIAL_ADMIN_DB_USERNAME="***" # Oracle
# export EARTH_FUSION_SPATIAL_ADMIN_DB_PASSWORD="***" # Oracle
# 
cp ./config.ini ./bin/Debug/netcoreapp3.1/
dotnet build
./bin/Debug/netcoreapp3.1/earthfusion-backend
  • It's recommended to create a script.

Dev Logs

2020/7/21

  • HTTPS support.

2020/8/2

  • Response compression, enabled over HTTPS: source

2020/8/19

  • Use ini file for config

About

CSharp webapi for EarthFusion, project of Database course design, Tongji SSE, Jul 2020

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages