package com.tuoheng.third.controller;

import com.tuoheng.model.dto.LoginUser;
import com.tuoheng.service.CurrentUser;
import com.tuoheng.third.request.ThirdRequest;
import com.tuoheng.third.service.ThirdService;
import com.tuoheng.until.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 第三方请求响应 前端控制器
 * @Author xiaoying
 * @Date 2023/3/8 9:01
 */
@RestController
@RequestMapping("/third")
public class ThirdController {

    @Autowired
    private ThirdService thirdService;


    /**
     * dsp -获取算法实例
     * @return
     */
    @GetMapping("/findExample")
    public JsonResult findExample(){
        return thirdService.findExample();
    }
    /**
     * 查询对应业务平台的所有角色
     *
     * @param clientId  平台标识
     * @param loginUser
     * @return
     */
    @GetMapping("/getRoleList")
    public JsonResult getRoleList(String clientId, @CurrentUser LoginUser loginUser) {
        return thirdService.getRoleList(clientId, loginUser);
    }

    /**
     * 查询对应业务平台角色对应的菜单
     *
     * @param request  请求参数
     * @param loginUser
     * @return
     */
    @GetMapping("/getMenuList")
    public JsonResult getMenuList(ThirdRequest request, @CurrentUser LoginUser loginUser) {
        return thirdService.getMenuList(request, loginUser);
    }

}
