-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
25 changed files
with
941 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
; 用户注册设置 | ||
|
||
invitation = true |
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
import { createDocument } from '../types/proxys/group' | ||
|
||
export interface Groups { | ||
[propsName: string]: createDocument | ||
} | ||
|
||
export const setting: Groups = { | ||
['Creator']: { | ||
name: '创建者', | ||
level: 9999, | ||
description: '创建者拥有系统所有权限,且只有一个帐号' | ||
}, | ||
['superAdministrator']: { | ||
name: '超级管理员', | ||
level: 9998, | ||
description: '除创建者外的最高权力者,拥有与创建者几乎相同的权限' | ||
}, | ||
['teamAdministrator']: { | ||
name: '团队管理员', | ||
level: 7999, | ||
description: '相关团队的最高权力者', | ||
store: { | ||
upload_type: [], | ||
download_type: [] | ||
} | ||
} | ||
} |
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,45 @@ | ||
import { Schema, model } from 'mongoose' | ||
|
||
const schema: Schema = new Schema({ | ||
id: { | ||
type: Number, | ||
default: 0, | ||
index: { unique: true } | ||
}, | ||
name: { | ||
type: String | ||
}, | ||
cdkey: { | ||
type: String, | ||
required: true | ||
}, | ||
type: { | ||
type: String | ||
}, | ||
setting: { | ||
type: Object, | ||
default: {} | ||
}, | ||
stint: { | ||
type: Number, | ||
default: 0 | ||
}, | ||
uses: { | ||
type: Number, | ||
default: 0 | ||
}, | ||
used: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
create_at: { | ||
type: Date, | ||
default: Date.now | ||
}, | ||
last_at: { | ||
type: Date, | ||
default: Date.now | ||
} | ||
}) | ||
|
||
export default model('exchange', schema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as Bluebird from 'bluebird' | ||
import * as mongoose from 'mongoose' | ||
import { MongooseDao, MongooseDaoSetting, QueryOptions } from 'kenote-mongoose-helper' | ||
import __Models from '../models' | ||
import { createDocument, responseDocument } from '../types/proxys/exchange' | ||
import * as uuid from 'uuid' | ||
|
||
(<mongoose.Mongoose>mongoose).Promise = Bluebird | ||
const Model: mongoose.Model<mongoose.Document, {}> = <mongoose.Model<mongoose.Document, {}>> __Models.exchangeModel | ||
const options: QueryOptions = { | ||
populate: { path: '' }, | ||
seqModel: __Models.seqModel | ||
} | ||
|
||
@MongooseDaoSetting({ | ||
idName: 'id' | ||
}) | ||
class ExchangeDao extends MongooseDao {} | ||
|
||
class ExchangeProxy { | ||
|
||
public Dao: MongooseDao = new ExchangeDao(Model, options) | ||
|
||
public async create (doc: createDocument): Bluebird<responseDocument | {}> { | ||
let cdkey: string = uuid.v4() | ||
let exchange: responseDocument | {} = await this.Dao.insert({ ...doc, cdkey }) | ||
return exchange | ||
} | ||
|
||
} | ||
|
||
export default new ExchangeProxy() |
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,22 @@ | ||
import { TaskHelper, TaskSetting } from 'kenote-task-helper' | ||
import initialize from './tasks/initialize' | ||
import invitation from './tasks/invitation' | ||
|
||
@TaskSetting({ | ||
title: '选择操作类型:', | ||
tasks: [ | ||
{ | ||
name: '初始化数据', | ||
value: 'initialize', | ||
script: initialize | ||
}, | ||
{ | ||
name: '注册邀请码', | ||
value: 'invitation', | ||
script: invitation | ||
}, | ||
] | ||
}) | ||
class Task extends TaskHelper {} | ||
|
||
new Task().start() |
Oops, something went wrong.