Package com.onec.ui

Class DivKitController

java.lang.Object
com.onec.ui.DivKitController

@RestController @RequestMapping("/api/divkit") public class DivKitController extends Object
Emits the server-rendered DivKit app, split so the client can render instantly and load data lazily: /shell returns the chrome (top bar + nav, no data — fast), and each content endpoint returns just that surface's card. The client paints the shell immediately and streams content in beneath it behind a skeleton. Everything is resolved for the caller's persona, intersected with RBAC, in the requested theme/viewport — the same hooks a Flutter client uses.
  • Constructor Details

  • Method Details

    • shell

      @GetMapping("/shell") public Map<String,Object> shell(@RequestParam(required=false) String profile, @RequestParam(required=false) String viewport, @RequestParam(required=false) String theme, Principal principal)
    • account

      @GetMapping("/account") public Map<String,Object> account(@RequestParam(required=false) String profile, @RequestParam(required=false) String theme, Principal principal)
    • home

      @GetMapping("/home") public Map<String,Object> home(@RequestParam(required=false) String profile, @RequestParam(required=false) String viewport, @RequestParam(required=false) String theme, Principal principal)
    • settings

      @GetMapping("/settings") public Map<String,Object> settings(@RequestParam(required=false) String profile, @RequestParam(required=false) String viewport, @RequestParam(required=false) String theme, Principal principal)
      The Settings surface — opt-in via onec.ui.settings.enabled (off by default). An app can author its own Page at route "/settings" to compose lists/widgets next to (or instead of) the constant editor, and that authored page renders regardless of the flag; the built-in default page (the constant editor) is gated on the flag. With neither, the route is 404.
    • pageAction

      @PostMapping("/page-action") public ActionResult pageAction(@RequestParam String route, @RequestParam String key, @RequestParam(required=false) String profile, @RequestParam(required=false) String viewport, @RequestBody(required=false) Map<String,Object> body, Principal principal)
      Run a page action button's server handler — the обработка-style logic declared via PageBuilder.actions(java.lang.String, java.util.function.Consumer<com.onec.ui.ActionSpec>). The button posts the page route and action key; we re-resolve and re-compose the page (compose is a pure spec build, like the GET render), find the handler by key, and return its ActionResult. Page actions have no entity to gate on, so we require an authenticated user and leave finer authorization to the handler.
    • catalogList

      @GetMapping("/catalogs/{name}") public Map<String,Object> catalogList(@PathVariable String name, @RequestParam(required=false) String profile, @RequestParam(required=false) String theme, Principal principal)
    • catalogDetail

      @GetMapping("/catalogs/{name}/{id}") public Map<String,Object> catalogDetail(@PathVariable String name, @PathVariable UUID id, @RequestParam(required=false) String profile, @RequestParam(required=false) String theme, Principal principal)
    • catalogNew

      @GetMapping("/catalogs/{name}/new") public Map<String,Object> catalogNew(@PathVariable String name, Principal principal)
    • catalogEdit

      @GetMapping("/catalogs/{name}/{id}/edit") public Map<String,Object> catalogEdit(@PathVariable String name, @PathVariable UUID id, Principal principal)
    • catalogDuplicate

      @GetMapping("/catalogs/{name}/{id}/duplicate") public Map<String,Object> catalogDuplicate(@PathVariable String name, @PathVariable UUID id, Principal principal)
    • documentList

      @GetMapping("/documents/{name}") public Map<String,Object> documentList(@PathVariable String name, @RequestParam(required=false) String profile, @RequestParam(required=false) String theme, Principal principal)
    • documentDetail

      @GetMapping("/documents/{name}/{id}") public Map<String,Object> documentDetail(@PathVariable String name, @PathVariable UUID id, @RequestParam(required=false) String theme, Principal principal)
    • documentNew

      @GetMapping("/documents/{name}/new") public Map<String,Object> documentNew(@PathVariable String name, Principal principal)
    • documentEdit

      @GetMapping("/documents/{name}/{id}/edit") public Map<String,Object> documentEdit(@PathVariable String name, @PathVariable UUID id, Principal principal)
    • documentDuplicate

      @GetMapping("/documents/{name}/{id}/duplicate") public Map<String,Object> documentDuplicate(@PathVariable String name, @PathVariable UUID id, Principal principal)
    • registerReport

      @GetMapping("/registers/{name}") public Map<String,Object> registerReport(@PathVariable String name, @RequestParam(required=false) String from, @RequestParam(required=false) String to, @RequestParam(required=false) String theme, Principal principal)