|
|
|
@ -0,0 +1,45 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* https://www.mall4j.com/
|
|
|
|
|
*
|
|
|
|
|
* 未经允许,不可做商业用途!
|
|
|
|
|
*
|
|
|
|
|
* 版权所有,侵权必究!
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package com.yami.shop.admin.controller; // 定义类所在的包
|
|
|
|
|
|
|
|
|
|
import java.util.List; // 引入Java的List接口
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; // 引入Spring的@Autowired注解
|
|
|
|
|
import com.yami.shop.common.response.ServerResponseEntity; // 引入服务器响应实体类
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; // 引入Spring的@GetMapping注解
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; // 引入Spring的@RequestMapping注解
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController; // 引入Spring的@RestController注解
|
|
|
|
|
|
|
|
|
|
import com.yami.shop.bean.model.Delivery; // 引入配送模型
|
|
|
|
|
import com.yami.shop.service.DeliveryService; // 引入配送服务类
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DeliveryController类,用于管理配送信息。
|
|
|
|
|
* 该类包含一个分页获取配送信息的方法。
|
|
|
|
|
* @作者 lgh on 2018/11/26.
|
|
|
|
|
*/
|
|
|
|
|
@RestController // 标注这是一个控制器类,并且其返回结果直接写入HTTP响应体中,而不是视图名称
|
|
|
|
|
@RequestMapping("/admin/delivery") // 定义请求路径的根地址为/admin/delivery
|
|
|
|
|
public class DeliveryController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private DeliveryService deliveryService; // 自动注入配送服务类
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页获取配送信息
|
|
|
|
|
* @return 服务器响应实体,包含配送信息列表
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public ServerResponseEntity<List<Delivery>> page() {
|
|
|
|
|
List<Delivery> list = deliveryService.list(); // 获取所有配送信息
|
|
|
|
|
return ServerResponseEntity.success(list); // 返回配送信息列表
|
|
|
|
|
}
|
|
|
|
|
}
|