package cn.iocoder.yudao.module.base.controller.app;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.base.service.DriveSchoolAddressService;
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 static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "小程序 - 地址管理")
@RestController
@RequestMapping("/small/address")
@Validated
public class DriveSchoolAddressSmallProgramController {

    @Resource
    private DriveSchoolAddressService addressService;

    /**
     * 查满足条件的所有地址
     * @author vinjor-M
     * @date 18:38 2025/2/6
     * @param type 地点类型（0-训练|1-考试）
     * @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
    **/
    @GetMapping("/getList")
    @Operation(summary = "查满足条件的所有地址")
    @TenantIgnore
    public CommonResult<?> getList(Integer type,String subject, Long tenantId) {
        return success(addressService.getList(type,subject,tenantId));
    }


}