Code Monkey home page Code Monkey logo

Comments (3)

Yurunsoft avatar Yurunsoft commented on June 5, 2024

麻烦贴一下完整代码,感觉是你的 @Table 注解没有 use

from tdengine-orm.

onlyshow avatar onlyshow commented on June 5, 2024
[WARNING] Doctrine\Common\Annotations\AnnotationException: [Semantical Error] Annotation @Table is not allowed to be declared on class App\Model\TD\AlertLog. You may only use this annotation on these code elements: CLASS.(0) in /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:40
Stack trace:
#0 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(865): Doctrine\Common\Annotations\AnnotationException::semanticalError('Annotation @Tab...')
#1 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(720): Doctrine\Common\Annotations\DocParser->Annotation()
#2 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(377): Doctrine\Common\Annotations\DocParser->Annotations()
#3 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(146): Doctrine\Common\Annotations\DocParser->parse('/**\n * @Table(n...', 'class App\\Model...')
#4 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(154): Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object(ReflectionClass))
#5 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/Meta/Meta.php(63): Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object(ReflectionClass), 'Yurun\\TDEngine\\...')
#6 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/Meta/MetaManager.php(32): Yurun\TDEngine\Orm\Meta\Meta->__construct('App\\Model\\TD\\Al...')
#7 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/BaseModel.php(191): Yurun\TDEngine\Orm\Meta\MetaManager::get('App\\Model\\TD\\Al...')
#8 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/BaseModel.php(34): Yurun\TDEngine\Orm\BaseModel::__getMeta()
#9 /home/www/hyperf-skeleton/app/Service/CreateAlert.php(195): Yurun\TDEngine\Orm\BaseModel->__construct(Array, 'LL_10000005')
#10 /home/www/hyperf-skeleton/app/Service/CreateAlert.php(159): App\Service\CreateAlert->insertAlertLog(Array, Array)
#11 /home/www/hyperf-skeleton/app/Service/CreateAlert.php(52): App\Service\CreateAlert->sendGrpc(Array, Array, Object(Alarm\Service\V1\AlarmRequest))
#12 /home/www/hyperf-skeleton/app/Command/NodeCommand.php(54): App\Service\CreateAlert->handle()
#13 /home/www/hyperf-skeleton/vendor/hyperf/utils/src/Functions.php(274): App\Command\NodeCommand->App\Command\{closure}()
#14 /home/www/hyperf-skeleton/vendor/hyperf/utils/src/Coroutine.php(62): call(Object(Closure))
#15 {main}
<?php

namespace App\Model\TD;

use App\Model\TD\Enum\DataType;
use Yurun\TDEngine\Orm\Annotation\Field;
use Yurun\TDEngine\Orm\Annotation\Table;
use Yurun\TDEngine\Orm\Annotation\Tag;
use Yurun\TDEngine\Orm\BaseModel;

/**
 * @Table(name="log", database="alert")
 */
class AlertLog extends BaseModel
{
    /**
     * @Field(type=DataType::TIMESTAMP)
     *
     * @var int
     */
    public $ts;

    /**
     * @Tag(type=DataType::JSON)
     *
     * @var string
     */
    public $information;
}

from tdengine-orm.

onlyshow avatar onlyshow commented on June 5, 2024
string(55) "self::$annotationMetadata[$name]['targets']:1-$target:1"
string(55) "self::$annotationMetadata[$name]['targets']:1-$target:1"
string(55) "self::$annotationMetadata[$name]['targets']:1-$target:1"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:1-$target:1"
string(55) "self::$annotationMetadata[$name]['targets']:4-$target:4"
string(55) "self::$annotationMetadata[$name]['targets']:1-$target:4"
[WARNING] Doctrine\Common\Annotations\AnnotationException: [Semantical Error] Annotation @Table is not allowed to be declared on class App\Model\TD\AlertLog. You may only use this annotation on these code elements: CLASS.(0) in /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:40
Stack trace:
#0 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(867): Doctrine\Common\Annotations\AnnotationException::semanticalError('Annotation @Tab...')
#1 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(720): Doctrine\Common\Annotations\DocParser->Annotation()
#2 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(377): Doctrine\Common\Annotations\DocParser->Annotations()
#3 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(146): Doctrine\Common\Annotations\DocParser->parse('/**\n * @Table(n...', 'class App\\Model...')
#4 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(154): Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object(ReflectionClass))
#5 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/Meta/Meta.php(63): Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object(ReflectionClass), 'Yurun\\TDEngine\\...')
#6 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/Meta/MetaManager.php(32): Yurun\TDEngine\Orm\Meta\Meta->__construct('App\\Model\\TD\\Al...')
#7 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/BaseModel.php(191): Yurun\TDEngine\Orm\Meta\MetaManager::get('App\\Model\\TD\\Al...')
#8 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/BaseModel.php(34): Yurun\TDEngine\Orm\BaseModel::__getMeta()
#9 /home/www/hyperf-skeleton/app/Service/CreateAlert.php(193): Yurun\TDEngine\Orm\BaseModel->__construct(Array, 'HH_10000000')
#10 /home/www/hyperf-skeleton/app/Service/CreateAlert.php(157): App\Service\CreateAlert->insertAlertLog(Array, Array)
#11 /home/www/hyperf-skeleton/app/Service/CreateAlert.php(52): App\Service\CreateAlert->sendGrpc(Array, Array, Object(Alarm\Service\V1\AlarmRequest))
#12 /home/www/hyperf-skeleton/app/Command/NodeCommand.php(54): App\Service\CreateAlert->handle()
#13 /home/www/hyperf-skeleton/vendor/hyperf/utils/src/Functions.php(274): App\Command\NodeCommand->App\Command\{closure}()
#14 /home/www/hyperf-skeleton/vendor/hyperf/utils/src/Coroutine.php(62): call(Object(Closure))
#15 {main}
string(55) "self::$annotationMetadata[$name]['targets']:1-$target:4"
[WARNING] Doctrine\Common\Annotations\AnnotationException: [Semantical Error] Annotation @Table is not allowed to be declared on class App\Model\TD\AlertLog. You may only use this annotation on these code elements: CLASS.(0) in /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:40
Stack trace:
#0 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(867): Doctrine\Common\Annotations\AnnotationException::semanticalError('Annotation @Tab...')
#1 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(720): Doctrine\Common\Annotations\DocParser->Annotation()
#2 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(377): Doctrine\Common\Annotations\DocParser->Annotations()
#3 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(146): Doctrine\Common\Annotations\DocParser->parse('/**\n * @Table(n...', 'class App\\Model...')
#4 /home/www/hyperf-skeleton/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(154): Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object(ReflectionClass))
#5 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/Meta/Meta.php(63): Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object(ReflectionClass), 'Yurun\\TDEngine\\...')
#6 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/Meta/MetaManager.php(32): Yurun\TDEngine\Orm\Meta\Meta->__construct('App\\Model\\TD\\Al...')
#7 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/BaseModel.php(191): Yurun\TDEngine\Orm\Meta\MetaManager::get('App\\Model\\TD\\Al...')
#8 /home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/BaseModel.php(34): Yurun\TDEngine\Orm\BaseModel::__getMeta()
#9 /home/www/hyperf-skeleton/app/Service/CreateAlert.php(193): Yurun\TDEngine\Orm\BaseModel->__construct(Array, 'HH_10000001')
#10 /home/www/hyperf-skeleton/app/Service/CreateAlert.php(157): App\Service\CreateAlert->insertAlertLog(Array, Array)
#11 /home/www/hyperf-skeleton/app/Service/CreateAlert.php(52): App\Service\CreateAlert->sendGrpc(Array, Array, Object(Alarm\Service\V1\AlarmRequest))
#12 /home/www/hyperf-skeleton/app/Command/NodeCommand.php(54): App\Service\CreateAlert->handle()
#13 /home/www/hyperf-skeleton/vendor/hyperf/utils/src/Functions.php(274): App\Command\NodeCommand->App\Command\{closure}()
#14 /home/www/hyperf-skeleton/vendor/hyperf/utils/src/Coroutine.php(62): call(Object(Closure))
#15 {main}
        var_dump('self::$annotationMetadata[$name][\'targets\']:' . self::$annotationMetadata[$name]['targets'] . '-' . '$target:' . $target);

        //if annotation does not support current target
        if ((self::$annotationMetadata[$name]['targets'] & $target) === 0 && $target) {
            throw AnnotationException::semanticalError(
                sprintf(
                    <<<'EXCEPTION'
Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.
EXCEPTION
                    ,
                    $originalName,
                    $this->context,
                    self::$annotationMetadata[$name]['targets_literal']
                )
            );
        }

from tdengine-orm.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.