package com.ffii.core.user.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ffii.core.response.RecordsRes;
import com.ffii.core.support.AbstractController;
import com.ffii.core.user.service.AuthService;
import com.ffii.core.user.service.pojo.AuthRecord;

import io.swagger.v3.oas.annotations.Operation;

@RestController
@RequestMapping("/protected/auth")
public class AuthController extends AbstractController {

  private AuthService authService;

  public AuthController(AuthService authService) {
    this.authService = authService;
  }

  @Operation(summary="list system authorities")
  @GetMapping
  public RecordsRes<AuthRecord> list() {
    return new RecordsRes<>(authService.list());
  }

}
