-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
019e8b1
commit a703f85
Showing
12 changed files
with
1,109 additions
and
635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ export const APP = { | |
ADMIN_EMAIL: (argv.admin_email as string) || 'admin email, e.g. [email protected]', | ||
FE_NAME: 'Surmon.me', | ||
FE_URL: 'https://surmon.me', | ||
STATIC_URL: 'https://static.surmon.me', | ||
} | ||
|
||
export const PROJECT = { | ||
|
@@ -87,13 +88,15 @@ export const GOOGLE = { | |
serverAccountFilePath: path.resolve(ROOT_PATH, 'classified', 'google_service_account.json'), | ||
} | ||
|
||
export const ALIYUN_CLOUD_STORAGE = { | ||
accessKey: (argv.cs_access_key as string) || 'cloudstorage access key for cloud storage', | ||
secretKey: (argv.cs_secret_key as string) || 'cloudstorage secret key for cloud storage', | ||
aliyunAcsARN: (argv.cs_aliyun_acs as string) || 'aliyun Acs ARN, e.g. acs:ram::xxx:role/xxx', | ||
export const AWS = { | ||
accessKeyId: argv.aws_access_key_id as string, | ||
secretAccessKey: argv.aws_secret_access_key as string, | ||
s3StaticRegion: argv.aws_s3_static_region as string, | ||
s3StaticBucket: argv.aws_s3_static_bucket as string, | ||
} | ||
|
||
export const DB_BACKUP = { | ||
bucket: (argv.db_backup_bucket as string) || 'cloudstorage bucket name for dbbackup', | ||
region: (argv.db_backup_region as string) || 'cloudstorage region for dbbackup, e.g. oss-cn-hangzhou', | ||
s3Region: argv.db_backup_s3_region as string, | ||
s3Bucket: argv.db_backup_s3_bucket as string, | ||
password: argv.db_backup_file_password as string, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { CacheService } from '@app/processors/cache/cache.service' | ||
import * as CACHE_KEY from '@app/constants/cache.constant' | ||
|
||
export const getTodayViewsCount = async (cache: CacheService) => { | ||
const count = await cache.get<number>(CACHE_KEY.TODAY_VIEWS) | ||
return count ? Number(count) : 0 | ||
} | ||
|
||
export const increaseTodayViewsCount = async (cache: CacheService) => { | ||
const views = await getTodayViewsCount(cache) | ||
await cache.set(CACHE_KEY.TODAY_VIEWS, views + 1) | ||
return views + 1 | ||
} | ||
|
||
export const resetTodayViewsCount = (cache: CacheService) => { | ||
return cache.set(CACHE_KEY.TODAY_VIEWS, 0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.