Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Sep 4, 2023
1 parent 576b8db commit afd83c0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/Http/Actions/SendTestMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ public function handle(Request $request)
$type = '默认';
}

$title = '当前使用的【'.$type.'配置】企业微信通道发送的测试消息';
$title = '当前使用的【' . $type . '配置】企业微信通道发送的测试消息';
$result = $this->send($config, $user->name, $title);
if (0 == $result['code']) {
return $this->response()->success('使用【'.$type.'配置】企业微信通道发送消息成功');
return $this->response()->success('使用【' . $type . '配置】企业微信通道发送消息成功');
}

return $this->response()->success('使用【'.$type.'配置】企业微信通道发送消息失败:'.$result['message']);
return $this->response()->success('使用【' . $type . '配置】企业微信通道发送消息失败:' . $result['message']);
}
}
4 changes: 2 additions & 2 deletions src/Http/Controllers/DcatWechatWorkPushUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ protected function grid()
$grid->column('id', '序号');
$grid->column('name', '推送账号')->copyable();
$grid->column('sc_secret', '推送密钥')->display(function ($scSecret) {
return '<a href="javascript:void(0);" class="grid-column-copyable text-muted" data-content="'.$scSecret.'" title="" data-placement="bottom" data-original-title="已复制!"><i class="fa fa-copy"></i></a>&nbsp;***';
return '<a href="javascript:void(0);" class="grid-column-copyable text-muted" data-content="' . $scSecret . '" title="" data-placement="bottom" data-original-title="已复制!"><i class="fa fa-copy"></i></a>&nbsp;***';
});
$grid->column('api_address', '推送Api地址')->display(function () {
/* @var DcatWechatWorkPushUser $this */
$apiAddressShow = $this->api_address_show;
$apiAddress = $this->api_address;

return '<a href="javascript:void(0);" class="grid-column-copyable text-muted" data-content="'.$apiAddress.'" title="" data-placement="bottom" data-original-title="已复制!"><i class="fa fa-copy"></i></a>&nbsp;'.$apiAddressShow;
return '<a href="javascript:void(0);" class="grid-column-copyable text-muted" data-content="' . $apiAddress . '" title="" data-placement="bottom" data-original-title="已复制!"><i class="fa fa-copy"></i></a>&nbsp;' . $apiAddressShow;
});
$grid->column('status', '账号状态')->switch();
$grid->column('is_own_wechat_work', '自定企业微信')->bool();
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Traits/DcatWechatWorkPushSendMessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public function send(array $config, string $name, string $title, ?string $conten
{
$message = $title;
if ($content) {
$message .= "\n\n".$content;
$message .= "\n\n" . $content;
}
if ($url) {
$message .= "\n\n".'<a href="'.$url.'">'.($urlTitle ?: $url).'</a>';
$message .= "\n\n" . '<a href="' . $url . '">' . ($urlTitle ?: $url) . '</a>';
}

if (
Expand Down
2 changes: 1 addition & 1 deletion src/Http/push.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

use Asundust\DcatWechatWorkPush\Http\Controllers\DcatWechatWorkPushHandleController;

Route::match(['get', 'post'], 'push/{secret}', DcatWechatWorkPushHandleController::class.'@push');
Route::match(['get', 'post'], 'push/{secret}', DcatWechatWorkPushHandleController::class . '@push');
10 changes: 5 additions & 5 deletions src/Models/DcatWechatWorkPushUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class DcatWechatWorkPushUser extends Model
{
protected $fillable = ['name', 'sc_secret', 'status', 'corp_id', 'agent_id', 'secret'];

const STATES = [
public const STATES = [
0 => '禁用',
1 => '启用',
];

const IS_OWN_WECHAT_WORK = [
public const IS_OWN_WECHAT_WORK = [
0 => '',
1 => '',
];

const STATES_SWITCH = [
public const STATES_SWITCH = [
'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],
'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
];
Expand Down Expand Up @@ -65,12 +65,12 @@ public function getIsOwnWechatWorkAttribute(): bool
// api_address_show
public function getApiAddressShowAttribute(): string
{
return config('app.url').'/push/***';
return config('app.url') . '/push/***';
}

// api_address
public function getApiAddressAttribute(): string
{
return config('app.url').'/push/'.$this->sc_secret.'?title=我是标题&content=我是内容(可不填)&url=我是链接(可不填)&url_title=链接标题(可不填)';
return config('app.url') . '/push/' . $this->sc_secret . '?title=我是标题&content=我是内容(可不填)&url=我是链接(可不填)&url_title=链接标题(可不填)';
}
}

0 comments on commit afd83c0

Please sign in to comment.