Skip to content

Commit

Permalink
Merge pull request #114 from mineadmin/2.0.x-dev
Browse files Browse the repository at this point in the history
beta.3
  • Loading branch information
zds-s authored Jan 31, 2024
2 parents afbd1d0 + 8056ef8 commit e792b3e
Show file tree
Hide file tree
Showing 17 changed files with 1,122 additions and 209 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@ env:
SWOW_VERSION: 'develop'

jobs:
ci:
mineadmin:
name: Test PHP ${{ matrix.php-version }} on ${{ matrix.engine }}
runs-on: "${{ matrix.os }}"
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
# How to use Redis
redis:
image: redis
ports:
- 6379/tcp
strategy:
matrix:
os: [ ubuntu-latest ]
Expand All @@ -26,6 +39,11 @@ jobs:
tools: phpize
ini-values: opcache.enable_cli=0
coverage: none
- name: Verify MySQL connection from host
run: |
sudo apt-get install -y mysql-client libmysqlclient-dev
mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot mysql
- name: Setup Swoole
if: ${{ matrix.engine == 'swoole' }}
run: |
Expand All @@ -46,6 +64,11 @@ jobs:
- name: Setup Packages
run: composer install -o --no-scripts
- name: Run Test Cases
env:
DB_PASSWORD: root
DB_USERNAME: root
DB_PORT: ${{ job.services.mysql.ports[3306] }}
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
run: |
vendor/bin/php-cs-fixer fix --dry-run # cs-fixer 格式化代码
composer analyse # phpstan 静态代码分析
Expand Down
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"pest_2.33.1","defects":[],"times":{"P\\Tests\\HttpCases\\ExampleTest::__pest_evaluable_index_testing":0.015}}
2 changes: 0 additions & 2 deletions app/Setting/Service/SettingCrontabService.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public function read(mixed $id, array $column = ['*']): ?MineModel

/**
* 立即执行一次定时任务
* @param mixed $id
* @return bool|null
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
Expand Down
4 changes: 0 additions & 4 deletions app/System/Mapper/SystemQueueMessageMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ public function delete(array $ids): bool

/**
* 更新中间表数据状态
* @param array $ids
* @param string $columnName
* @param int $value
* @return bool
*/
public function updateDataStatus(array $ids, string $columnName = 'read_status', int $value = 2): bool
{
Expand Down
2 changes: 0 additions & 2 deletions app/System/Service/SystemDeptService.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ public function checkChildrenExists(int $id): bool

/**
* 处理数据.
* @param array $data
* @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
Expand Down
2 changes: 0 additions & 2 deletions app/System/Service/SystemMenuService.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ public function checkChildrenExists(int $id): bool

/**
* 处理数据.
* @param array $data
* @return array
*/
protected function handleData(array $data): array
{
Expand Down
2 changes: 0 additions & 2 deletions app/System/Service/SystemQueueMessageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public function __construct(SystemQueueMessageMapper $mapper)

/**
* 获取用户未读消息.
* @param int $id
* @return array
*/
public function getUnreadMessage(int $id): array
{
Expand Down
6 changes: 0 additions & 6 deletions app/System/Service/SystemUploadFileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ class SystemUploadFileService extends AbstractService
*/
public $mapper;

/**
* @var ConfigInterface
*/
#[Inject]
protected ConfigInterface $config;

Expand Down Expand Up @@ -111,9 +108,6 @@ public function saveNetworkImage(array $data): array

/**
* 通过hash获取文件信息.
* @param string $hash
* @param array $columns
* @return mixed
*/
public function readByHash(string $hash, array $columns = ['*']): mixed
{
Expand Down
10 changes: 0 additions & 10 deletions app/System/Service/SystemUserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ public function update(mixed $id, array $data): bool

/**
* 获取在线用户.
* @param array $params
* @return array
* @throws ContainerExceptionInterface
* @throws InvalidArgumentException
* @throws NotFoundExceptionInterface
Expand Down Expand Up @@ -183,8 +181,6 @@ public function realDelete(array $ids): bool

/**
* 强制下线用户.
* @param string $id
* @return bool
* @throws ContainerExceptionInterface
* @throws InvalidArgumentException
* @throws NotFoundExceptionInterface
Expand All @@ -209,8 +205,6 @@ public function initUserPassword(int $id, string $password = '123456'): bool

/**
* 清除用户缓存.
* @param string $id
* @return bool
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws \RedisException
Expand All @@ -234,8 +228,6 @@ public function clearCache(string $id): bool

/**
* 设置用户首页.
* @param array $params
* @return bool
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws \RedisException
Expand All @@ -252,8 +244,6 @@ public function setHomePage(array $params): bool

/**
* 用户更新个人资料.
* @param array $params
* @return bool
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws \RedisException
Expand Down
22 changes: 13 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,24 @@
"description": "Quickly build a background management system for web applications",
"license": "Apache-2.0",
"require": {
"xmo/jwt-auth": "2.0.0-beta",
"xmo/mine-core": "v2.0.0-beta.2",
"xmo/mine-generator": "2.0.0-beta.2",
"xmo/mine-helpers": "2.0.0-beta.2",
"xmo/jwt-auth": "2.0.x-dev",
"xmo/mine-core": "2.0.x-dev",
"xmo/mine-generator": "2.0.x-dev",
"xmo/mine-helpers": "2.0.x-dev",
"xmo/mine-office": "^1.5",
"xmo/mine-service": "2.0.0-beta",
"xmo/mine-translatable": "2.0.0-beta"
"xmo/mine-service": "2.0.x-dev",
"xmo/mine-translatable": "2.0.x-dev"
},
"require-dev": {
"friendsofhyperf/pest-plugin-hyperf": "^3.1",
"friendsofphp/php-cs-fixer": "^3.0",
"hyperf/devtool": "3.1.*",
"hyperf/ide-helper": "3.1.*",
"hyperf/testing": "3.1.*",
"hyperf/watcher": "3.1.*",
"mockery/mockery": "^1.0",
"pestphp/pest": "^2.33",
"pestphp/pest-plugin-drift": "^2.5",
"phpstan/phpstan": "^1.0",
"swoole/ide-helper": "^5.0"
},
Expand All @@ -47,7 +50,7 @@
},
"autoload-dev": {
"psr-4": {
"HyperfTest\\": "./test/"
"HyperfTests\\": "./tests/"
}
},
"minimum-stability": "dev",
Expand All @@ -56,7 +59,8 @@
"optimize-autoloader": true,
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true
"composer/package-versions-deprecated": true,
"pestphp/pest-plugin": true
}
},
"extra": [],
Expand All @@ -67,7 +71,7 @@
"post-autoload-dump": [
"rm -rf runtime/container"
],
"test": "co-phpunit --prepend test/bootstrap.php -c phpunit.xml --colors=always",
"test": "pest --coroutine --prepend tests/bootstrap.php -c phpunit.xml --colors=always",
"cs-fix": "php-cs-fixer fix $1",
"analyse": "phpstan analyse --memory-limit 500M -l 0 -c phpstan.neon ./app ./config ./api ./common",
"start": [
Expand Down
Loading

0 comments on commit e792b3e

Please sign in to comment.