package com.newfiber.api.mobile.controller; import com.newfiber.api.core.bean.ReqBodyObj; import com.newfiber.api.core.bean.RespBodyObj; import com.newfiber.api.core.support.HttpCode; import com.newfiber.api.pc.model.UserManager.SysOrganization; import com.newfiber.api.pc.service.RestTemplateService; import java.util.ArrayList; import java.util.List; import javax.annotation.Resource; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @RestController public class CommonController { @Resource private RestTemplateService restTemplateService; @PostMapping("/sysorganization/searchOrgListByUserNo") public RespBodyObj<List<SysOrganization>> queryInfoOrgListByUser(@RequestBody ReqBodyObj<SysOrganization> param){ if( param == null ){ return RespBodyObj.error(HttpCode.BAD_REQUEST); } SysOrganization sysOrganization = restTemplateService.getOrgByUserNo(param.getData().getChiefUserNo()); List<SysOrganization> result = new ArrayList<>(); result.add(sysOrganization); return RespBodyObj.ok(result); } }