mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-28 20:25:53 +00:00
chore🔧: deprecate the five CRUD actions the generic ones replace
IndexAction, ViewAction, CreateAction, UpdateAction and DeleteAction stay and behave as before; each now points at its generic replacement. Nothing in this repository calls them any more.
This commit is contained in:
@@ -14,6 +14,10 @@ import (
|
||||
)
|
||||
|
||||
// CreateAction 通用新增动作
|
||||
//
|
||||
// Deprecated: Use Create[Model, Control](). It builds its values per request, so the
|
||||
// Generate() copies this action depends on are not needed, and a model
|
||||
// paired with the wrong request does not compile. See generic.go.
|
||||
func CreateAction(control dto.Control) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
log := api.GetRequestLogger(c)
|
||||
|
||||
@@ -14,6 +14,10 @@ import (
|
||||
)
|
||||
|
||||
// DeleteAction 通用删除动作
|
||||
//
|
||||
// Deprecated: Use Delete[Model, ById](). It builds its values per request, so the
|
||||
// Generate() copies this action depends on are not needed, and a model
|
||||
// paired with the wrong request does not compile. See generic.go.
|
||||
func DeleteAction(control dto.Control) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
db, err := pkg.GetOrm(c)
|
||||
|
||||
@@ -15,6 +15,10 @@ import (
|
||||
)
|
||||
|
||||
// IndexAction 通用查询动作
|
||||
//
|
||||
// Deprecated: Use Index[Model, Search](). It builds its values per request, so the
|
||||
// Generate() copies this action depends on are not needed, and a model
|
||||
// paired with the wrong request does not compile. See generic.go.
|
||||
func IndexAction(m models.ActiveRecord, d dto.Index, f func() interface{}) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
db, err := pkg.GetOrm(c)
|
||||
|
||||
@@ -14,6 +14,10 @@ import (
|
||||
)
|
||||
|
||||
// UpdateAction 通用更新动作
|
||||
//
|
||||
// Deprecated: Use Update[Model, Control](). It builds its values per request, so the
|
||||
// Generate() copies this action depends on are not needed, and a model
|
||||
// paired with the wrong request does not compile. See generic.go.
|
||||
func UpdateAction(control dto.Control) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
db, err := pkg.GetOrm(c)
|
||||
|
||||
@@ -15,6 +15,11 @@ import (
|
||||
)
|
||||
|
||||
// ViewAction 通用详情动作
|
||||
//
|
||||
// Deprecated: Use View[Model, ById](), or ViewAs[Model, ById, Response]()
|
||||
// where f returned another type. It builds its values per request, so the
|
||||
// Generate() copies this action depends on are not needed, and a model
|
||||
// paired with the wrong request does not compile. See generic.go.
|
||||
func ViewAction(control dto.Control, f func() interface{}) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
db, err := pkg.GetOrm(c)
|
||||
|
||||
Reference in New Issue
Block a user