package com.seer.teach.mall.order.controller;


import cn.dev33.satoken.annotation.SaCheckPermission;
import com.seer.teach.common.ResultBean;
import com.seer.teach.mall.order.service.IAdminLogisticsService;
import com.seer.teach.mall.shipping.jt.resp.TraceResp;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  微信小程序物流控制器
 * </p>
 *
 * @author Captain
 * @since 2025-06-10
 */
@Tag(name = "管理端 - 物流")
@Validated
@RestController
@RequestMapping("/mall/logistics")
@RequiredArgsConstructor
public class AdminLogisticsController {


    private final IAdminLogisticsService logisticsService;

    @Operation(summary = "物流轨迹查询")
    @GetMapping("/trace")
    @SaCheckPermission("admin:logistics:trace")
    public ResultBean<List<TraceResp>> list(@RequestParam(value = "orderSn",required = true) @Parameter(description = "orderSn") String orderSn) {
        return ResultBean.success(logisticsService.getLogisticsTrace(orderSn));
    }
}