package com.bonus.system.controller;

import com.bonus.system.api.domain.SysAddress;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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 com.bonus.system.service.ISysAddressService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import java.util.List;

/**
 * 地址管理Controller
 * 
 * @author xsheng
 * @date 2025-01-06
 */
@Api(tags = "地址管理接口")
@RestController
@RequestMapping("/address")
public class SysAddressController extends BaseController {
    @Autowired
    private ISysAddressService sysAddressService;

    /**
     * 查询地址列表
     */
    @ApiOperation(value = "查询地址列表")
    @GetMapping("/list")
    public AjaxResult list(SysAddress sysAddress) {
        List<SysAddress> list = sysAddressService.selectSysAddressList(sysAddress);
        return AjaxResult.success(list);
    }

    /**
     * 获取地址详细信息
     */
    @ApiOperation(value = "获取地址详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(sysAddressService.selectSysAddressById(id));
    }

}
