package com.ghy.web.controller.order;

import com.ghy.common.core.domain.AjaxResult;
import com.ghy.order.domain.OrderBehavior;
import com.ghy.order.service.OrderBehaviorService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("order/behavior")
public class OrderBehaviorController {

    private static final String PREFIX = "order/behavior";

    @Resource
    private OrderBehaviorService service;

    @ResponseBody
    @GetMapping("list")
    public AjaxResult list(OrderBehavior behavior) {
        List<OrderBehavior> list = service.select(behavior);
        return AjaxResult.success(list);
    }

    @GetMapping
    public String listPage() {
        return PREFIX + "/list";
    }

}
