| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.service.business.AreasService; |
| | | import com.doumee.service.business.BannerService; |
| | | import com.doumee.service.business.CategoryService; |
| | | import com.doumee.service.business.OrdersService; |
| | | 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.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; |
| | | |
| | | @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)); |
| | | } |
| | | |
| | | @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)); |
| | | } |
| | | |
| | | |
| | | } |