package com.ozs.gateway.util;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "account")
public interface AccountService {
    
    @GetMapping("/account/createToken")
    public String createToken(@RequestParam("id")String id, @RequestParam("subject")String subject, @RequestParam("ttlMillis")long ttlMillis);
    
    @GetMapping("/account/parseTokenId")
    public String parseTokenId(@RequestParam("jwt")String jwt);
    
    @GetMapping("/account/parseTokenSubject")
    public String parseTokenSubject(@RequestParam("jwt")String jwt);
    
    @GetMapping("/account/saveToken")
    public String saveToken(@RequestParam("id")String id, @RequestParam("token")String token, @RequestParam("minute")int minute);
    
    @GetMapping("/account/deleteToken")
    public String deleteToken(@RequestParam("id")String id);
    
    @GetMapping("/account/getTokenByAccountId")
    public String getTokenByAccountId(@RequestParam(value="accountId", required=true) String accountId);
    
    @GetMapping("/account/refreshToken")
    public String refreshToken(@RequestParam(value="accountId", required=true) String accountId, @RequestParam(value="minute", required=true)int minute);
    
}
