提交 52857d5c authored 作者: mooncake's avatar mooncake

update

上级 789752fa
...@@ -26,7 +26,7 @@ func (x *Email) GetTplIDs(rs []*Email) []sf.ID { ...@@ -26,7 +26,7 @@ func (x *Email) GetTplIDs(rs []*Email) []sf.ID {
return set.Slice() return set.Slice()
} }
func (Email) NewFromModel(m *models.Email) *Email { func (Email) New(m *models.Email) *Email {
if m == nil { if m == nil {
return nil return nil
} }
......
...@@ -26,7 +26,7 @@ func (x *EmailReceiver) GetEmailIDs(rs []*EmailReceiver) []sf.ID { ...@@ -26,7 +26,7 @@ func (x *EmailReceiver) GetEmailIDs(rs []*EmailReceiver) []sf.ID {
return set.Slice() return set.Slice()
} }
func (EmailReceiver) NewFromModel(m *models.EmailReceiver) *EmailReceiver { func (EmailReceiver) New(m *models.EmailReceiver) *EmailReceiver {
if m == nil { if m == nil {
return nil return nil
} }
......
...@@ -26,7 +26,7 @@ func (x *EmailSend) GetEmailIDs(rs []*EmailSend) []sf.ID { ...@@ -26,7 +26,7 @@ func (x *EmailSend) GetEmailIDs(rs []*EmailSend) []sf.ID {
return set.Slice() return set.Slice()
} }
func (EmailSend) NewFromModel(m *models.EmailSend) *EmailSend { func (EmailSend) New(m *models.EmailSend) *EmailSend {
if m == nil { if m == nil {
return nil return nil
} }
......
...@@ -26,7 +26,7 @@ func (x *EmailSendLog) GetEmailSendIDs(rs []*EmailSendLog) []sf.ID { ...@@ -26,7 +26,7 @@ func (x *EmailSendLog) GetEmailSendIDs(rs []*EmailSendLog) []sf.ID {
return set.Slice() return set.Slice()
} }
func (EmailSendLog) NewFromModel(m *models.EmailSendLog) *EmailSendLog { func (EmailSendLog) New(m *models.EmailSendLog) *EmailSendLog {
if m == nil { if m == nil {
return nil return nil
} }
......
...@@ -18,7 +18,7 @@ func (*EmailTpl) GetIDs(rs []*EmailTpl) []sf.ID { ...@@ -18,7 +18,7 @@ func (*EmailTpl) GetIDs(rs []*EmailTpl) []sf.ID {
return sliceutils.GetIDs[sf.ID](rs) return sliceutils.GetIDs[sf.ID](rs)
} }
func (EmailTpl) NewFromModel(m *models.EmailTpl) *EmailTpl { func (EmailTpl) New(m *models.EmailTpl) *EmailTpl {
if m == nil { if m == nil {
return nil return nil
} }
......
...@@ -26,7 +26,7 @@ func (x *EmailTplReceiver) GetTplIDs(rs []*EmailTplReceiver) []sf.ID { ...@@ -26,7 +26,7 @@ func (x *EmailTplReceiver) GetTplIDs(rs []*EmailTplReceiver) []sf.ID {
return set.Slice() return set.Slice()
} }
func (EmailTplReceiver) NewFromModel(m *models.EmailTplReceiver) *EmailTplReceiver { func (EmailTplReceiver) New(m *models.EmailTplReceiver) *EmailTplReceiver {
if m == nil { if m == nil {
return nil return nil
} }
......
...@@ -127,7 +127,7 @@ func (x *emailService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[sf.ID] ...@@ -127,7 +127,7 @@ func (x *emailService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[sf.ID]
if len(emailBizSlice) == 0 { if len(emailBizSlice) == 0 {
return nil, nil return nil, nil
} }
emailBizIDMap := biz.EmailTool.SliceToIDMapBiz(emailBizSlice) emailBizIDMap := biz.EmailTool.SliceToIDMap(emailBizSlice)
return emailBizIDMap, nil return emailBizIDMap, nil
} }
...@@ -195,7 +195,7 @@ func (x *emailService) ToBiz(ctx context.Context, email *models.Email) (emailBiz ...@@ -195,7 +195,7 @@ func (x *emailService) ToBiz(ctx context.Context, email *models.Email) (emailBiz
if email == nil { if email == nil {
return nil, nil return nil, nil
} }
emailBiz = biz.EmailTool.NewFromModel(email) emailBiz = biz.EmailTool.New(email)
return emailBiz, nil return emailBiz, nil
} }
...@@ -203,7 +203,7 @@ func (x *emailService) ToSliceBiz(ctx context.Context, emails []*models.Email) ( ...@@ -203,7 +203,7 @@ func (x *emailService) ToSliceBiz(ctx context.Context, emails []*models.Email) (
if len(emails) == 0 { if len(emails) == 0 {
return nil, nil return nil, nil
} }
emailBizSlice = biz.EmailTool.NewSliceFromModelsBiz(emails) emailBizSlice = biz.EmailTool.NewSlice(emails)
return emailBizSlice, nil return emailBizSlice, nil
} }
......
...@@ -127,7 +127,7 @@ func (x *emailReceiverService) GetMapByIDs(ctx context.Context, ids []sf.ID) (ma ...@@ -127,7 +127,7 @@ func (x *emailReceiverService) GetMapByIDs(ctx context.Context, ids []sf.ID) (ma
if len(emailReceiverBizSlice) == 0 { if len(emailReceiverBizSlice) == 0 {
return nil, nil return nil, nil
} }
emailReceiverBizIDMap := biz.EmailReceiverTool.SliceToIDMapBiz(emailReceiverBizSlice) emailReceiverBizIDMap := biz.EmailReceiverTool.SliceToIDMap(emailReceiverBizSlice)
return emailReceiverBizIDMap, nil return emailReceiverBizIDMap, nil
} }
...@@ -195,7 +195,7 @@ func (x *emailReceiverService) ToBiz(ctx context.Context, emailReceiver *models. ...@@ -195,7 +195,7 @@ func (x *emailReceiverService) ToBiz(ctx context.Context, emailReceiver *models.
if emailReceiver == nil { if emailReceiver == nil {
return nil, nil return nil, nil
} }
emailReceiverBiz = biz.EmailReceiverTool.NewFromModel(emailReceiver) emailReceiverBiz = biz.EmailReceiverTool.New(emailReceiver)
return emailReceiverBiz, nil return emailReceiverBiz, nil
} }
...@@ -203,7 +203,7 @@ func (x *emailReceiverService) ToSliceBiz(ctx context.Context, emailReceivers [] ...@@ -203,7 +203,7 @@ func (x *emailReceiverService) ToSliceBiz(ctx context.Context, emailReceivers []
if len(emailReceivers) == 0 { if len(emailReceivers) == 0 {
return nil, nil return nil, nil
} }
emailReceiverBizSlice = biz.EmailReceiverTool.NewSliceFromModelsBiz(emailReceivers) emailReceiverBizSlice = biz.EmailReceiverTool.NewSlice(emailReceivers)
return emailReceiverBizSlice, nil return emailReceiverBizSlice, nil
} }
......
...@@ -128,7 +128,7 @@ func (x *emailSendService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[sf ...@@ -128,7 +128,7 @@ func (x *emailSendService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[sf
if len(emailSendBizSlice) == 0 { if len(emailSendBizSlice) == 0 {
return nil, nil return nil, nil
} }
emailSendBizIDMap := biz.EmailSendTool.SliceToIDMapBiz(emailSendBizSlice) emailSendBizIDMap := biz.EmailSendTool.SliceToIDMap(emailSendBizSlice)
return emailSendBizIDMap, nil return emailSendBizIDMap, nil
} }
...@@ -242,7 +242,7 @@ func (x *emailSendService) ToBiz(ctx context.Context, emailSend *models.EmailSen ...@@ -242,7 +242,7 @@ func (x *emailSendService) ToBiz(ctx context.Context, emailSend *models.EmailSen
if emailSend == nil { if emailSend == nil {
return nil, nil return nil, nil
} }
emailSendBiz = biz.EmailSendTool.NewFromModel(emailSend) emailSendBiz = biz.EmailSendTool.New(emailSend)
return emailSendBiz, nil return emailSendBiz, nil
} }
...@@ -250,7 +250,7 @@ func (x *emailSendService) ToSliceBiz(ctx context.Context, emailSends []*models. ...@@ -250,7 +250,7 @@ func (x *emailSendService) ToSliceBiz(ctx context.Context, emailSends []*models.
if len(emailSends) == 0 { if len(emailSends) == 0 {
return nil, nil return nil, nil
} }
emailSendBizSlice = biz.EmailSendTool.NewSliceFromModelsBiz(emailSends) emailSendBizSlice = biz.EmailSendTool.NewSlice(emailSends)
return emailSendBizSlice, nil return emailSendBizSlice, nil
} }
......
...@@ -127,7 +127,7 @@ func (x *emailSendLogService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map ...@@ -127,7 +127,7 @@ func (x *emailSendLogService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map
if len(emailSendLogBizSlice) == 0 { if len(emailSendLogBizSlice) == 0 {
return nil, nil return nil, nil
} }
emailSendLogBizIDMap := biz.EmailSendLogTool.SliceToIDMapBiz(emailSendLogBizSlice) emailSendLogBizIDMap := biz.EmailSendLogTool.SliceToIDMap(emailSendLogBizSlice)
return emailSendLogBizIDMap, nil return emailSendLogBizIDMap, nil
} }
...@@ -195,7 +195,7 @@ func (x *emailSendLogService) ToBiz(ctx context.Context, emailSendLog *models.Em ...@@ -195,7 +195,7 @@ func (x *emailSendLogService) ToBiz(ctx context.Context, emailSendLog *models.Em
if emailSendLog == nil { if emailSendLog == nil {
return nil, nil return nil, nil
} }
emailSendLogBiz = biz.EmailSendLogTool.NewFromModel(emailSendLog) emailSendLogBiz = biz.EmailSendLogTool.New(emailSendLog)
return emailSendLogBiz, nil return emailSendLogBiz, nil
} }
...@@ -203,7 +203,7 @@ func (x *emailSendLogService) ToSliceBiz(ctx context.Context, emailSendLogs []*m ...@@ -203,7 +203,7 @@ func (x *emailSendLogService) ToSliceBiz(ctx context.Context, emailSendLogs []*m
if len(emailSendLogs) == 0 { if len(emailSendLogs) == 0 {
return nil, nil return nil, nil
} }
emailSendLogBizSlice = biz.EmailSendLogTool.NewSliceFromModelsBiz(emailSendLogs) emailSendLogBizSlice = biz.EmailSendLogTool.NewSlice(emailSendLogs)
return emailSendLogBizSlice, nil return emailSendLogBizSlice, nil
} }
......
...@@ -141,7 +141,7 @@ func (x *emailTplService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[sf. ...@@ -141,7 +141,7 @@ func (x *emailTplService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[sf.
if len(emailTplBizSlice) == 0 { if len(emailTplBizSlice) == 0 {
return nil, nil return nil, nil
} }
emailTplBizIDMap := biz.EmailTplTool.SliceToIDMapBiz(emailTplBizSlice) emailTplBizIDMap := biz.EmailTplTool.SliceToIDMap(emailTplBizSlice)
return emailTplBizIDMap, nil return emailTplBizIDMap, nil
} }
...@@ -164,7 +164,7 @@ func (x *emailTplService) ToBiz(ctx context.Context, emailTpl *models.EmailTpl) ...@@ -164,7 +164,7 @@ func (x *emailTplService) ToBiz(ctx context.Context, emailTpl *models.EmailTpl)
if emailTpl == nil { if emailTpl == nil {
return nil, nil return nil, nil
} }
emailTplBiz = biz.EmailTplTool.NewFromModel(emailTpl) emailTplBiz = biz.EmailTplTool.New(emailTpl)
return emailTplBiz, nil return emailTplBiz, nil
} }
...@@ -172,7 +172,7 @@ func (x *emailTplService) ToSliceBiz(ctx context.Context, emailTpls []*models.Em ...@@ -172,7 +172,7 @@ func (x *emailTplService) ToSliceBiz(ctx context.Context, emailTpls []*models.Em
if len(emailTpls) == 0 { if len(emailTpls) == 0 {
return nil, nil return nil, nil
} }
emailTplBizSlice = biz.EmailTplTool.NewSliceFromModelsBiz(emailTpls) emailTplBizSlice = biz.EmailTplTool.NewSlice(emailTpls)
return emailTplBizSlice, nil return emailTplBizSlice, nil
} }
......
...@@ -127,7 +127,7 @@ func (x *emailTplReceiverService) GetMapByIDs(ctx context.Context, ids []sf.ID) ...@@ -127,7 +127,7 @@ func (x *emailTplReceiverService) GetMapByIDs(ctx context.Context, ids []sf.ID)
if len(emailTplReceiverBizSlice) == 0 { if len(emailTplReceiverBizSlice) == 0 {
return nil, nil return nil, nil
} }
emailTplReceiverBizIDMap := biz.EmailTplReceiverTool.SliceToIDMapBiz(emailTplReceiverBizSlice) emailTplReceiverBizIDMap := biz.EmailTplReceiverTool.SliceToIDMap(emailTplReceiverBizSlice)
return emailTplReceiverBizIDMap, nil return emailTplReceiverBizIDMap, nil
} }
...@@ -195,7 +195,7 @@ func (x *emailTplReceiverService) ToBiz(ctx context.Context, emailTplReceiver *m ...@@ -195,7 +195,7 @@ func (x *emailTplReceiverService) ToBiz(ctx context.Context, emailTplReceiver *m
if emailTplReceiver == nil { if emailTplReceiver == nil {
return nil, nil return nil, nil
} }
emailTplReceiverBiz = biz.EmailTplReceiverTool.NewFromModel(emailTplReceiver) emailTplReceiverBiz = biz.EmailTplReceiverTool.New(emailTplReceiver)
return emailTplReceiverBiz, nil return emailTplReceiverBiz, nil
} }
...@@ -203,7 +203,7 @@ func (x *emailTplReceiverService) ToSliceBiz(ctx context.Context, emailTplReceiv ...@@ -203,7 +203,7 @@ func (x *emailTplReceiverService) ToSliceBiz(ctx context.Context, emailTplReceiv
if len(emailTplReceivers) == 0 { if len(emailTplReceivers) == 0 {
return nil, nil return nil, nil
} }
emailTplReceiverBizSlice = biz.EmailTplReceiverTool.NewSliceFromModelsBiz(emailTplReceivers) emailTplReceiverBizSlice = biz.EmailTplReceiverTool.NewSlice(emailTplReceivers)
return emailTplReceiverBizSlice, nil return emailTplReceiverBizSlice, nil
} }
......
...@@ -6,60 +6,60 @@ import ( ...@@ -6,60 +6,60 @@ import (
) )
type IConverter[ID xtype.Key, T, B any] interface { type IConverter[ID xtype.Key, T, B any] interface {
NewFromModel(a *T) *B New(a *T) *B
GetID() ID GetID() ID
} }
type CommonBiz[ID xtype.Key, T any, B IConverter[ID, T, B]] struct { type CommonBiz[ID xtype.Key, T any, B IConverter[ID, T, B]] struct {
} }
func (x *CommonBiz[ID, T, B]) NewSliceFromModelsBiz(ms []*T) []*B { func (x *CommonBiz[ID, T, B]) NewSlice(ms []*T) []*B {
if len(ms) == 0 { if len(ms) == 0 {
return nil return nil
} }
ret := make([]*B, 0, len(ms)) ret := make([]*B, 0, len(ms))
var bt B var bt B
for _, r := range ms { for _, r := range ms {
ret = append(ret, bt.NewFromModel(r)) ret = append(ret, bt.New(r))
} }
return ret return ret
} }
func (x *CommonBiz[ID, T, B]) NewMapFromModelMapBiz(idMap map[sf.ID]*T) map[sf.ID]*B { func (x *CommonBiz[ID, T, B]) NewMap(idMap map[sf.ID]*T) map[sf.ID]*B {
if len(idMap) == 0 { if len(idMap) == 0 {
return nil return nil
} }
ret := make(map[sf.ID]*B, len(idMap)) ret := make(map[sf.ID]*B, len(idMap))
var bt B var bt B
for k, v := range idMap { for k, v := range idMap {
ret[k] = bt.NewFromModel(v) ret[k] = bt.New(v)
} }
return ret return ret
} }
func (x *CommonBiz[ID, T, B]) NewMapSliceFromModelMapSliceBiz(idMapSlice map[sf.ID][]*T) map[sf.ID][]*B { func (x *CommonBiz[ID, T, B]) NewMapSlice(idMapSlice map[sf.ID][]*T) map[sf.ID][]*B {
if len(idMapSlice) == 0 { if len(idMapSlice) == 0 {
return nil return nil
} }
ret := make(map[sf.ID][]*B, len(idMapSlice)) ret := make(map[sf.ID][]*B, len(idMapSlice))
for k, v := range idMapSlice { for k, v := range idMapSlice {
ret[k] = x.NewSliceFromModelsBiz(v) ret[k] = x.NewSlice(v)
} }
return ret return ret
} }
func (x *CommonBiz[ID, T, B]) NewStrMapSliceFromModelMapSliceBiz(strMapSlice map[string][]*T) map[string][]*B { func (x *CommonBiz[ID, T, B]) NewStrMapSlice(strMapSlice map[string][]*T) map[string][]*B {
if len(strMapSlice) == 0 { if len(strMapSlice) == 0 {
return nil return nil
} }
ret := make(map[string][]*B, len(strMapSlice)) ret := make(map[string][]*B, len(strMapSlice))
for k, v := range strMapSlice { for k, v := range strMapSlice {
ret[k] = x.NewSliceFromModelsBiz(v) ret[k] = x.NewSlice(v)
} }
return ret return ret
} }
func (x *CommonBiz[ID, T, B]) SliceToIDMapBiz(rs []*B) map[ID]*B { func (x *CommonBiz[ID, T, B]) SliceToIDMap(rs []*B) map[ID]*B {
if len(rs) == 0 { if len(rs) == 0 {
return nil return nil
} }
...@@ -70,7 +70,7 @@ func (x *CommonBiz[ID, T, B]) SliceToIDMapBiz(rs []*B) map[ID]*B { ...@@ -70,7 +70,7 @@ func (x *CommonBiz[ID, T, B]) SliceToIDMapBiz(rs []*B) map[ID]*B {
return ret return ret
} }
func (x *CommonBiz[ID, T, B]) IDMapToSliceBiz(m map[sf.ID]*B) []*B { func (x *CommonBiz[ID, T, B]) IDMapToSlice(m map[sf.ID]*B) []*B {
if len(m) == 0 { if len(m) == 0 {
return nil return nil
} }
...@@ -81,7 +81,7 @@ func (x *CommonBiz[ID, T, B]) IDMapToSliceBiz(m map[sf.ID]*B) []*B { ...@@ -81,7 +81,7 @@ func (x *CommonBiz[ID, T, B]) IDMapToSliceBiz(m map[sf.ID]*B) []*B {
return ret return ret
} }
func (x *CommonBiz[ID, T, B]) IDMapSliceToSliceBiz(m map[sf.ID][]*B) []*B { func (x *CommonBiz[ID, T, B]) IDMapSliceToSlice(m map[sf.ID][]*B) []*B {
if len(m) == 0 { if len(m) == 0 {
return nil return nil
} }
......
...@@ -39,7 +39,7 @@ func (*CronJob) GetIDs(rs []*CronJob) []sf.ID { ...@@ -39,7 +39,7 @@ func (*CronJob) GetIDs(rs []*CronJob) []sf.ID {
return sliceutils.GetIDs(rs) return sliceutils.GetIDs(rs)
} }
func (CronJob) NewFromModel(m *models.CronJob) *CronJob { func (CronJob) New(m *models.CronJob) *CronJob {
if m == nil { if m == nil {
return nil return nil
} }
......
...@@ -26,7 +26,7 @@ func (x *CronJobLog) GetJobIDs(rs []*CronJobLog) []sf.ID { ...@@ -26,7 +26,7 @@ func (x *CronJobLog) GetJobIDs(rs []*CronJobLog) []sf.ID {
return set.Slice() return set.Slice()
} }
func (CronJobLog) NewFromModel(m *models.CronJobLog) *CronJobLog { func (CronJobLog) New(m *models.CronJobLog) *CronJobLog {
if m == nil { if m == nil {
return nil return nil
} }
......
...@@ -27,7 +27,7 @@ func (x *CronJobRecord) GetJobIDs(rs []*CronJobRecord) []sf.ID { ...@@ -27,7 +27,7 @@ func (x *CronJobRecord) GetJobIDs(rs []*CronJobRecord) []sf.ID {
return set.Slice() return set.Slice()
} }
func (CronJobRecord) NewFromModel(m *models.CronJobRecord) *CronJobRecord { func (CronJobRecord) New(m *models.CronJobRecord) *CronJobRecord {
if m == nil { if m == nil {
return nil return nil
} }
......
...@@ -168,7 +168,7 @@ func (x *cronJobService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[sf.I ...@@ -168,7 +168,7 @@ func (x *cronJobService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[sf.I
if len(cronJobBizSlice) == 0 { if len(cronJobBizSlice) == 0 {
return nil, nil return nil, nil
} }
cronJobBizIDMap := biz.CronJobTool.SliceToIDMapBiz(cronJobBizSlice) cronJobBizIDMap := biz.CronJobTool.SliceToIDMap(cronJobBizSlice)
return cronJobBizIDMap, nil return cronJobBizIDMap, nil
} }
...@@ -248,7 +248,7 @@ func (x *cronJobService) ToBiz(ctx context.Context, cronJob *models.CronJob) (cr ...@@ -248,7 +248,7 @@ func (x *cronJobService) ToBiz(ctx context.Context, cronJob *models.CronJob) (cr
if cronJob == nil { if cronJob == nil {
return nil, nil return nil, nil
} }
cronJobBiz = biz.CronJobTool.NewFromModel(cronJob) cronJobBiz = biz.CronJobTool.New(cronJob)
return cronJobBiz, nil return cronJobBiz, nil
} }
...@@ -256,7 +256,7 @@ func (x *cronJobService) ToSliceBiz(ctx context.Context, cronJobs []*models.Cron ...@@ -256,7 +256,7 @@ func (x *cronJobService) ToSliceBiz(ctx context.Context, cronJobs []*models.Cron
if len(cronJobs) == 0 { if len(cronJobs) == 0 {
return nil, nil return nil, nil
} }
cronJobBizSlice = biz.CronJobTool.NewSliceFromModelsBiz(cronJobs) cronJobBizSlice = biz.CronJobTool.NewSlice(cronJobs)
return cronJobBizSlice, nil return cronJobBizSlice, nil
} }
......
...@@ -62,7 +62,7 @@ func (x *cronJobLogService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[s ...@@ -62,7 +62,7 @@ func (x *cronJobLogService) GetMapByIDs(ctx context.Context, ids []sf.ID) (map[s
if len(cronJobLogBizSlice) == 0 { if len(cronJobLogBizSlice) == 0 {
return nil, nil return nil, nil
} }
cronJobLogBizIDMap := biz.CronJobLogTool.SliceToIDMapBiz(cronJobLogBizSlice) cronJobLogBizIDMap := biz.CronJobLogTool.SliceToIDMap(cronJobLogBizSlice)
return cronJobLogBizIDMap, nil return cronJobLogBizIDMap, nil
} }
...@@ -130,7 +130,7 @@ func (x *cronJobLogService) ToBiz(ctx context.Context, cronJobLog *models.CronJo ...@@ -130,7 +130,7 @@ func (x *cronJobLogService) ToBiz(ctx context.Context, cronJobLog *models.CronJo
if cronJobLog == nil { if cronJobLog == nil {
return nil, nil return nil, nil
} }
cronJobLogBiz = biz.CronJobLogTool.NewFromModel(cronJobLog) cronJobLogBiz = biz.CronJobLogTool.New(cronJobLog)
return cronJobLogBiz, nil return cronJobLogBiz, nil
} }
...@@ -138,7 +138,7 @@ func (x *cronJobLogService) ToSliceBiz(ctx context.Context, cronJobLogs []*model ...@@ -138,7 +138,7 @@ func (x *cronJobLogService) ToSliceBiz(ctx context.Context, cronJobLogs []*model
if len(cronJobLogs) == 0 { if len(cronJobLogs) == 0 {
return nil, nil return nil, nil
} }
cronJobLogBizSlice = biz.CronJobLogTool.NewSliceFromModelsBiz(cronJobLogs) cronJobLogBizSlice = biz.CronJobLogTool.NewSlice(cronJobLogs)
return cronJobLogBizSlice, nil return cronJobLogBizSlice, nil
} }
......
...@@ -59,7 +59,7 @@ func (x *cronJobRecordService) GetMapByIDs(ctx context.Context, ids []sf.ID) (ma ...@@ -59,7 +59,7 @@ func (x *cronJobRecordService) GetMapByIDs(ctx context.Context, ids []sf.ID) (ma
if len(cronJobRecordBizSlice) == 0 { if len(cronJobRecordBizSlice) == 0 {
return nil, nil return nil, nil
} }
cronJobRecordBizIDMap := biz.CronJobRecordTool.SliceToIDMapBiz(cronJobRecordBizSlice) cronJobRecordBizIDMap := biz.CronJobRecordTool.SliceToIDMap(cronJobRecordBizSlice)
return cronJobRecordBizIDMap, nil return cronJobRecordBizIDMap, nil
} }
...@@ -127,7 +127,7 @@ func (x *cronJobRecordService) ToBiz(ctx context.Context, cronJobRecord *models. ...@@ -127,7 +127,7 @@ func (x *cronJobRecordService) ToBiz(ctx context.Context, cronJobRecord *models.
if cronJobRecord == nil { if cronJobRecord == nil {
return nil, nil return nil, nil
} }
cronJobRecordBiz = biz.CronJobRecordTool.NewFromModel(cronJobRecord) cronJobRecordBiz = biz.CronJobRecordTool.New(cronJobRecord)
return cronJobRecordBiz, nil return cronJobRecordBiz, nil
} }
...@@ -135,7 +135,7 @@ func (x *cronJobRecordService) ToSliceBiz(ctx context.Context, cronJobRecords [] ...@@ -135,7 +135,7 @@ func (x *cronJobRecordService) ToSliceBiz(ctx context.Context, cronJobRecords []
if len(cronJobRecords) == 0 { if len(cronJobRecords) == 0 {
return nil, nil return nil, nil
} }
cronJobRecordBizSlice = biz.CronJobRecordTool.NewSliceFromModelsBiz(cronJobRecords) cronJobRecordBizSlice = biz.CronJobRecordTool.NewSlice(cronJobRecords)
return cronJobRecordBizSlice, nil return cronJobRecordBizSlice, nil
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论