package org.dromara.zhishu.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import lombok.RequiredArgsConstructor;
import jakarta.validation.constraints.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.zhishu.domain.vo.TShopDepotAotuVo;
import org.dromara.zhishu.domain.bo.TShopDepotAotuBo;
import org.dromara.zhishu.service.ITShopDepotAotuService;
import org.dromara.common.mybatis.core.page.TableDataInfo;

/**
 * 店铺自动发布仓库关联
 *
 * @author Lion Li
 * @date 2025-09-05
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/zhishu/shopDepotAotu")
public class TShopDepotAotuController extends BaseController {

    private final ITShopDepotAotuService tShopDepotAotuService;

    /**
     * 查询店铺自动发布仓库关联列表
     */
    @SaCheckPermission("zhishu:shopDepotAotu:list")
    @GetMapping("/list")
    public TableDataInfo<TShopDepotAotuVo> list(@ModelAttribute TShopDepotAotuBo bo, PageQuery pageQuery) {
        return tShopDepotAotuService.queryPageList(bo, pageQuery);
    }

    /**
     * 获取店铺自动发布仓库关联详细信息
     *
     * @param id 主键
     */
    @SaCheckPermission("zhishu:shopDepotAotu:list")
    @GetMapping("/{id}")
    public R<TShopDepotAotuVo> getInfo(@NotNull(message = "主键不能为空")
                                       @PathVariable Long id) {
        return R.ok(tShopDepotAotuService.queryById(id));
    }
}