获取企业微信后台创建的审批模板
微信官方网址
/**
* 微信官方接口地址配置
*/
@RetrofitClient(baseUrl = "${hzrc.wechar.companyUrl}")
public interface CompanyWeCharApi {
/**
*
* 获取审批模板详情
* @module
* @author SJT
* @date 2022/10/13
* @param access_token
* @param templateVo
* @return: com.hzrc.entity.wechar.Templatedetail
*/
@POST("cgi-bin/oa/gettemplatedetail")
TemplateDetail getTemplateDetail(@Query("access_token") String access_token, @Body TemplateVo templateVo);
}
hzrc.wechar.companyUrl 的地址为https://qyapi.weixin.qq.com
@Override
public TemplateDetail getTestTemplate() {
//获取token
String token = companyWeCharController.getToken();
TemplateVo templateVo = new TemplateVo();
templateVo.setTemplate_id(CompanyWeCharConfig.TEST_TEMPLATE_ID);
return companyWeCharApi.getTemplateDetail(token,templateVo);
}
TemplateDetail 为官方文档返回格式自建的实体 。
知是行之始,行是知之成!