package com.jwipc.supplier.controller.pc;

import com.jwipc.page.PageView;
import com.jwipc.supplier.constant.ModuleConst;
import com.jwipc.supplier.logic.CustomerLogic;
import com.jwipc.supplier.model.query.CustomerInfoQuery;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@RestController
@RequestMapping(ModuleConst.MODULE_ROOT + "/customer/rest")
@RequiredArgsConstructor
public class CustomerRestController {
    private final CustomerLogic customerLogic;

    @GetMapping("list")
    public PageView list(CustomerInfoQuery query) {
        return customerLogic.list(query);
    }

    @GetMapping("listAll")
    public ResponseEntity listAll(CustomerInfoQuery query) {
        return ResponseEntity.ok(customerLogic.listAll(query));
    }
}
