MrShi
9 小时以前 e50954f0708ecbbc672352102ae3b24279d40cc1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package com.doumee.api.web;
 
import com.doumee.core.annotation.LoginRequired;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.dao.business.model.Areas;
import com.doumee.dao.business.model.Banner;
import com.doumee.dao.business.model.Category;
import com.doumee.dao.dto.CalculateLocalPriceDTO;
import com.doumee.dao.dto.CalculateRemotePriceDTO;
import com.doumee.dao.vo.AccountResponse;
import com.doumee.dao.vo.PriceCalculateVO;
import com.doumee.dao.vo.PlatformAboutVO;
import com.doumee.service.business.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.List;
 
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2025/7/15 15:49
 */
@Api(tags = "配置类接口")
@Trace(exclude = true)
@RestController
@RequestMapping("/web/config")
@Slf4j
public class ConfigApi extends ApiController{
 
    @Autowired
    private CategoryService categoryService;
 
    @Autowired
    private AreasService areasService;
 
    @Autowired
    private BannerService bannerService;
 
    @Autowired
    private OrdersService ordersService;
 
    @Autowired
    private MemberService memberService;
 
    @ApiOperation(value = "获取分类列表", notes = "小程序端")
    @GetMapping("/getCategoryList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "type", value = "类型:1=车辆类型;2=物品分类;3=物品等级;4=物品尺寸;", required = true)
    })
    public ApiResponse<List<Category>> getCategoryList(@RequestParam Integer type) {
        return  ApiResponse.success("操作成功",categoryService.getCategoryList(type));
    }
 
    @ApiOperation(value = "获取开放城市列表", notes = "返回已开放城市,含首字母,按首字母排序")
    @GetMapping("/getOpenCityList")
    public ApiResponse<List<Areas>> getOpenCityList() {
        return ApiResponse.success("操作成功", areasService.getOpenCityList());
    }
 
    @ApiOperation(value = "获取轮播图列表", notes = "根据位置返回轮播图,含图片全路径")
    @GetMapping("/getBannerList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "position", value = "位置:0=会员端首页轮播;1=司机APP引导页;", required = true)
    })
    public ApiResponse<List<Banner>> getBannerList(@RequestParam Integer position) {
        return ApiResponse.success("操作成功", bannerService.findListByPosition(position));
    }
 
    @ApiOperation(value = "获取城市已开通物品尺寸", notes = "根据城市主键查询已开通的物品尺寸(category type=4)")
    @GetMapping("/getCitySizeList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "cityId", value = "城市主键", required = true)
    })
    public ApiResponse<List<Category>> getCitySizeList(@RequestParam Integer cityId) {
        return ApiResponse.success("操作成功", categoryService.getCitySizeList(cityId));
    }
 
 
    @ApiOperation(value = "获取系统配置", notes = "小程序端")
    @GetMapping("/getPlatformAboutUs")
    public ApiResponse<PlatformAboutVO> getPlatformAboutUs() {
        return  ApiResponse.success("查询成功",memberService.getPlatformAboutUs());
    }
 
    @LoginRequired
    @ApiOperation(value = "计算保价费用", notes = "根据报价金额计算保价费用")
    @GetMapping("/calculateInsuranceFee")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "BigDecimal", name = "declaredValue", value = "报价金额", required = true),
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true)
    })
    public ApiResponse<BigDecimal> calculateInsuranceFee(@RequestParam BigDecimal declaredValue) {
        return ApiResponse.success("操作成功", ordersService.calculateInsuranceFee(declaredValue));
    }
 
    @LoginRequired
    @ApiOperation(value = "计算就地存取预估费用", notes = "根据城市、天数、物品类型和数量计算就地存取预估费用")
    @PostMapping("/calculateLocalPrice")
    public ApiResponse<PriceCalculateVO> calculateLocalPrice(@RequestBody @Valid CalculateLocalPriceDTO dto) {
        return ApiResponse.success("操作成功", ordersService.calculateLocalPrice(dto));
    }
 
    @LoginRequired
    @ApiOperation(value = "计算异地存取预估费用", notes = "根据距离、物品类型和数量计算异地存取预估费用")
    @PostMapping("/calculateRemotePrice")
    public ApiResponse<PriceCalculateVO> calculateRemotePrice(@RequestBody @Valid CalculateRemotePriceDTO dto) {
        return ApiResponse.success("操作成功", ordersService.calculateRemotePrice(dto));
    }
 
 
 
 
 
 
 
}