51 lines
1.1 KiB
Go
51 lines
1.1 KiB
Go
package schema
|
|
|
|
import (
|
|
"github.guxuan/haibei/pkg/util"
|
|
)
|
|
|
|
// Defining the `Notice` struct.
|
|
type SignIn struct {
|
|
util.BaseModel
|
|
CustomerID uint `json:"customerId" gorm:"not null;index"`
|
|
ReceptionID uint `json:"receptionId" gorm:"not null;index"`
|
|
}
|
|
|
|
// Defining the query parameters for the `Notice` struct.
|
|
type SignInQueryParam struct {
|
|
util.PaginationParam
|
|
}
|
|
|
|
// Defining the query options for the `Notice` struct.
|
|
type SignInQueryOptions struct {
|
|
util.QueryOptions
|
|
}
|
|
|
|
// Defining the query result for the `Notice` struct.
|
|
type SignInQueryResult struct {
|
|
Data SignIns
|
|
PageResult *util.PaginationResult
|
|
}
|
|
|
|
// Defining the slice of `Notice` struct.
|
|
type SignIns []*SignIn
|
|
|
|
// Defining the data structure for creating a `Notice` struct.
|
|
type SignInForm struct {
|
|
CustomerID uint `json:"customerId" `
|
|
ReceptionID uint `json:"receptionId"`
|
|
}
|
|
|
|
// A validation function for the `NoticeForm` struct.
|
|
func (a *SignInForm) Validate() error {
|
|
return nil
|
|
}
|
|
|
|
// Convert `NoticeForm` to `Notice` object.
|
|
func (a *SignInForm) FillTo(signIn *SignIn) error {
|
|
signIn.CustomerID = a.CustomerID
|
|
signIn.ReceptionID = a.ReceptionID
|
|
|
|
return nil
|
|
}
|