parent
97fc4027de
commit
f217ba0807
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.delivery;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.trade.controller.app.delivery.vo.express.AppDeliveryExpressRespVO;
|
||||
import cn.iocoder.yudao.module.trade.convert.delivery.DeliveryExpressConvert;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
|
||||
import cn.iocoder.yudao.module.trade.service.delivery.DeliveryExpressService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "用户 App - 快递公司")
|
||||
@RestController
|
||||
@RequestMapping("/trade/delivery/express")
|
||||
@Validated
|
||||
public class AppDeliverExpressController {
|
||||
|
||||
@Resource
|
||||
private DeliveryExpressService deliveryExpressService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得快递公司列表")
|
||||
public CommonResult<List<AppDeliveryExpressRespVO>> getDeliveryExpressList() {
|
||||
List<DeliveryExpressDO> list = deliveryExpressService.getDeliveryExpressList(CommonStatusEnum.ENABLE.getStatus());
|
||||
list.sort(Comparator.comparing(DeliveryExpressDO::getSort));
|
||||
return success(DeliveryExpressConvert.INSTANCE.convertList03(list));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.delivery.vo.express;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "用户 App - 快递公司 Response VO")
|
||||
@Data
|
||||
public class AppDeliveryExpressRespVO {
|
||||
|
||||
@Schema(description = "编号", required = true, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "门店名称", required = true, example = "顺丰")
|
||||
private String name;
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue