123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- package com.caimei.controller.auth;
- import com.caimei.model.ResponseJson;
- import com.caimei.model.vo.AddressSelectVo;
- import com.caimei.service.auth.AddressService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiImplicitParam;
- import io.swagger.annotations.ApiImplicitParams;
- import io.swagger.annotations.ApiOperation;
- import lombok.RequiredArgsConstructor;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- /**
- * 地址Api
- *
- * @author : Aslee
- * @date : 2021/7/2
- */
- @Api(tags = "地址API")
- @RestController
- @RequiredArgsConstructor
- @RequestMapping("/address")
- public class AddressApi {
- private final AddressService addressService;
- /**
- * 收货地址下拉选项列表
- */
- @ApiOperation("收货地址下拉选项列表(旧:/club/province(city)(town))")
- @ApiImplicitParams({
- @ApiImplicitParam(required = false, name = "type", value = "选项类型:0省(默认),1市,2区"),
- @ApiImplicitParam(required = false, name = "parentId", value = "父级地址Id")
- })
- @GetMapping("/select")
- public ResponseJson<List<AddressSelectVo>> getSelectAddress(Integer type, Integer parentId) {
- if (null == type) {
- type = 0;
- } else {
- if (null == parentId) {
- return ResponseJson.error("父级地址Id不能为空!", null);
- }
- }
- return addressService.getSelectAddress(type, parentId);
- }
- /**
- * 所有地址下拉完整数据
- */
- @ApiOperation("所有地址完整数据(旧:/club/address)")
- @GetMapping("/select/all")
- public ResponseJson<List<AddressSelectVo>> getAllSelectAddress() {
- return addressService.getAllSelectAddress();
- }
- }
|