Skip to content

Commit

Permalink
Merge pull request #20 from cashwarden/test
Browse files Browse the repository at this point in the history
feat: 新增账本模块
  • Loading branch information
forecho committed Nov 13, 2020
2 parents 72f0957 + 75a587f commit e797e24
Show file tree
Hide file tree
Showing 39 changed files with 1,667 additions and 89 deletions.
6 changes: 6 additions & 0 deletions commands/FixController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

namespace app\commands;

use app\core\services\FixDataService;
use yii\console\Controller;

class FixController extends Controller
{
public function actionInitLedger()
{
FixDataService::initLedger();
$this->stdout("操作成功\n");
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"telegram-bot/api": "^2.3",
"ext-json": "*",
"ext-bcmath": "*",
"guzzlehttp/guzzle": "^7.0"
"guzzlehttp/guzzle": "^7.0",
"light/hashids": "^2.0"
},
"require-dev": {
"yiisoft/yii2-debug": "~2.1.0",
Expand Down
135 changes: 133 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions config/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
'requestId' => [
'class' => \yiier\helpers\RequestId::class,
],
'hashids' => [
'class' => 'light\hashids\Hashids',
'salt' => env('JWT_SECRET'),
'alphabet' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',
'minHashLength' => 20,
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
Expand Down
10 changes: 9 additions & 1 deletion config/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@
"GET <module>/site-config" => '/site/data',
"GET <module>/<alias:icons>" => '/site/<alias>',
"GET health-check" => 'site/health-check',

"GET <module>/ledgers/types" => '<module>/ledger/types',
"GET <module>/ledgers/categories" => '<module>/ledger/categories',
"POST <module>/ledger/members" => '<module>/ledger/inviting-member',
"GET <module>/ledger/members" => '<module>/ledger-member/index',
"PUT <module>/ledger/members/<id:\d+>" => '<module>/ledger-member/update',

[
'class' => 'yii\rest\UrlRule',
'controller' => [
Expand All @@ -101,9 +108,10 @@
'v1/record',
'v1/transaction',
'v1/recurrence',
'v1/ledger',
]
],
'<module>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>',
// '<module>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>',
],
],
],
Expand Down
111 changes: 75 additions & 36 deletions controllers/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,62 +77,101 @@ public function actionData()
],
'menu' => [
[
'text' => 'Main',
'text' => '账本',
'group' => false,
'children' => [
[
'text' => '仪表盘',
'link' => '/dashboard',
'icon' => 'anticon-dashboard',
],
// [
// 'text' => '账户',
// 'link' => '/account/index',
// 'icon' => 'anticon-wallet',
// ],
[
'text' => '记录',
'link' => '/record/index',
'icon' => 'anticon-database',
],
[
'text' => '分析',
'link' => '/analysis/index',
'icon' => 'anticon-area-chart',
],
[
'text' => '成员',
'link' => '/ledger/member',
'icon' => 'anticon-user',
],
[
'text' => '分类',
'link' => '/category/index',
'icon' => 'anticon-appstore',
],
[
'text' => '标签',
'link' => '/tag/index',
'icon' => 'anticon-appstore',
],
// [
// 'text' => '定时',
// 'link' => '/recurrence/index',
// 'icon' => 'anticon-field-time',
// ],
// [
// 'text' => '设置',
// 'icon' => 'anticon-setting',
// 'children' => [
// [
// 'text' => '个人设置',
// 'link' => '/settings/personal',
// 'icon' => 'anticon-user',
// ],
// [
// 'text' => '标签设置',
// 'link' => '/settings/tags',
// 'icon' => 'anticon-appstore',
// ],
// [
// 'text' => '规则设置',
// 'link' => '/settings/rules',
// 'icon' => 'anticon-group',
// ]
// ]
// ],
],
],
[
'text' => '全局',
'group' => true,
'children' => [
[
'text' => '账户',
'link' => '/account/index',
'icon' => 'anticon-account-book',
'icon' => 'anticon-wallet',
],

[
'text' => '记录',
'link' => '/record/index',
'icon' => 'anticon-database',
'text' => '账本',
'link' => '/ledger/index',
'icon' => 'anticon-account-book',
],

[
'text' => '定时',
'link' => '/recurrence/index',
'icon' => 'anticon-field-time',
],
[
'text' => '分析',
'link' => '/analysis/index',
'icon' => 'anticon-area-chart',
'text' => '规则',
'link' => '/rule/index',
'icon' => 'anticon-group',
],
[
'text' => '设置',
'icon' => 'anticon-setting',
'children' => [
[
'text' => '个人设置',
'link' => '/settings/personal',
'icon' => 'anticon-user',
],
[
'text' => '分类设置',
'link' => '/settings/categories',
'icon' => 'anticon-appstore',
],
[
'text' => '标签设置',
'link' => '/settings/tags',
'icon' => 'anticon-appstore',
],
[
'text' => '规则设置',
'link' => '/settings/rules',
'icon' => 'anticon-group',
]
]
],
]
]
],
],

]
];
}
Expand Down
Loading

0 comments on commit e797e24

Please sign in to comment.