package com.cool.store.controller.webb;

import com.cool.store.common.PageBasicInfo;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.StoreService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * PC门店 前端控制器
 * </p>
 *
 * @author wangff
 * @since 2025/9/9
 */
@Api(tags = "PC门店")
@RestController
@RequestMapping("/pc/stores")
@RequiredArgsConstructor
public class PCStoreController {
    private final StoreService storeService;

    @ApiOperation("当前用户门店列表")
    @PostMapping("/userStoreList")
    public ResponseResult<PageInfo<MiniShopsResponse>> getCurrentUserStoreList(@RequestBody PageBasicInfo request) {
        return ResponseResult.success(storeService.getStoreListByMobile(CurrentUserHolder.getUser().getMobile(), request.getPageNum(), request.getPageSize(), null, null));
    }
}
