wangjinhao_branch
wangjinhao 9 months ago
parent 751d5ffabc
commit dde746d4d6

@ -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); // 返回配送信息列表
}
}
Loading…
Cancel
Save