• 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/PresetColumns.php
1
<?php
2

3
namespace Miaoxing\Plugin\Service;
4

5
use Miaoxing\Plugin\BaseService;
6
use Wei\Schema;
7

8
/**
9
 * @experimental may be rename, return Column object instead of Schema
10
 */
11
class PresetColumns extends BaseService
12
{
13
    /**
14
     * @var Schema
15
     */
16
    protected $schema;
17

18
    public function __construct(array $options = [])
19
    {
NEW
20
        parent::__construct($options);
×
NEW
21
        $this->schema = $this->wei->newInstance('schema');
×
22
    }
23

24
    /**
25
     * @svc
26
     */
27
    protected function appId(): Schema
28
    {
NEW
29
        return $this->schema->uBigInt('app_id')->comment('应用编号');
×
30
    }
31

32
    /**
33
     * @svc
34
     */
35
    protected function userId(): Schema
36
    {
NEW
37
        return $this->schema->uBigInt('user_id')->comment('用户编号');
×
38
    }
39

40
    /**
41
     * @svc
42
     */
43
    protected function sort(): Schema
44
    {
NEW
45
        return $this->schema->smallInt('sort')->defaults(50)->comment('顺序,从大到小排列');
×
46
    }
47

48
    /**
49
     * @svc
50
     */
51
    protected function isEnabled(): Schema
52
    {
NEW
53
        return $this->schema->bool('is_enabled')->defaults(1)->comment('是否启用');
×
54
    }
55
}
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