package com.horizon.org.web;

import com.horizon.third.init.WorkflowAdapterInit;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.horizon.workflow.rest.web.base.RestSuperController;

@Controller
@RequestMapping("/horizon/workflow/rest")
public class OrgSysController extends RestSuperController {

    /**
     * 重新加载组织机构树
     * /horizon/workflow/rest/org/sys.wf
     */
	@RequestMapping(value = "/org/sys.wf", method = RequestMethod.POST)
	@ResponseBody
    public String updateOrg() {
       WorkflowAdapterInit.getOrganizationBuilder().init();
       return JSON.toJSONString("更新成功");
   }
}