mall: 订单中心新增运费模板功能

This commit is contained in:
jason
2023-05-21 23:35:07 +08:00
parent e942b52a67
commit 01a67289a9
24 changed files with 867 additions and 8 deletions

View File

@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -28,10 +29,10 @@ public class AreaController {
@GetMapping("/tree")
@Operation(summary = "获得地区树")
public CommonResult<List<AreaNodeRespVO>> getAreaTree() {
Area area = AreaUtils.getArea(Area.ID_CHINA);
Assert.notNull(area, "获取不到中国");
return success(AreaConvert.INSTANCE.convertList(area.getChildren()));
public CommonResult<List<AreaNodeRespVO>> getAreaTree(Integer id) {
Area area = AreaUtils.getArea(id);
Assert.notNull(area, String.format("获取不到 id : %d的区域", id));
return success(AreaConvert.INSTANCE.convertList(Arrays.asList(area)));
}
@GetMapping("/get-by-ip")