mirror of https://github.com/abpframework/abp.git
95 changed files with 610 additions and 177 deletions
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 48 KiB |
@ -0,0 +1,73 @@ |
|||||
|
using Volo.Abp.Features; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.Validation.StringValues; |
||||
|
using Volo.CmsKit.Localization; |
||||
|
|
||||
|
namespace Volo.CmsKit.Features; |
||||
|
public class CmsKitFeatureDefinitionProvider : FeatureDefinitionProvider |
||||
|
{ |
||||
|
public override void Define(IFeatureDefinitionContext context) |
||||
|
{ |
||||
|
var group = context.AddGroup(CmsKitFeatures.GroupName, |
||||
|
L("Feature:CmsKitGroup")); |
||||
|
|
||||
|
group.AddFeature(CmsKitFeatures.BlogEnable, |
||||
|
"true", |
||||
|
L("Feature:BlogEnable"), |
||||
|
L("Feature:BlogEnableDescription"), |
||||
|
new ToggleStringValueType()); |
||||
|
|
||||
|
group.AddFeature(CmsKitFeatures.CommentEnable, |
||||
|
"true", |
||||
|
L("Feature:CommentEnable"), |
||||
|
L("Feature:CommentEnableDescription"), |
||||
|
new ToggleStringValueType()); |
||||
|
|
||||
|
group.AddFeature(CmsKitFeatures.GlobalResourceEnable, |
||||
|
"true", |
||||
|
L("Feature:GlobalResourceEnable"), |
||||
|
L("Feature:GlobalResourceEnableDescription"), |
||||
|
new ToggleStringValueType()); |
||||
|
|
||||
|
group.AddFeature(CmsKitFeatures.MediaEnable, |
||||
|
"true", |
||||
|
L("Feature:MediaEnable"), |
||||
|
L("Feature:MediaEnableDescription"), |
||||
|
new ToggleStringValueType()); |
||||
|
|
||||
|
group.AddFeature(CmsKitFeatures.MenuEnable, |
||||
|
"true", |
||||
|
L("Feature:MenuEnable"), |
||||
|
L("Feature:MenuEnableDescription"), |
||||
|
new ToggleStringValueType()); |
||||
|
|
||||
|
group.AddFeature(CmsKitFeatures.PageEnable, |
||||
|
"true", |
||||
|
L("Feature:PageEnable"), |
||||
|
L("Feature:PageEnableDescription"), |
||||
|
new ToggleStringValueType()); |
||||
|
|
||||
|
group.AddFeature(CmsKitFeatures.RatingEnable, |
||||
|
"true", |
||||
|
L("Feature:RatingEnable"), |
||||
|
L("Feature:RatingEnableDescription"), |
||||
|
new ToggleStringValueType()); |
||||
|
|
||||
|
group.AddFeature(CmsKitFeatures.ReactionEnable, |
||||
|
"true", |
||||
|
L("Feature:ReactionEnable"), |
||||
|
L("Feature:ReactionEnableDescription"), |
||||
|
new ToggleStringValueType()); |
||||
|
|
||||
|
group.AddFeature(CmsKitFeatures.TagEnable, |
||||
|
"true", |
||||
|
L("Feature:TagEnable"), |
||||
|
L("Feature:TagEnableDescription"), |
||||
|
new ToggleStringValueType()); |
||||
|
} |
||||
|
|
||||
|
private static LocalizableString L(string name) |
||||
|
{ |
||||
|
return LocalizableString.Create<CmsKitResource>(name); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
namespace Volo.CmsKit.Features; |
||||
|
public static class CmsKitFeatures |
||||
|
{ |
||||
|
public const string GroupName = "CmsKit"; |
||||
|
|
||||
|
public const string BlogEnable = GroupName + ".BlogEnable"; |
||||
|
public const string CommentEnable = GroupName + ".CommentEnable"; |
||||
|
public const string GlobalResourceEnable = GroupName + ".GlobalResourceEnable"; |
||||
|
public const string MediaEnable = GroupName + ".MediaEnable"; |
||||
|
public const string MenuEnable = GroupName + ".MenuEnable"; |
||||
|
public const string PageEnable = GroupName + ".PageEnable"; |
||||
|
public const string RatingEnable = GroupName + ".RatingEnable"; |
||||
|
public const string ReactionEnable = GroupName + ".ReactionEnable"; |
||||
|
public const string TagEnable = GroupName + ".TagEnable"; |
||||
|
} |
||||
@ -0,0 +1,3 @@ |
|||||
|
import { Rule } from '@angular-devkit/schematics'; |
||||
|
|
||||
|
export type RuleReturn = ReturnType<Rule>; |
||||
@ -0,0 +1,13 @@ |
|||||
|
import express, { Request, Response } from 'express'; |
||||
|
import fs from 'fs'; |
||||
|
|
||||
|
const port = 4300; |
||||
|
const app = express(); |
||||
|
|
||||
|
app.get('/api/abp/api-definition', async (req: Request, res: Response) => { |
||||
|
const file = fs.readFileSync('./api-definition.json'); |
||||
|
res.contentType('application/json'); |
||||
|
res.send(file); |
||||
|
}); |
||||
|
|
||||
|
app.listen(port, () => console.log(`Server listening on http://localhost:${port}`)); |
||||
@ -0,0 +1,22 @@ |
|||||
|
{ |
||||
|
"name": "mocks-schematics", |
||||
|
"version": "0.0.1", |
||||
|
"description": "ABP Mock Proxy Generation App", |
||||
|
"scripts": { |
||||
|
"start": "nodemon mock-schematic-json.ts" |
||||
|
}, |
||||
|
"author": "", |
||||
|
"dependencies": { |
||||
|
"babel-preset-node6": "^11.0.0", |
||||
|
"express": "^4.18.1" |
||||
|
}, |
||||
|
"devDependencies": { |
||||
|
"@types/node": "^13.1.2", |
||||
|
"esm": "^3.2.25", |
||||
|
"ts-node": "^8.5.4", |
||||
|
"tsconfig-paths": "^3.9.0", |
||||
|
"typescript": "^3.7.4", |
||||
|
"nodemon": "^2.0.19", |
||||
|
"@types/express": "^4.17.13" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
{ |
||||
|
"compilerOptions": { |
||||
|
"target": "es5", |
||||
|
"module": "commonjs", |
||||
|
"outDir": "./dist", |
||||
|
"rootDir": "./src", |
||||
|
"strict": true, |
||||
|
"esModuleInterop": true, |
||||
|
"skipLibCheck": true, |
||||
|
"forceConsistentCasingInFileNames": true |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue