|
|
@ -8,6 +8,7 @@
|
|
|
|
* 版权所有,侵权必究!
|
|
|
|
* 版权所有,侵权必究!
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 该类所属的包名,用于在项目中对类进行组织和分类管理
|
|
|
|
package com.yami.shop.admin.controller;
|
|
|
|
package com.yami.shop.admin.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -18,28 +19,35 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 引入对应的实体类,这里是Delivery类,用于表示配送相关的业务对象
|
|
|
|
import com.yami.shop.bean.model.Delivery;
|
|
|
|
import com.yami.shop.bean.model.Delivery;
|
|
|
|
|
|
|
|
// 引入配送服务层接口,用于调用具体的与配送相关的业务逻辑方法
|
|
|
|
import com.yami.shop.service.DeliveryService;
|
|
|
|
import com.yami.shop.service.DeliveryService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* DeliveryController类是一个Spring RESTful风格的控制器,用于处理后台管理系统中与配送(Delivery)相关的接口请求。
|
|
|
|
|
|
|
|
* 目前该类中主要提供了获取配送信息列表的功能,后续可根据业务需求在此类中扩展更多相关接口方法。
|
|
|
|
* @author lgh on 2018/11/26.
|
|
|
|
* @author lgh on 2018/11/26.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
|
|
|
|
// 定义该控制器类的基础请求路径,所有该类中的接口请求路径都将以此为前缀
|
|
|
|
@RequestMapping("/admin/delivery")
|
|
|
|
@RequestMapping("/admin/delivery")
|
|
|
|
public class DeliveryController {
|
|
|
|
public class DeliveryController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 通过Spring的依赖注入机制,自动注入DeliveryService的实例,以便调用其提供的业务方法
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private DeliveryService deliveryService;
|
|
|
|
private DeliveryService deliveryService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 分页获取
|
|
|
|
* 分页获取配送信息列表的接口方法。
|
|
|
|
*/
|
|
|
|
* 目前该方法只是简单地调用了DeliveryService的list方法获取所有的配送信息列表,
|
|
|
|
|
|
|
|
* 后续可根据实际需求添加分页相关逻辑,比如接收分页参数等进行分页查询处理。
|
|
|
|
|
|
|
|
* 最后将获取到的配送信息列表封装在ServerResponseEntity中返回,用于统一的接口响应格式处理。
|
|
|
|
|
|
|
|
* @return 返回包含配送信息列表的ServerResponseEntity对象,成功时其数据部分为List<Delivery>类型。
|
|
|
|
|
|
|
|
*/
|
|
|
|
@GetMapping("/list")
|
|
|
|
@GetMapping("/list")
|
|
|
|
public ServerResponseEntity<List<Delivery>> page(){
|
|
|
|
public ServerResponseEntity<List<Delivery>> page() {
|
|
|
|
|
|
|
|
List<Delivery> list = deliveryService.list();
|
|
|
|
List<Delivery> list = deliveryService.list();
|
|
|
|
return ServerResponseEntity.success(list);
|
|
|
|
return ServerResponseEntity.success(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|