feat: wecom message init

This commit is contained in:
zzw
2026-09-17 10:18:43 +08:00
parent 5a56eb2fe4
commit dd460f6be2
46 changed files with 2735 additions and 109 deletions
@@ -0,0 +1,79 @@
package handlers
import (
"base-service/app/dao"
"errors"
)
func GetHandler(job dao.WeComJob) (Handler, error) {
switch job.ObjType {
// 产品
case dao.EditLogTypeProduct:
switch job.Type {
case dao.ProductApplyReview:
return ProductReviewHandler{}, nil
case dao.ProductNeedReview:
return ProductNotifyApplyHandler{}, nil
case dao.ProductSubmitReview:
return ProductNotifySubmitHandler{}, nil
case dao.ProductFirstReview:
return ProductNotifyFirstHandler{}, nil
case dao.ProductSecondReview:
return ProductNotifySecondHandler{}, nil
case dao.ProductOrdinaryReview:
return ProductNotifyOrdinaryHandler{}, nil
}
// 门店
case dao.EditLogTypeStore:
switch job.Type {
case dao.StoreApplyReview:
return StoreReviewHandler{}, nil
case dao.StoreNeedReview:
return StoreNotifyApplyHandler{}, nil
case dao.StoreSubmitReview:
return StoreNotifySubmitHandler{}, nil
case dao.StoreFirstReview:
return StoreNotifyFirstHandler{}, nil
case dao.StoreSecondReview:
return StoreNotifySecondHandler{}, nil
}
// 地址
case dao.EditLogTypeAddress:
switch job.Type {
case dao.AddressApplyReview:
return AddressReviewHandler{}, nil
case dao.AddressSubmitReview:
return AddressNotifySubmitHandler{}, nil
case dao.AddressFirstReview:
return AddressNotifyFirstHandler{}, nil
case dao.AddressSecondReview:
return AddressNotifySecondHandler{}, nil
}
case dao.EditLogTypeSales:
switch job.Type {
case dao.SalesApplyReview:
return SalesNotifyApplyHandler{}, nil
}
}
return nil, errors.New("wecom handler not found")
}