package rest

import (
	"git.nspix.com/golang/micro/gateway/http"
	"gorm.io/gorm"
)

type (
	Model interface {
		ModuleName() string
		TableName() string
		Scenario() []string
	}

	Migrating interface {
		Defaults() []MigrateValue
	}

	MigrateValue struct {
		Value      interface{}
		Conditions interface{}
	}

	KvMapping interface {
		LabelField() string
		ValueField() string
	}

	mappingValue struct {
		Label string `json:"label"`
		Value string `json:"value"`
	}

	// FilterColumnInterface 过滤回调函数
	FilterColumnInterface interface {
		OnSearchColumn(ctx *http.Context, query *Query, schema *Schema) (err error)
	}

	// RequestHandleFunc 处理HTTP请求回调函数
	RequestHandleFunc func(ctx *http.Context, tx *gorm.DB, model interface{}) (err error)
)
