package com.red.circle.other.adapter.app.user.user;

import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.cmd.user.user.UserLogoutApplyCmd;
import com.red.circle.other.app.dto.cmd.user.user.UserLogoutLogCmd;
import com.red.circle.other.app.service.user.user.UserLogoutLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户注销记录 前端控制器.
 * </p>
 *
 * @author zongpubin on 2023-09-12 11:01
 * @eo.api-type http
 * @eo.groupName 用户服务.注销记录
 * @eo.path /logout-log
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/user/logout-log")
public class LogoutLogRestController extends BaseController {

  private final UserLogoutLogService userLogoutLogService;

  /**
   * 查询注销记录.
   *
   * @eo.name 查询注销记录.
   * @eo.url /get
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/get")
  public Boolean getLogoutLog(UserLogoutLogCmd cmd) {
    return userLogoutLogService.getLogoutLog(cmd);
  }

  /**
   * 新增注销记录.
   *
   * @eo.name 新增注销记录.
   * @eo.url /add
   * @eo.method post
   * @eo.request-type json
   */
  @PostMapping("/add")
  public void addLogoutLog(@RequestBody @Validated UserLogoutLogCmd cmd) {
    userLogoutLogService.addLogoutLog(cmd);
  }

  /**
   * 新增注销记录-web.
   *
   * @eo.name 新增注销记录-web.
   * @eo.url /apply
   * @eo.method post
   * @eo.request-type json
   */
  @PostMapping("/apply")
  public void addLogoutApply(@RequestBody @Validated UserLogoutApplyCmd cmd) {
    userLogoutLogService.addLogoutApply(cmd);
  }

}



