48 lines
1.0 KiB
Go
48 lines
1.0 KiB
Go
package schema
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gitlab.guxuan.icu/jinshan_community/pkg/util"
|
|
)
|
|
|
|
// Defining the `App` struct.
|
|
type App struct {
|
|
ID string `json:"id" gorm:"size:20;primaryKey;"` // Unique ID
|
|
CreatedAt time.Time `json:"created_at" gorm:"index;"` // Create time
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"index;"` // Update time
|
|
}
|
|
|
|
// Defining the query parameters for the `App` struct.
|
|
type AppQueryParam struct {
|
|
util.PaginationParam
|
|
}
|
|
|
|
// Defining the query options for the `App` struct.
|
|
type AppQueryOptions struct {
|
|
util.QueryOptions
|
|
}
|
|
|
|
// Defining the query result for the `App` struct.
|
|
type AppQueryResult struct {
|
|
Data Apps
|
|
PageResult *util.PaginationResult
|
|
}
|
|
|
|
// Defining the slice of `App` struct.
|
|
type Apps []*App
|
|
|
|
// Defining the data structure for creating a `App` struct.
|
|
type AppForm struct {
|
|
}
|
|
|
|
// A validation function for the `AppForm` struct.
|
|
func (a *AppForm) Validate() error {
|
|
return nil
|
|
}
|
|
|
|
// Convert `AppForm` to `App` object.
|
|
func (a *AppForm) FillTo(app *App) error {
|
|
return nil
|
|
}
|