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

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.endpoint.user.user.api.UserLoginClientApi;
import com.red.circle.other.inner.model.cmd.user.LoginLogQryCmd;
import com.red.circle.other.inner.model.dto.user.UserLoginLoggerDTO;
import com.red.circle.other.app.inner.service.user.user.UserLoginClientService;
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 pengliang on 2023/10/17
 */
@Validated
@RestController
@RequestMapping(value = UserLoginClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class UserLoginClientEndpoint implements UserLoginClientApi {

  private final UserLoginClientService userLoginClientService;

  @Override
  public ResultResponse<PageResult<UserLoginLoggerDTO>> pageLoginLogger(LoginLogQryCmd cmd) {
    return ResultResponse.success(userLoginClientService.pageLoginLogger(cmd));
  }
}
