作者 唐旭辉

清理代码

package command
type UpdateBusinessBonusCommand struct {
Id int64 `json:"id"`
Bonus float64 `json:"bonus"`
BonusStatus int8 `json:"bonusStatus"`
CompanyId int64 `json:"companyId"`
}
// type UpdateBusinessBonusCommand struct {
// Id int64 `json:"id"`
// Bonus float64 `json:"bonus"`
// BonusStatus int8 `json:"bonusStatus"`
// CompanyId int64 `json:"companyId"`
// }
func (cmd UpdateBusinessBonusCommand) ValidateCommand() error {
return nil
}
// func (cmd UpdateBusinessBonusCommand) ValidateCommand() error {
// return nil
// }
... ...
package query
type GetBusinessBonusQuery struct {
Id int64 `json:"id"`
CompanyId int64 `json:"companyId"`
}
// type GetBusinessBonusQuery struct {
// Id int64 `json:"id"`
// CompanyId int64 `json:"companyId"`
// }
... ...
package query
type ListBusinessBonusQuery struct {
// type ListBusinessBonusQuery struct {
//用户名称匹配
PartnerNameMatch string `json:"userNameMatch" `
// 查询偏离量
Offset int `json:"offset" `
// 查询限制
Limit int `json:"limit"`
PartnerId int64 `json:"partnerId"`
CompanyId int64 `json:"companyId"`
}
// //用户名称匹配
// PartnerNameMatch string `json:"userNameMatch" `
// // 查询偏离量
// Offset int `json:"offset" `
// // 查询限制
// Limit int `json:"limit"`
// PartnerId int64 `json:"partnerId"`
// CompanyId int64 `json:"companyId"`
// }
... ...
... ... @@ -120,34 +120,6 @@ func (subscriber *OrderLogSubscriber) HandleEvent(domainEvent coreDomain.DomainE
}
err = orderLogRepository.Add(&orderLog)
break
// 支付订单中货品的分红
// case event.PAY_ORDER_GOOD_BONUS_EVENT:
// currentEvent := domainEvent.(event.PayOrderGoodBonus)
// adminUser, err = userRepository.FindOne(domain.UsersFindOneQuery{Id: currentEvent.AdminId})
// if err != nil {
// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
// }
// orderLog := domain.OrderLog{
// OperatorType: domain.ORDER_LOG_OPERATOR_ADMIN,
// OperatorId: currentEvent.AdminId,
// Operator: adminUser.Name,
// AlterTime: time.Now(),
// DataFrom: domain.ORDER_LOG_FROM,
// LogAction: "支付",
// OrderId: currentEvent.OrderId,
// GoodId: currentEvent.GoodId,
// Descript: []domain.OrderLogDescript{
// domain.OrderLogDescript{
// Title: "支付分红",
// Item: currentEvent.GoodName,
// Action: []string{
// fmt.Sprintf(`支付分红"¥%.2f"`, currentEvent.PartnerBonus),
// },
// },
// },
// }
// err = orderLogRepository.Add(&orderLog)
// break
case event.BATCH_PAY_ORDER_GOOD_BONUS_EVENT:
currentEvent := domainEvent.(event.BatchPayOrderGoodBonus)
orderLog := domain.OrderLog{
... ...
... ... @@ -6,20 +6,6 @@ import (
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
)
// func CreateBusinessBonusService(options map[string]interface{}) (service.BusinessBonusService, error) {
// var transactionContext *transaction.TransactionContext
// if value, ok := options["transactionContext"]; ok {
// transactionContext = value.(*transaction.TransactionContext)
// }
// return domainService.NewBusinessBonusService(transactionContext), nil
// }
// var transactionContext *transaction.TransactionContext
// if value, ok := options["transactionContext"]; ok {
// transactionContext = value.(*transaction.TransactionContext)
// }
// return domainService.NewBusinessBonusService(transactionContext), nil
// }
func CreateOrderBonusService(options map[string]interface{}) (service.OrderBonusService, error) {
var transactionContext *transaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
... ...