facade

package
v1.8.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

统一门面(v1.1.0)——"接口即 POST + JSON body"风格的单入口

集成方只实现一个转发 controller/endpoint:把 body JSON 转成 map 传入 Flow, 所有流程能力按 action(boot2/boot3 端点短名)路由。返回统一结构 {code, msg, data} (code=0 成功 / 99999999 失败)。

操作人约定:门面不感知登录态,args["operator"] 显式传入。

⚠️ id 传参约定(issues/38 E9 对齐 Node):id 类参数(processDefineId/processTaskId/...) 建议以**字符串**传递。集成方若用 encoding/json 把请求体解析为 map,数字默认变 float64 (53 位尾数),Java 雪花 id(>2^53)在解析层就已丢精度——门面对超 2^53 的 float64 显性报错(不静默截断),字符串路径 strconv.ParseInt 精确无损。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Facade

type Facade struct {
	// contains filtered or unexported fields
}

Facade 统一门面

func New

New 构造门面

func (*Facade) Flow

func (f *Facade) Flow(action string, args map[string]interface{}) (r map[string]interface{})

Flow 统一入口(action 清单见 spec §11.2)

func (*Facade) SetMetaReader added in v1.8.4

func (f *Facade) SetMetaReader(reader interface {
	ReadByProcessInstance(tableName string, processInstanceID interface{}) (interface{}, error)
}) *Facade

SetMetaReader 注入业务数据读取器(issue 30):需有 ReadByProcessInstance(tableName, processInstanceID)

func (*Facade) SetOrgUserProvider added in v1.6.0

func (f *Facade) SetOrgUserProvider(orgProv spi.OrgUserProvider) *Facade

SetOrgUserProvider 注入组织用户提供者(candidatePage candidateGroups 角色取人)

func (*Facade) SetUserSearch added in v1.2.0

func (f *Facade) SetUserSearch(fn UserSearch) *Facade

SetUserSearch 注入用户搜索钩子

type UserSearch added in v1.2.0

type UserSearch func(query map[string]interface{}) ([]map[string]interface{}, int, error)

UserSearch 用户搜索钩子(v1.2.0,可选)——candidatePage 无模型候选时的用户分页搜索。 返回 (rows, total, err);query 透传 pageNum/pageSize/搜索条件。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL