package com.red.circle.other.app.inner.endpoint.user.user;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.user.user.UserProfileClientService;
import com.red.circle.other.inner.endpoint.user.user.api.SysUserProfileClientApi;
import com.red.circle.other.inner.endpoint.user.user.api.UserProfileClientApi;
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 后台导入用户资料服务.
 *
 * @author lixiaofei on 2024/9/2
 */
@Validated
@RestController
@RequestMapping(value = SysUserProfileClientApi.API_PREFIX, produces = MediaType.MULTIPART_FORM_DATA_VALUE)
@RequiredArgsConstructor
public class SysUserProfileClientEndpoint implements SysUserProfileClientApi {

  private final UserProfileClientService userProfileClientService;

  @Override
  public ResultResponse<UserProfileDTO> getByUserId(Long userId) {
    return ResultResponse.success(userProfileClientService.getByUserId(userId));
  }
}
