package co.yixiang.yshop.module.shop.controller.app;

import co.yixiang.yshop.framework.common.pojo.CommonResult;
import co.yixiang.yshop.module.shop.controller.admin.shop.vo.ShopRespVO;
import co.yixiang.yshop.module.shop.controller.app.vo.ShopDTO;
import co.yixiang.yshop.module.shop.service.shop.ShopService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
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 javax.annotation.Resource;
import java.util.List;

/**
 * @author pepis
 * @apiNote
 **/
@Tag(name = "app - 门店")
@RestController
@RequestMapping("/mall/shop")
@Validated
public class AppShopController {
    @Resource
    private ShopService shopService;

    /**
     * 门店列表
     */
    @GetMapping("list")
    @Operation(summary = "门店列表")
    public CommonResult<List<ShopRespVO>> list(ShopDTO dto) {
        List<ShopRespVO> list = shopService.getShopList4App(dto);
        return CommonResult.success(list);
    }

}
