| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package main
- //import (
- //DEATH "github.com/vrecan/death"
- //"go-framework/baize"
- //"syscall"
- //)
- //type Class struct {
- // domain.IDField
- // Name string `write:"column:name;" read:"column:name;condition:'${column} LIKE %${value}%'" cache:"key:${field.IDField}"`
- // domain.TenantIDField
- // domain.UserIDFields
- // domain.TimeFields
- //}
- //
- //type Student struct {
- // domain.IDField
- // Name string `write:"column:name;" read:"column:name;condition:'${column} LIKE %${value}%'"`
- // Age int `write:"column:age;" read:"column:age;condition:'${column} LIKE %${value}%'" cache:"key:${field.IDField}"`
- // domain.TenantIDField
- // domain.UserIDFields
- // domain.TimeFields
- //}
- func main() {
- //app, err := baize.NewApplication("10000", WithDB(config))
- //if err != nil {
- // panic(err)
- //}
- //
- //app.RegisterRouter("v1", middlewares...).
- // RegisterCommonCrud(&Class{}).
- // RegisterCrud(&common.Crud{
- // Api: common.CrudApi{},
- // Service: common.CrudService{},
- // DomainObject: &Student{},
- // }).
- // RegisterRelation(&common.Relation{
- // Type: common.One2Many,
- // LeftDomainEntity: &Class{},
- // RightDomainEntity: &Student{},
- // })
- //
- //go func() {
- // err := app.Start()
- // if err != nil {
- // panic(err)
- // }
- //}()
- //
- //defer func() {
- // err := app.Finish()
- // if err != nil {
- // panic(err)
- // }
- //}()
- //
- //death := DEATH.NewDeath(syscall.SIGINT, syscall.SIGTERM)
- //_ = death.WaitForDeath()
- }
|