2.14.4. POST

新建类接口

// 新建岗位
Map data = new HashMap() {
    {
        put("orgAccountId", 967547186016371000l);
        put("name", "岗位名称");
    }
};
String post = client.post("orgDepartment", data, String.class);

// 新建人员
Map data = new HashMap() {
    {
        put("orgAccountId", orgAccountId);
        put("name", memberName);
        put("code", "");
        put("sortId", 2);
        put("description", "");
        put("orgLevelId", levelId);
        put("orgPostId", postId);
        put("orgDepartmentId", departmentId);
        put("telNumber", "");
        put("birthday", null);
        put("officeNum", "");
        put("emailAddress", "");
        put("loginName", loginName);
    }
};
client.post("member", data, String.class);

新建和修改接口的数据,为了调用方便,通常使用Map,但如果有现成的JSON串,也可以传递字符串,比如

client.post("flow/H0001",
    "{\"senderLoginName\":\"sender\",\"subject\":\"这是用JSON发的\",\"data\":\"HTML正文\",\"attachments\":[-1,1]}",
    Long.class);