package com.tuoheng.controller;

import com.tuoheng.model.dto.LoginUser;
import com.tuoheng.model.param.CreateClientTenantDto;
import com.tuoheng.model.param.GetClientTenantRoleDto;
import com.tuoheng.service.ClientSevice;
import com.tuoheng.service.ClientUserSevice;
import com.tuoheng.service.CurrentUser;
import com.tuoheng.until.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenjiandong
 * @description: TODO
 * @date 2022/12/7 16:17
 */
@RestController
@RequestMapping("/client")
@Slf4j
public class ClientController {

    @Autowired
    private ClientSevice clientSevice;

    @PostMapping("/getAllClient")
    public JsonResult getAllClient(@CurrentUser LoginUser loginUser){
        return clientSevice.getAllClient();
    }

    @PostMapping("/getClientTenantRole")
    public JsonResult getClientTenantRole(@RequestBody GetClientTenantRoleDto getClientTenantRoleDto,
                                          @CurrentUser LoginUser loginUser){
        return clientSevice.getClientTenantRole(getClientTenantRoleDto);
    }

}
