diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/CarTypeController.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/CarTypeController.java index a3cbd9a..743a608 100644 --- a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/CarTypeController.java +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/controller/CarTypeController.java @@ -2,12 +2,15 @@ package com.muyu.controller; import com.muyu.common.core.domain.Result; import com.muyu.domain.CarType; +import com.muyu.domain.resp.CarTypeResp; import com.muyu.service.CarTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequestMapping("/carType") @@ -22,5 +25,10 @@ public class CarTypeController { } + @GetMapping("/selectCarTypeRespList") + public Result selectCarTypeRespList() { + return Result.success(carTypeService.selectCarTypeRespList()); + } + } diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/resp/CarTypeResp.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/resp/CarTypeResp.java new file mode 100644 index 0000000..cf73cec --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/domain/resp/CarTypeResp.java @@ -0,0 +1,19 @@ +package com.muyu.domain.resp; + + +import com.muyu.common.core.annotation.Excel; +import com.muyu.domain.CarType; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class CarTypeResp extends CarType { + /** 报文模版id */ + @Excel(name = "报文模版名称") + private String templateName; +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/CarTypeMapper.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/CarTypeMapper.java index 46c09df..dff34d2 100644 --- a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/CarTypeMapper.java +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/mapper/CarTypeMapper.java @@ -2,8 +2,12 @@ package com.muyu.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.muyu.domain.CarType; +import com.muyu.domain.resp.CarTypeResp; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + public interface CarTypeMapper extends BaseMapper { + List selectCarTypeRespList(); } diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/CarTypeService.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/CarTypeService.java index 718d461..a1081c7 100644 --- a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/CarTypeService.java +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/CarTypeService.java @@ -2,6 +2,7 @@ package com.muyu.service; import com.baomidou.mybatisplus.extension.service.IService; import com.muyu.domain.CarType; +import com.muyu.domain.resp.CarTypeResp; import com.muyu.mapper.CarTypeMapper; import java.util.List; @@ -10,4 +11,6 @@ import java.util.List; public interface CarTypeService extends IService { List selectCarTypeList(); + List selectCarTypeRespList(); + } diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/CarTypeServiceImpl.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/CarTypeServiceImpl.java index 3648d52..b7c48de 100644 --- a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/CarTypeServiceImpl.java +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/service/impl/CarTypeServiceImpl.java @@ -3,6 +3,7 @@ package com.muyu.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.muyu.domain.CarType; +import com.muyu.domain.resp.CarTypeResp; import com.muyu.mapper.CarTypeMapper; import com.muyu.service.CarTypeService; import org.springframework.beans.factory.annotation.Autowired; @@ -19,4 +20,9 @@ private CarTypeMapper carTypeMapper; QueryWrapper carTypeQueryWrapper = new QueryWrapper<>(); return carTypeMapper.selectList(carTypeQueryWrapper); } + + @Override + public List selectCarTypeRespList() { + return carTypeMapper.selectCarTypeRespList(); + } } diff --git a/cloud-modules/cloud-modules-car/src/main/resources/mapper/CarTypeMapper.xml b/cloud-modules/cloud-modules-car/src/main/resources/mapper/CarTypeMapper.xml new file mode 100644 index 0000000..f169743 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/mapper/CarTypeMapper.xml @@ -0,0 +1,15 @@ + + + + + +