package com.cool.store.controller.webb;

import com.cool.store.dto.content.ContentQueryDetailDto;
import com.cool.store.dto.region.BigRegionDTO;
import com.cool.store.entity.HyContentInfoDO;
import com.cool.store.request.QueryBigRegionRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.BigRegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author suzhuhong
 * @Date 2025/5/9 14:40
 * @Version 1.0
 */
@Api(tags = "大区相关")
@RestController
@RequestMapping("pc/region")
public class BigRegionController {

    @Resource
    BigRegionService bigRegionService;

    @PostMapping("/queryAllBigRegion")
    @ApiOperation("获取所有可选择的大区")
    public ResponseResult<List<BigRegionDTO>> queryContentInfo(@RequestParam(required = false) String keyword,
                                                               @RequestParam(required = false) Integer joinBrand,
                                                               @RequestParam(required = true)Integer type) {
        return ResponseResult.success(bigRegionService.queryAllBigRegion(keyword, joinBrand,type));
    }

    @PostMapping("/queryBigRegion")
    @ApiOperation("获取可选择的大区joinMode = 0")
    public ResponseResult<List<BigRegionDTO>> queryBigRegion(@RequestBody QueryBigRegionRequest queryBigRegionRequest) {
        return ResponseResult.success(bigRegionService.queryBigRegion(queryBigRegionRequest));
    }

}
