|
|
|
@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@RequestMapping("accessSite") |
|
|
|
@RestController |
|
|
|
@ -48,4 +49,26 @@ public class AccessSiteController extends AbstractController { |
|
|
|
return R.ok(getLanguageMsg(SysMsgConstant.OBJECT_ID_200000)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据用户名获取用户授权的工厂列表(包含工厂名称) |
|
|
|
* @param params 包含userName的参数 |
|
|
|
* @return 工厂列表 |
|
|
|
*/ |
|
|
|
@PostMapping("getUserAuthorizedSites") |
|
|
|
public R getUserAuthorizedSites(@RequestBody Map<String, Object> params) { |
|
|
|
String userName = (String) params.get("userName"); |
|
|
|
|
|
|
|
if (userName == null || userName.trim().isEmpty()) { |
|
|
|
return R.error("用户名不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
List<Map<String, Object>> siteList = accessSiteService.getUserAuthorizedSites(userName.trim()); |
|
|
|
return R.ok().put("data", siteList); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("获取用户授权工厂列表失败", e); |
|
|
|
return R.error("获取工厂列表失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |