package com.wmyun.module.shipping.controller.admin;

import com.wmyun.framework.common.pojo.CommonResult;
import com.wmyun.module.shipping.service.YunDangAuthService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.wmyun.framework.common.pojo.CommonResult.success;

/**
 * @Description: TODO
 * @Date: 2025/3/10 14:05
 * @Created: by ZZSLL
 */

@Tag(name = "云当网 - Default")
@RestController
@RequestMapping("/shipping/default")
@Validated
public class DefaultController {

    @Autowired
    private YunDangAuthService authService;

    @GetMapping("/get")
    @Operation(summary = "Default API")
    public CommonResult<String> get() {
        return success(this.getClass().getName());
    }

    @GetMapping("/token")
    @Operation(summary = "获取云当网访问token")
    public CommonResult<String> token() {
        return success(authService.getAccessToken());
    }
}
