package api import ( "atlas9.dev/c/core" "atlas9.dev/c/demo/bots" ) const ( Path_Bots_Save = "POST /Bots_Save" Path_Bots_Get = "POST /Bots_Get" Path_Bots_List = "POST /Bots_List" Path_Bots_Delete = "POST /Bots_Delete" ) type Bots_SaveReq struct { Bot bots.Bot } type Bots_SaveRes struct { Bot bots.Bot } type Bots_GetReq struct { ID core.ID Tenant core.ID } type Bots_GetRes struct { Bot bots.Bot } type Bots_ListReq struct { Tenant core.ID Page core.PageReq } type Bots_ListRes struct { Page core.Page[bots.Bot] } type Bots_DeleteReq struct { ID core.ID Tenant core.ID } type Bots_DeleteRes struct{} // Prepare functions func (b *Bots_SaveReq) Prepare() error { // TODO this feels more like a store-level concern? // the store should be enforcing data integrity at least. if b.Bot.ID.IsEmpty() { b.Bot.ID = core.NewID("bot") } return nil } func (b *Bots_GetReq) Prepare() error { return nil } func (b *Bots_ListReq) Prepare() error { return nil } func (b *Bots_DeleteReq) Prepare() error { return nil }