package api import ( "net/http" "atlas9.dev/c/core" "atlas9.dev/c/demo/lib/domains" ) func DomainApi(mux *http.ServeMux, impl *DomainImpl) { mux.HandleFunc("POST /Domain_Create", impl.Create) mux.HandleFunc("POST /Domain_Get", impl.Get) mux.HandleFunc("POST /Domain_List", impl.List) mux.HandleFunc("POST /Domain_Delete", impl.Delete) mux.HandleFunc("POST /Domain_Verify", impl.Verify) } type Domain_CreateReq struct { Tenant core.ID Domain string } type Domain_CreateRes struct { Domain domains.Domain } type Domain_GetReq struct { ID core.ID Tenant core.ID } type Domain_GetRes struct { Domain domains.Domain } type Domain_ListReq struct { Tenant core.ID Page core.PageReq } type Domain_ListRes struct { Page core.Page[domains.Domain] } type Domain_DeleteReq struct { ID core.ID Tenant core.ID } type Domain_DeleteRes struct{} type Domain_VerifyReq struct { ID core.ID Tenant core.ID } type Domain_VerifyRes struct { Verified bool } // Prepare methods func (d *Domain_CreateReq) Prepare() error { return nil } func (d *Domain_GetReq) Prepare() error { return nil } func (d *Domain_ListReq) Prepare() error { return nil } func (d *Domain_DeleteReq) Prepare() error { return nil } func (d *Domain_VerifyReq) Prepare() error { return nil }