package com.zhongshu.card.client.service.org;

import com.zhongshu.card.client.model.base.AuthTypeParam;
import com.zhongshu.card.client.model.base.UserIdModel;
import com.zhongshu.card.client.model.org.*;
import com.github.microservice.net.ResultContent;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

public interface UserAccountService {

    // 注册基本用户
    ResultContent<String> registerUserAccount(RegisterUserAccountParam param);

    // 查询机构用户列表
    ResultContent<Page<OrganizationUserModel>> projectUserPage(OrganizationUserSearch param, Pageable pageable);

    /**
     * 得到机构用户详情
     *
     * @param oid    机构oid
     * @param userId 用户userId
     * @return
     */
    OrganizationUserModel getOrgUserDetail(String oid, String userId, boolean isContentUserInfo);

    // 得到平台用户详情
    ResultContent<OrganizationUserModel> getOrgUserDetail(OrgUserDetailParam param);

    // 删除机构用户
    ResultContent deleteOrgUser(DelUserCountParam param);

    // 修改用户状态
    ResultContent updateOrgUserState(UpdateUserStateParam param);

    // 当前用户修改密码
    ResultContent updatePassWord(PassWordModel param);

    // 修改用户头像
    ResultContent updateUserHead(String url);

    // 编辑当前用户的基本信息
    ResultContent updateUserInfo(UserCountUpdateParam param);

    // 重置用户密码（默认密码）
    ResultContent resetPassWord(UserIdModel param);

    // 查询机构用户列表
    ResultContent<Page<OrganizationUserModel>> pageOrgUser(OrganizationUserSearch param, Pageable pageable);

    ResultContent<UserCountDetailsModel> getCurrentDetail(AuthTypeParam param);

    ResultContent<UserCountDetailsModel> getBusCurrentDetail(AuthTypeParam param);

    ResultContent<UserCountDetailsModel> getCurrentDetailAndOrgs(AuthTypeParam param);

    ResultContent<UserCountModel> getUserDetail(String userId);

    // 得到当前用户在当前机构的信息
    ResultContent<OrganizationUserModel> getCurrentUserOrg();

    @Operation(summary = "分页查询所有用户", description = "分页查询用户")
    @RequestMapping(value = "list", consumes = {MediaType.ALL_VALUE}, method = RequestMethod.POST)
    ResultContent<Page<UserCountModel>> list(
            @Parameter(required = false) UserCountSearchParam param,
            @Parameter(hidden = true) @PageableDefault Pageable pageable
    );



}
