package org.linlinjava.jz.admin.web;

import io.swagger.annotations.Api;
import org.linlinjava.jz.core.util.ResponseUtil;
import org.linlinjava.jz.db.domain.JzGoods;
import org.linlinjava.jz.db.service.JzGoodService;
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.List;

/**
 * @author fuxubing
 */
@Api(value = "Admin-Goods-Controller", description = "盒马商品")
@RestController
@RequestMapping("/admin/goods")
@Validated
public class AdminGoodsController {
    @Resource
    private JzGoodService jzGoodService;

    @GetMapping("/list")
    public Object list() {
        List<JzGoods> jzGoods = jzGoodService.query();
        return ResponseUtil.ok(jzGoods);
    }
}
