致远OA如何开发 第八篇 新增接口

新增接口
此栏目技术支持

技术大佬对栏目文章的支持 特别感谢

新增接口

1 第一种方式 rest

java文件

java 复制代码
@Path("token1")
public class Resource extends BaseResource {


    @GET
    @Path("/{userName}/{password}")
    @Produces({"text/plain"})
    public String getTokenString(@PathParam("userName") String userName, @PathParam("password") String password, @QueryParam("loginName") String loginName, @QueryParam("memberId") Long memberId, @QueryParam("code") String code, @QueryParam("userAgentFrom") String userAgentFrom) throws Exception {
        System.out.println("欢迎回到财务系统");
        return "ok";
    }


}

2 第二种方式 Ajax

新增文件java

java 复制代码
public class MechanicianPage {
    @AjaxAccess
    public void saveProcessXml(Map<String, Object> Data)
    {
        String processXml=Data.get("processXml").toString();
        String nodeId=Data.get("nodeId").toString();
        String userId=Data.get("userId").toString();
        ((WorkFlowDesignerManagerImpl) workFlowDesignerManager).getWapi().savedProcessXmlTempAndReturnId(null,processXml,nodeId,userId,"-1");
    }

依赖注入

xml 复制代码
<bean id="managerInfo" class="com.seeyon.apps.gzysplugin.listener.MechanicianPage"></bean>
相关推荐
寻星探路1 天前
【深度长文】万字攻克网络原理:从 HTTP 报文解构到 HTTPS 终极加密逻辑
java·开发语言·网络·python·http·ai·https
崔庆才丨静觅1 天前
hCaptcha 验证码图像识别 API 对接教程
前端
陌上丨1 天前
Redis的Key和Value的设计原则有哪些?
数据库·redis·缓存
曹牧1 天前
Spring Boot:如何测试Java Controller中的POST请求?
java·开发语言
passerby60611 天前
完成前端时间处理的另一块版图
前端·github·web components
AI_56781 天前
AWS EC2新手入门:6步带你从零启动实例
大数据·数据库·人工智能·机器学习·aws
掘了1 天前
「2025 年终总结」在所有失去的人中,我最怀念我自己
前端·后端·年终总结
崔庆才丨静觅1 天前
实用免费的 Short URL 短链接 API 对接说明
前端
ccecw1 天前
Mysql ONLY_FULL_GROUP_BY模式详解、group by非查询字段报错
数据库·mysql