package com.tuoheng.admin.service.third.oidc;

import com.tuoheng.admin.entity.Tenant;
import com.tuoheng.admin.entity.User;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class OidcServiceImpl implements OidcService {

    @Autowired
    private AddOidcUserService addOidcUserService;

    @Autowired
    private EditOidcUserService editOidcUserService;

    @Autowired
    private EditOidcUserPasswordService editOidcUserPasswordService;

    public JsonResult addUser(User user, Tenant tenant) {
        return addOidcUserService.add(user, tenant);
    }

    public JsonResult editUser(User user) {
        return editOidcUserService.edit(user);
    }

    public JsonResult editUserPassword(User user) {
        return editOidcUserPasswordService.editUserPassword(user);
    }
}
