package me.zhengjie.modules.weixin.cp.api; import lombok.NonNull; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.zhengjie.modules.weixin.cp.bean.smartsheet.field.*; import me.zhengjie.modules.weixin.cp.bean.smartsheet.record.*; import me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet.*; import me.zhengjie.modules.weixin.cp.bean.smartsheet.view.*; import java.util.List; /** * 企业微信文档相关接口 * 文档 * * @author baolh */ public interface WxCpOaWeDocSmartsheetService { /** * 添加子表 * 本接口用于在表格的某个位置添加一个智能表,该智能表不存在视图、记录和字段,可以使用 API 在该智能表中添加视图、记录和字段。 *
* 请求方式:POST(HTTPS) * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/add_sheet?access_token=ACCESS_TOKEN * * @param request 添加子表对应请求参数 * @return properties:智能表属性,properties.sheet_id:智能表 ID,创建子表时生成的 6 位随机 ID,properties.title:智能表标题,properties.index:智能表下标 * @throws WxErrorException the wx error exception */ WxCpSheetCreateData sheetCreate(@NonNull WxCpSheetCreateRequest request) throws WxErrorException; /** * 删除子表 * 本接口用于删除在线表格中的某个智能表。 *
* 请求方式:POST(HTTPS) * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/delete_sheet?access_token=ACCESS_TOKEN * * @param docId 文档的docid * @param sheetId 删除的Smartsheet 子表 ID * @return wx cp base resp * @throws WxErrorException the wx error exception */ WxCpBaseResp sheetDelete(String docId, String sheetId) throws WxErrorException; /** * 更新子表 * 本接口用于修改表格中某个子表的标题。 *
* 请求方式:POST(HTTPS) * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/update_sheet?access_token=ACCESS_TOKEN * * @param request 更新子表对应请求参数 * @return wx cp base resp * @throws WxErrorException the wx error exception */ WxCpBaseResp sheetEdit(@NonNull WxCpSheetEditRequest request) throws WxErrorException; /** * 查询子表 * 本接口用于查询一篇在线表格中全部智能表信息。 *
* 请求方式:POST(HTTPS) * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/get_sheet?access_token=ACCESS_TOKEN * * @param request 查询子表对应请求参数 * @return sheetList:智能表信息列表 * @throws WxErrorException the wx error exception */ WxCpSheetInfo sheetInfo(@NonNull WxCpSheetQueryRequest request) throws WxErrorException; /** * 添加视图 * 本接口用于在 Smartsheet 中的某个子表里添加一个新视图。单表最多允许有200个视图。 *
* 请求方式:POST(HTTPS) * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/add_view?access_token=ACCESS_TOKEN * * @param request 添加子表对应请求参数 * @return view:添加视图响应 * @throws WxErrorException the wx error exception */ WxCpViewCreateData viewCreate(@NonNull WxCpViewCreateRequest request) throws WxErrorException; /** * 删除视图 * 本接口用于在 smartsheet 中的某个子表里删除若干个视图。 *
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/delete_views?access_token=ACCESS_TOKEN
*
* @param docId 文档的docid
* @param sheetId Smartsheet 子表ID
* @param viewIds 要删除的视图ID列表
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp viewDelete(String docId, String sheetId, List
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/update_view?access_token=ACCESS_TOKEN
*
* @param request 更新视图对应请求参数
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp viewEdit(@NonNull WxCpViewEditRequest request) throws WxErrorException;
/**
* 查询视图
* 本接口用于获取 Smartsheet 中某个子表里全部视图信息。
*
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/get_views?access_token=ACCESS_TOKEN
*
* @param request 查询视图对应请求参数
* @return total:符合筛选条件的视图总数,hasMore:是否还有更多项,next:下次下一个搜索结果的偏移量,views:视图数据,
* @throws WxErrorException the wx error exception
*/
WxCpViewInfo viewInfo(@NonNull WxCpViewQueryRequest request) throws WxErrorException;
/**
* 添加字段
* 本接口用于在智能表中的某个子表里添加一列或多列新字段。单表最多允许有150个字段。
*
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/add_fields?access_token=ACCESS_TOKEN
*
* @param request 添加字段对应请求参数
* @return fields:字段详情
* @throws WxErrorException the wx error exception
*/
WxCpFieldCreateData fieldCreate(@NonNull WxCpFieldCreateRequest request) throws WxErrorException;
/**
* 删除字段
* 本接口用于删除智能表中的某个子表里的一列或多列字段。
*
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/delete_fields?access_token=ACCESS_TOKEN
*
* @param docId 文档的docid
* @param sheetId 表格ID
* @param fieldIds 需要删除的字段id列表
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp fieldDelete(String docId, String sheetId, List
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/update_fields?access_token=ACCESS_TOKEN
*
* @param request 添加字段对应请求参数
* @return fields:字段详情
* @throws WxErrorException the wx error exception
*/
WxCpFieldEditData fieldEdit(@NonNull WxCpFieldEditRequest request) throws WxErrorException;
/**
* 查询字段
* 本接口用于获取智能表中某个子表下字段信息,该接口可以完成下面三种功能:获取全部字段信息、依据字段名获取对应字段、依据字段 ID 获取对应字段信息。
*
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/get_fields?access_token=ACCESS_TOKEN
*
* @param request 查询字段对应请求参数
* @return total:字段总数,fields:字段详情,
* @throws WxErrorException the wx error exception
*/
WxCpFieldInfo fieldInfo(@NonNull WxCpFieldQueryRequest request) throws WxErrorException;
/**
* 添加记录
* 本接口用于在 Smartsheet 中的某个子表里添加一行或多行新记录。单表最多允许有40000行记录。
* 注意:不能通过添加记录接口给创建时间、最后编辑时间、创建人和最后编辑人四种类型的字段添加记录。
*
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/add_records?access_token=ACCESS_TOKEN
*
* @param request 添加记录对应请求参数
* @return fields:字段详情
* @throws WxErrorException the wx error exception
*/
WxCpRecordCreateData recordCreate(@NonNull WxCpRecordCreateRequest request) throws WxErrorException;
/**
* 删除记录
* 本接口用于删除 Smartsheet 的某个子表中的一行或多行记录。
*
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/delete_records?access_token=ACCESS_TOKEN
*
* @param docId 文档的docid
* @param sheetId Smartsheet 子表ID
* @param recordIds 要删除的记录 ID
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp recordDelete(String docId, String sheetId, List
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/update_records?access_token=ACCESS_TOKEN
*
* @param request 添加字段对应请求参数
* @return records:由更新成功的记录的具体内容组成的 JSON 数组
* @throws WxErrorException the wx error exception
*/
WxCpRecordEditData recordEdit(@NonNull WxCpRecordEditRequest request) throws WxErrorException;
/**
* 查询记录
* 本接口用于获取 Smartsheet 中某个子表下记录信息,该接口可以完成下面三种功能:获取全部记录信息、依据字段名和记录 ID 获取对应记录、对记录进行排序。
*
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/get_records?access_token=ACCESS_TOKEN
*
* @param request 查询记录对应请求参数
* @return total:记录总数,hasMore:是否还有更多项,next:下次下一个搜索结果的偏移量,records:由查询记录的具体内容组成的 JSON 数组,
* @throws WxErrorException the wx error exception
*/
WxCpRecordInfo recordInfo(@NonNull WxCpRecordQueryRequest request) throws WxErrorException;
}