Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update code coverage and simplify phone number validation #533

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/Model/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* @property int $updated_by 更新者
* @property Carbon $created_at 创建时间
* @property Carbon $updated_at 更新时间
* @property Carbon $deleted_at 删除时间
* @property string $remark 备注
*/
final class Attachment extends MineModel
Expand All @@ -44,10 +43,10 @@ final class Attachment extends MineModel
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['id', 'storage_mode', 'origin_name', 'object_name', 'hash', 'mime_type', 'storage_path', 'suffix', 'size_byte', 'size_info', 'url', 'created_by', 'updated_by', 'created_at', 'updated_at', 'deleted_at', 'remark'];
protected array $fillable = ['id', 'storage_mode', 'origin_name', 'object_name', 'hash', 'mime_type', 'storage_path', 'suffix', 'size_byte', 'size_info', 'url', 'created_by', 'updated_by', 'created_at', 'updated_at','remark'];

/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['id' => 'integer', 'storage_mode' => 'integer', 'size_byte' => 'integer', 'created_by' => 'integer', 'updated_by' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime'];
protected array $casts = ['id' => 'integer', 'storage_mode' => 'integer', 'size_byte' => 'integer', 'created_by' => 'integer', 'updated_by' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime',];
}
4 changes: 2 additions & 2 deletions app/Model/Permission/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ final class User extends Model
* 隐藏的字段列表.
* @var string[]
*/
protected array $hidden = ['password', 'deleted_at'];
protected array $hidden = ['password'];

/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['id', 'username', 'password', 'user_type', 'nickname', 'phone', 'email', 'avatar', 'signed', 'status', 'login_ip', 'login_time', 'backend_setting', 'created_by', 'updated_by', 'created_at', 'updated_at', 'deleted_at', 'remark'];
protected array $fillable = ['id', 'username', 'password', 'user_type', 'nickname', 'phone', 'email', 'avatar', 'signed', 'status', 'login_ip', 'login_time', 'backend_setting', 'created_by', 'updated_by', 'created_at', 'updated_at', 'remark'];

/**
* The attributes that should be cast to native types.
Expand Down
3 changes: 0 additions & 3 deletions app/Repository/Logstash/UserOperationLogRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ public function handleSearch(Builder $query, array $params): Builder
})
->when(Arr::get($params, 'updated_at'), static function (Builder $query, $updated_at) {
$query->whereBetween('updated_at', $updated_at);
})
->when(Arr::get($params, 'deleted_at'), static function (Builder $query, $deleted_at) {
$query->whereBetween('deleted_at', $deleted_at);
});
}
}
6 changes: 1 addition & 5 deletions app/Schema/AttachmentSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ final class AttachmentSchema implements \JsonSerializable
#[Property(property: 'updated_at', title: '', type: 'mixed')]
public mixed $updatedAt;

#[Property(property: 'deleted_at', title: '', type: 'mixed')]
public mixed $deletedAt;

#[Property(property: 'remark', title: '备注', type: 'string')]
public ?string $remark;

Expand All @@ -87,12 +84,11 @@ public function __construct(Attachment $model)
$this->updatedBy = $model->updated_by;
$this->createdAt = $model->created_at;
$this->updatedAt = $model->updated_at;
$this->deletedAt = $model->deleted_at;
$this->remark = $model->remark;
}

public function jsonSerialize(): mixed
{
return ['id' => $this->id, 'storage_mode' => $this->storageMode, 'origin_name' => $this->originName, 'object_name' => $this->objectName, 'hash' => $this->hash, 'mime_type' => $this->mimeType, 'storage_path' => $this->storagePath, 'suffix' => $this->suffix, 'size_byte' => $this->sizeByte, 'size_info' => $this->sizeInfo, 'url' => $this->url, 'created_by' => $this->createdBy, 'updated_by' => $this->updatedBy, 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt, 'deleted_at' => $this->deletedAt, 'remark' => $this->remark];
return ['id' => $this->id, 'storage_mode' => $this->storageMode, 'origin_name' => $this->originName, 'object_name' => $this->objectName, 'hash' => $this->hash, 'mime_type' => $this->mimeType, 'storage_path' => $this->storagePath, 'suffix' => $this->suffix, 'size_byte' => $this->sizeByte, 'size_info' => $this->sizeInfo, 'url' => $this->url, 'created_by' => $this->createdBy, 'updated_by' => $this->updatedBy, 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt,'remark' => $this->remark];
zds-s marked this conversation as resolved.
Show resolved Hide resolved
}
}
6 changes: 1 addition & 5 deletions app/Schema/RoleSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ final class RoleSchema implements \JsonSerializable
#[Property(property: 'updated_at', title: '', type: 'string')]
public string $updatedAt;

#[Property(property: 'deleted_at', title: '', type: 'string')]
public string $deletedAt;

#[Property(property: 'remark', title: '备注', type: 'string')]
public ?string $remark;

Expand All @@ -68,12 +65,11 @@ public function __construct(Role $model)
$this->updatedBy = $model->updated_by;
$this->createdAt = $model->created_at;
$this->updatedAt = $model->updated_at->format(CarbonInterface::DEFAULT_TO_STRING_FORMAT);
$this->deletedAt = $model->deleted_at->format(CarbonInterface::DEFAULT_TO_STRING_FORMAT);
$this->remark = $model->remark;
}

public function jsonSerialize(): mixed
{
return ['id' => $this->id, 'name' => $this->name, 'code' => $this->code, 'data_scope' => $this->dataScope, 'status' => $this->status, 'sort' => $this->sort, 'created_by' => $this->createdBy, 'updated_by' => $this->updatedBy, 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt, 'deleted_at' => $this->deletedAt, 'remark' => $this->remark];
return ['id' => $this->id, 'name' => $this->name, 'code' => $this->code, 'data_scope' => $this->dataScope, 'status' => $this->status, 'sort' => $this->sort, 'created_by' => $this->createdBy, 'updated_by' => $this->updatedBy, 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt,'remark' => $this->remark];
zds-s marked this conversation as resolved.
Show resolved Hide resolved
}
}
6 changes: 1 addition & 5 deletions app/Schema/UserOperationLogSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ class UserOperationLogSchema implements \JsonSerializable
#[Property(property: 'updated_at', title: '更新时间', type: 'mixed')]
public mixed $updatedAt;

#[Property(property: 'deleted_at', title: '删除时间', type: 'mixed')]
public mixed $deletedAt;

#[Property(property: 'remark', title: '备注', type: 'string')]
public ?string $remark;

Expand All @@ -83,12 +80,11 @@ public function __construct(UserOperationLog $model)
$this->updatedBy = $model->updated_by;
$this->createdAt = $model->created_at;
$this->updatedAt = $model->updated_at;
$this->deletedAt = $model->deleted_at;
$this->remark = $model->remark;
}

public function jsonSerialize(): mixed
{
return ['id' => $this->id, 'username' => $this->username, 'method' => $this->method, 'router' => $this->router, 'service_name' => $this->serviceName, 'ip' => $this->ip, 'ip_location' => $this->ipLocation, 'request_data' => $this->requestData, 'response_code' => $this->responseCode, 'response_data' => $this->responseData, 'created_by' => $this->createdBy, 'updated_by' => $this->updatedBy, 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt, 'deleted_at' => $this->deletedAt, 'remark' => $this->remark];
return ['id' => $this->id, 'username' => $this->username, 'method' => $this->method, 'router' => $this->router, 'service_name' => $this->serviceName, 'ip' => $this->ip, 'ip_location' => $this->ipLocation, 'request_data' => $this->requestData, 'response_code' => $this->responseCode, 'response_data' => $this->responseData, 'created_by' => $this->createdBy, 'updated_by' => $this->updatedBy, 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt,'remark' => $this->remark];
zds-s marked this conversation as resolved.
Show resolved Hide resolved
}
}
6 changes: 1 addition & 5 deletions app/Schema/UserSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ final class UserSchema implements \JsonSerializable
#[Property(property: 'updated_at', title: '更新时间', type: 'string')]
public mixed $updatedAt;

#[Property(property: 'deleted_at', title: '删除时间', type: 'string')]
public mixed $deletedAt;

#[Property(property: 'remark', title: '备注', type: 'string')]
public ?string $remark;

Expand All @@ -93,12 +90,11 @@ public function __construct(User $model)
$this->updatedBy = $model->updated_by;
$this->createdAt = $model->created_at;
$this->updatedAt = $model->updated_at;
$this->deletedAt = $model->deleted_at;
$this->remark = $model->remark;
}

public function jsonSerialize(): mixed
{
return ['id' => $this->id, 'username' => $this->username, 'user_type' => $this->userType, 'nickname' => $this->nickname, 'phone' => $this->phone, 'email' => $this->email, 'avatar' => $this->avatar, 'signed' => $this->signed, 'status' => $this->status, 'login_ip' => $this->loginIp, 'login_time' => $this->loginTime, 'backend_setting' => $this->backendSetting, 'created_by' => $this->createdBy, 'updated_by' => $this->updatedBy, 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt, 'deleted_at' => $this->deletedAt, 'remark' => $this->remark];
return ['id' => $this->id, 'username' => $this->username, 'user_type' => $this->userType, 'nickname' => $this->nickname, 'phone' => $this->phone, 'email' => $this->email, 'avatar' => $this->avatar, 'signed' => $this->signed, 'status' => $this->status, 'login_ip' => $this->loginIp, 'login_time' => $this->loginTime, 'backend_setting' => $this->backendSetting, 'created_by' => $this->createdBy, 'updated_by' => $this->updatedBy, 'created_at' => $this->createdAt, 'updated_at' => $this->updatedAt, 'remark' => $this->remark];
zds-s marked this conversation as resolved.
Show resolved Hide resolved
}
}
1 change: 0 additions & 1 deletion storage/languages/en/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
'updated_by ' => ' Updater ',
'created_at' => 'Creation time',
'updated_at ' => ' Update time ',
'deleted_at' => 'Delete time',
'Remark ' => ' Remark ',
'username_exist' => 'Username already exists',
'Enums' => [
Expand Down
1 change: 0 additions & 1 deletion storage/languages/zh_CN/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
'updated_by' => '更新者',
'created_at' => '创建时间',
'updated_at' => '更新时间',
'deleted_at' => '删除时间',
'remark' => '备注',
'username_exist' => '用户名已存在',
'enums' => [
Expand Down
1 change: 0 additions & 1 deletion storage/languages/zh_TW/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
'updated_by' => '更新者',
'created_at' => '創建時間',
'updated_at' => '更新時間',
'deleted_at' => '刪除時間',
'remark' => '備註',
'username_exist' => '用戶名已存在',
'enums' => [
Expand Down
Loading