
package com.tmerclub.cloud.product.controller.platform;

import com.tmerclub.cloud.common.order.vo.WarehouseVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.common.security.AuthUserContext;
import com.tmerclub.cloud.product.service.WarehouseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *
 *
 * @author tmerclub
 * @date 2023-11-08 11:11:44
 */
@RestController("platformWarehouseController")
@RequestMapping("/p/warehouse")
@Tag(name = "平台仓库管理")
public class WarehouseController {

    @Autowired
    private WarehouseService warehouseService;


    @GetMapping
    @Operation(summary = "获取仓库", description = "根据warehouseId获取")
    public ServerResponseEntity<WarehouseVO> getByWarehouseId() {
        return ServerResponseEntity.success(warehouseService.getDefaultWarehouseByShopId(AuthUserContext.get().getTenantId(), AuthUserContext.get().getSysType()));
    }
}
