• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

miaoxing / plugin / 13066017523

26 Jan 2025 04:40AM UTC coverage: 41.349% (-1.1%) from 42.441%
13066017523

push

github

twinh
feat(plugin, experimental): 增加 `PresetColumns` 服务,用于生成常用的字段

0 of 6 new or added lines in 1 file covered. (0.0%)

147 existing lines in 4 files now uncovered.

1238 of 2994 relevant lines covered (41.35%)

36.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Service/ConfigModel.php
1
<?php
2

3
namespace Miaoxing\Plugin\Service;
4

5
use Miaoxing\Plugin\BaseModel;
6
use Miaoxing\Plugin\ConstTrait;
7
use Miaoxing\Plugin\Model\HasAppIdTrait;
8
use Miaoxing\Plugin\Model\ModelTrait;
9
use Miaoxing\Plugin\Model\ReqQueryTrait;
10
use Wei\Model\SoftDeleteTrait;
11

12
/**
13
 * 配置模型
14
 *
15
 * @property int|null $id
16
 * @property string $appId 应用编号
17
 * @property string $name
18
 * @property string $type 值的类型,s:字符串
19
 * @property string $value
20
 * @property string $comment
21
 * @property string|null $createdAt
22
 * @property string|null $updatedAt
23
 * @property string $createdBy
24
 * @property string $updatedBy
25
 * @property string|null $deletedAt
26
 * @property string $deletedBy
27
 */
28
class ConfigModel extends BaseModel
29
{
30
    use ConstTrait;
31
    use HasAppIdTrait;
32
    use ModelTrait;
33
    use ReqQueryTrait;
34
    use SoftDeleteTrait;
35

36
    public const TYPE_STRING = 's';
37

38
    public const TYPE_BOOL = 'b';
39

40
    public const TYPE_INT = 'i';
41

42
    public const TYPE_FLOAT = 'f';
43

44
    public const TYPE_NULL = 'n';
45

46
    public const TYPE_ARRAY = 'a';
47

48
    public const TYPE_OBJECT = 'o';
49

50
    public const TYPE_JSON = 'j';
51

52
    public const TYPE_EXPRESS = 'e';
53

54
    protected $virtual = [
55
        'typeName',
56
    ];
57

58
    /**
59
     * @var array
60
     */
61
    protected $typeNames = [
62
        self::TYPE_STRING => '字符串',
63
        self::TYPE_BOOL => '布尔值',
64
        self::TYPE_INT => '整数',
65
        self::TYPE_FLOAT => '小数',
66
        self::TYPE_NULL => 'NULL',
67
        self::TYPE_ARRAY => '数组',
68
        self::TYPE_JSON => 'JSON',
69
        self::TYPE_OBJECT => '对象',
70
        self::TYPE_EXPRESS => '表达式',
71
    ];
72

73
    /**
74
     * 类型名称
75
     *
76
     * @return string|null
77
     */
78
    protected function getTypeNameAttribute(): ?string
79
    {
UNCOV
80
        return $this->typeNames[$this->type] ?? null;
×
81
    }
82
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc