Skip to content
Snippets Groups Projects
Commit 89c67bde authored by 傅一洪's avatar 傅一洪
Browse files

refactor(executor): Rename mysql executor to sql executor

parent 9fe0bd88
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ DDD Firework is a framework that supports the implementation of DDD (Domain-Driv
import ddd "github.com/bytedance/dddfirework"
import "github.com/bytedance/dddfirework/executor/mysql"
import "github.com/bytedance/dddfirework/executor/sql"
func init() {
mysql.RegisterEntity2Model(&domain.Order{}, func(entity, parent ddd.IEntity, op ddd.OpType) (mysql.IModel, error) {
......@@ -106,7 +106,7 @@ DDD Firework is a framework that supports the implementation of DDD (Domain-Driv
import (
ddd "github.com/bytedance/dddfirework"
db_executor "github.com/bytedance/dddfirework/executor/mysql"
db_executor "github.com/bytedance/dddfirework/executor/sql"
db_eventbus "github.com/bytedance/dddfirework/eventbus/mysql"
db_lock "github.com/bytedance/dddfirework/lock/db"
"gorm.io/driver/mysql"
......
......@@ -35,7 +35,7 @@ dddfirework 是一个支持 DDD (领域驱动设计)实现的引擎框架,
import ddd "github.com/bytedance/dddfirework"
import "github.com/bytedance/dddfirework/executor/mysql"
import "github.com/bytedance/dddfirework/executor/sql"
func init() {
mysql.RegisterEntity2Model(&domain.Order{}, func(entity, parent ddd.IEntity, op ddd.OpType) (mysql.IModel, error) {
......@@ -106,7 +106,7 @@ dddfirework 是一个支持 DDD (领域驱动设计)实现的引擎框架,
import (
ddd "github.com/bytedance/dddfirework"
db_executor "github.com/bytedance/dddfirework/executor/mysql"
db_executor "github.com/bytedance/dddfirework/executor/sql"
db_eventbus "github.com/bytedance/dddfirework/eventbus/mysql"
db_lock "github.com/bytedance/dddfirework/lock/db"
"gorm.io/driver/mysql"
......
......@@ -7,7 +7,7 @@ import (
"time"
"github.com/bytedance/dddfirework"
exec_mysql "github.com/bytedance/dddfirework/executor/mysql"
exec_mysql "github.com/bytedance/dddfirework/executor/sql"
"github.com/bytedance/dddfirework/testsuit"
"github.com/stretchr/testify/assert"
"gorm.io/gorm"
......
......@@ -28,7 +28,7 @@ import (
"gorm.io/gorm"
"github.com/bytedance/dddfirework"
exec_mysql "github.com/bytedance/dddfirework/executor/mysql"
exec_mysql "github.com/bytedance/dddfirework/executor/sql"
"github.com/bytedance/dddfirework/testsuit"
)
......
......@@ -19,11 +19,11 @@ import (
ddd "github.com/bytedance/dddfirework"
"github.com/bytedance/dddfirework/example/biz/sale/domain"
"github.com/bytedance/dddfirework/example/biz/sale/infrastructure/po"
"github.com/bytedance/dddfirework/executor/mysql"
"github.com/bytedance/dddfirework/executor/sql"
)
func Init() {
mysql.RegisterEntity2Model(&domain.Order{}, func(entity, parent ddd.IEntity, op ddd.OpType) (mysql.IModel, error) {
sql.RegisterEntity2Model(&domain.Order{}, func(entity, parent ddd.IEntity, op ddd.OpType) (sql.IModel, error) {
do := entity.(*domain.Order)
m := &po.OrderPO{
ID: do.GetID(),
......@@ -39,7 +39,7 @@ func Init() {
}
}
return m, nil
}, func(m mysql.IModel, do ddd.IEntity) error {
}, func(m sql.IModel, do ddd.IEntity) error {
orderPO, order := m.(*po.OrderPO), do.(*domain.Order)
order.UserID = orderPO.User
order.TotalAmount = orderPO.TotalAmount
......@@ -47,7 +47,7 @@ func Init() {
return nil
})
mysql.RegisterEntity2Model(&domain.SaleItem{}, func(entity, parent ddd.IEntity, op ddd.OpType) (mysql.IModel, error) {
sql.RegisterEntity2Model(&domain.SaleItem{}, func(entity, parent ddd.IEntity, op ddd.OpType) (sql.IModel, error) {
do := entity.(*domain.SaleItem)
po := &po.SaleItemPO{
......@@ -61,7 +61,7 @@ func Init() {
po.OrderID = order.GetID()
}
return po, nil
}, func(m mysql.IModel, do ddd.IEntity) error {
}, func(m sql.IModel, do ddd.IEntity) error {
fr, to := m.(*po.SaleItemPO), do.(*domain.SaleItem)
to.SetID(fr.GetID())
to.Name = fr.Name
......@@ -71,7 +71,7 @@ func Init() {
return nil
})
mysql.RegisterEntity2Model(&domain.Coupon{}, func(entity, parent ddd.IEntity, op ddd.OpType) (mysql.IModel, error) {
sql.RegisterEntity2Model(&domain.Coupon{}, func(entity, parent ddd.IEntity, op ddd.OpType) (sql.IModel, error) {
do := entity.(*domain.Coupon)
po := &po.CouponPO{
......@@ -84,7 +84,7 @@ func Init() {
po.OrderID = order.GetID()
}
return po, nil
}, func(m mysql.IModel, do ddd.IEntity) error {
}, func(m sql.IModel, do ddd.IEntity) error {
fr, to := m.(*po.CouponPO), do.(*domain.Coupon)
to.SetID(fr.GetID())
to.CouponID = fr.CouponID
......
......@@ -29,7 +29,7 @@ import (
"github.com/bytedance/dddfirework/example/event_handler"
"github.com/bytedance/dddfirework/example/handler"
"github.com/bytedance/dddfirework/example/handler/util"
db_executor "github.com/bytedance/dddfirework/executor/mysql"
db_executor "github.com/bytedance/dddfirework/executor/sql"
db_lock "github.com/bytedance/dddfirework/lock/db"
"gorm.io/driver/mysql"
"gorm.io/gorm"
......
......@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
package sql
import (
"reflect"
......
......@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
package sql
import (
"testing"
......
......@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
package sql
import (
"context"
......
......@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
package sql
import (
"context"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment