feat:完善项目
This commit is contained in:
27
task/order.go
Normal file
27
task/order.go
Normal file
@ -0,0 +1,27 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"SciencesServer/utils"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
type Order struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (this *Order) MarshalBinary() ([]byte, error) {
|
||||
return json.Marshal(this)
|
||||
}
|
||||
|
||||
func (this *Order) UnmarshalBinary(data []byte) error {
|
||||
return utils.FromJSONBytes(data, this)
|
||||
}
|
||||
|
||||
func (this *Order) Handle() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewOrder() *Order {
|
||||
return &Order{ID: "23", Name: "Henry"}
|
||||
}
|
Reference in New Issue
Block a user