ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="testmodule_default_hydrator_extension_attribute_entity" resource="default" engine="innodb">
|
||||
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true"/>
|
||||
<column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="false" identity="false"/>
|
||||
<column xsi:type="varchar" name="value" nullable="true" length="255"/>
|
||||
<constraint xsi:type="primary" referenceId="PRIMARY">
|
||||
<column name="entity_id"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="foreign" referenceId="CSTR_EXTENSION_ATTR_ENTT_CSTR_ID_CSTR_ENTT_ENTT_ID"
|
||||
table="testmodule_default_hydrator_extension_attribute_entity" column="customer_id"
|
||||
referenceTable="customer_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
|
||||
</table>
|
||||
</schema>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"testmodule_default_hydrator_extension_attribute_entity": {
|
||||
"column": {
|
||||
"entity_id": true,
|
||||
"customer_id": true,
|
||||
"value": true
|
||||
},
|
||||
"constraint": {
|
||||
"PRIMARY": true,
|
||||
"CSTR_EXTENSION_ATTR_ENTT_CSTR_ID_CSTR_ENTT_ENTT_ID": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<preference for="Magento\TestModuleDefaultHydrator\Api\CustomerPersistenceInterface" type="Magento\TestModuleDefaultHydrator\Model\CustomerPersistence" />
|
||||
<preference for="Magento\TestModuleDefaultHydrator\Api\Data\ExtensionAttributeInterface" type="Magento\TestModuleDefaultHydrator\Model\Data\ExtensionAttribute" />
|
||||
<type name="Magento\Framework\EntityManager\Operation\ExtensionPool">
|
||||
<arguments>
|
||||
<argument name="extensionActions" xsi:type="array">
|
||||
<item name="Magento\Customer\Api\Data\CustomerInterface" xsi:type="array">
|
||||
<item name="read" xsi:type="array">
|
||||
<item name="extensionAttribute" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\ReadHandler</item>
|
||||
<item name="address" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\Address\ReadHandler</item>
|
||||
</item>
|
||||
<item name="create" xsi:type="array">
|
||||
<item name="extensionAttribute" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\SaveHandler</item>
|
||||
<item name="address" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\Address\SaveHandler</item>
|
||||
</item>
|
||||
<item name="update" xsi:type="array">
|
||||
<item name="extensionAttribute" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\SaveHandler</item>
|
||||
<item name="address" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\Address\SaveHandler</item>
|
||||
</item>
|
||||
</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Magento\Framework\EntityManager\MetadataPool">
|
||||
<arguments>
|
||||
<argument name="metadata" xsi:type="array">
|
||||
<item name="Magento\Customer\Api\Data\CustomerInterface" xsi:type="array">
|
||||
<item name="entityTableName" xsi:type="string">customer_entity</item>
|
||||
<item name="eavEntityType" xsi:type="string">customer</item>
|
||||
<item name="identifierField" xsi:type="string">entity_id</item>
|
||||
</item>
|
||||
<item name="Magento\Customer\Api\Data\AddressInterface" xsi:type="array">
|
||||
<item name="entityTableName" xsi:type="string">customer_address_entity</item>
|
||||
<item name="eavEntityType" xsi:type="string">customer_address</item>
|
||||
<item name="identifierField" xsi:type="string">entity_id</item>
|
||||
</item>
|
||||
<item name="Magento\TestModuleDefaultHydrator\Api\Data\ExtensionAttributeInterface" xsi:type="array">
|
||||
<item name="entityTableName" xsi:type="string">testmodule_default_hydrator_extension_attribute_entity</item>
|
||||
<item name="identifierField" xsi:type="string">entity_id</item>
|
||||
</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Magento\Framework\EntityManager\Mapper">
|
||||
<arguments>
|
||||
<argument name="config" xsi:type="array">
|
||||
<item name="Magento\Customer\Api\Data\CustomerInterface" xsi:type="array">
|
||||
<item name="entity_id" xsi:type="string">id</item>
|
||||
</item>
|
||||
<item name="Magento\Customer\Api\Data\AddressInterface" xsi:type="array">
|
||||
<item name="parent_id" xsi:type="string">customer_id</item>
|
||||
</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<virtualType name="customerAddressMapper" type="Magento\Framework\EntityManager\CompositeMapper">
|
||||
<arguments>
|
||||
<argument name="mappers" xsi:type="array">
|
||||
<item name="addressMapper" xsi:type="object">Magento\TestModuleDefaultHydrator\Model\Address\Mapper</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</virtualType>
|
||||
<type name="Magento\Framework\EntityManager\MapperPool">
|
||||
<arguments>
|
||||
<argument name="mappers" xsi:type="array">
|
||||
<item name="Magento\Customer\Api\Data\AddressInterface" xsi:type="string">customerAddressMapper</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
</config>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
|
||||
<extension_attributes for="Magento\Customer\Api\Data\CustomerInterface">
|
||||
<attribute code="extension_attribute" type="Magento\TestModuleDefaultHydrator\Api\Data\ExtensionAttributeInterface" />
|
||||
</extension_attributes>
|
||||
</config>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Magento_TestModuleDefaultHydrator">
|
||||
</module>
|
||||
</config>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
|
||||
<route url="/V1/TestModuleDefaultHydrator" method="POST">
|
||||
<service class="Magento\TestModuleDefaultHydrator\Api\CustomerPersistenceInterface" method="save"/>
|
||||
<resources>
|
||||
<resource ref="anonymous"/>
|
||||
</resources>
|
||||
</route>
|
||||
<route url="/V1/TestModuleDefaultHydrator/:id" method="GET">
|
||||
<service class="Magento\TestModuleDefaultHydrator\Api\CustomerPersistenceInterface" method="getById"/>
|
||||
<resources>
|
||||
<resource ref="anonymous"/>
|
||||
</resources>
|
||||
</route>
|
||||
<route url="/V1/TestModuleDefaultHydrator/:id" method="DELETE">
|
||||
<service class="Magento\TestModuleDefaultHydrator\Api\CustomerPersistenceInterface" method="delete"/>
|
||||
<resources>
|
||||
<resource ref="anonymous"/>
|
||||
</resources>
|
||||
</route>
|
||||
<route url="/V1/TestModuleDefaultHydrator/:id" method="PUT">
|
||||
<service class="Magento\TestModuleDefaultHydrator\Api\CustomerPersistenceInterface" method="save"/>
|
||||
<resources>
|
||||
<resource ref="anonymous"/>
|
||||
</resources>
|
||||
</route>
|
||||
</routes>
|
||||
Reference in New Issue
Block a user