package com.ruoyi.api.controller.info;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.FilePathSplicingType;
import com.ruoyi.common.filepathsplicing.FilePathSplicing;
import com.ruoyi.info.quicklink.domain.vo.QuickLinkVo;
import com.ruoyi.info.quicklink.service.IQuickLinkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 金刚区Controller
 *
 * @author wuchao
 * @date 2023-12-20
 */
@Validated
@Api(value = "金刚区控制器", tags = {"金刚区管理"})
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/quick/link")
public class ApiQuickLinkController {

    private final IQuickLinkService quickLinkService;

    /**
     * 根据位置标识码查询金刚区列表
     */
    @FilePathSplicing(type = FilePathSplicingType.RESPONSE)
    @ApiOperation("根据位置标识码查询金刚区列表")
    @GetMapping("/list/{locationCode}")
    public R<List<QuickLinkVo>> list(@PathVariable("locationCode") String locationCode) {
        return R.ok(quickLinkService.queryListForApi(locationCode));
    }

}
