新增后台管理

This commit is contained in:
2025-06-08 15:14:34 +08:00
parent 7762ad46fe
commit e75c7b3dd3
488 changed files with 20273 additions and 15879 deletions

View File

@@ -23,7 +23,7 @@ import (
var (
agentPlatformDeductionFieldNames = builder.RawFieldNames(&AgentPlatformDeduction{})
agentPlatformDeductionRows = strings.Join(agentPlatformDeductionFieldNames, ",")
agentPlatformDeductionRowsExpectAutoSet = strings.Join(stringx.Remove(agentPlatformDeductionFieldNames, "`create_time`", "`update_time`"), ",")
agentPlatformDeductionRowsExpectAutoSet = strings.Join(stringx.Remove(agentPlatformDeductionFieldNames, "`id`", "`create_time`", "`update_time`"), ",")
agentPlatformDeductionRowsWithPlaceHolder = strings.Join(stringx.Remove(agentPlatformDeductionFieldNames, "`id`", "`create_time`", "`update_time`"), "=?,") + "=?"
cacheTydataAgentPlatformDeductionIdPrefix = "cache:tydata:agentPlatformDeduction:id:"
@@ -78,11 +78,11 @@ func (m *defaultAgentPlatformDeductionModel) Insert(ctx context.Context, session
data.DelState = globalkey.DelStateNo
tydataAgentPlatformDeductionIdKey := fmt.Sprintf("%s%v", cacheTydataAgentPlatformDeductionIdPrefix, data.Id)
return m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?)", m.table, agentPlatformDeductionRowsExpectAutoSet)
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?)", m.table, agentPlatformDeductionRowsExpectAutoSet)
if session != nil {
return session.ExecCtx(ctx, query, data.Id, data.AgentId, data.Amount, data.Type, data.Status, data.DeleteTime, data.DelState, data.Version)
return session.ExecCtx(ctx, query, data.AgentId, data.Amount, data.Type, data.Status, data.DeleteTime, data.DelState, data.Version)
}
return conn.ExecCtx(ctx, query, data.Id, data.AgentId, data.Amount, data.Type, data.Status, data.DeleteTime, data.DelState, data.Version)
return conn.ExecCtx(ctx, query, data.AgentId, data.Amount, data.Type, data.Status, data.DeleteTime, data.DelState, data.Version)
}, tydataAgentPlatformDeductionIdKey)
}
@@ -148,7 +148,7 @@ func (m *defaultAgentPlatformDeductionModel) DeleteSoft(ctx context.Context, ses
data.DelState = globalkey.DelStateYes
data.DeleteTime = sql.NullTime{Time: time.Now(), Valid: true}
if err := m.UpdateWithVersion(ctx, session, data); err != nil {
return errors.Wrapf(errors.New("delete soft failed "), "AgentPlatformDeductionModel delete err : %v", err)
return errors.Wrapf(errors.New("delete soft failed "), "AgentPlatformDeductionModel delete err : %+v", err)
}
return nil
}