package com.zhongshu.card.server.core.controller.openAPI;

import com.github.microservice.auth.security.annotations.ResourceAuth;
import com.github.microservice.auth.security.type.AuthType;
import com.github.microservice.net.ResultContent;
import com.zhongshu.card.client.model.base.IDParam;
import com.zhongshu.card.client.openApi.model.OrganizationUserOpenApiModel;
import com.zhongshu.card.client.openApi.params.OrganizationUserOpenApiSearch;
import com.zhongshu.card.server.core.service.openAPI.OrganizationUserOpenApiService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author TRX
 * @date 2024/6/5
 */
@RestController
@RequestMapping("/openAPI/v1/projectUserManager")
@Tag(name = "openAPI-项目用户")
public class OrganizationUserOpenApiController {

    @Autowired
    private OrganizationUserOpenApiService organizationUserOpenApiService;

    @Operation(summary = "项目用户列表-分页查询", description = "项目用户列表-分页查询")
    @RequestMapping(value = {"page"}, method = {RequestMethod.POST})
    public ResultContent<Page<OrganizationUserOpenApiModel>> page(@RequestBody OrganizationUserOpenApiSearch param) {
        return organizationUserOpenApiService.projectUserPage(param);
    }

    @Operation(summary = "用户详情", description = "用户详情")
    @RequestMapping(value = {"getUserDetailById"}, method = {RequestMethod.POST})
    public ResultContent<OrganizationUserOpenApiModel> getUserDetailById(@RequestBody IDParam param) {
        return organizationUserOpenApiService.getUserDetailById(param.getId());
    }

}
