package com.jwipc.tender.controller.pc;

import com.jwipc.tender.constant.ModuleConst;
import com.jwipc.tender.dto.TenderTypeBaseDTO;
import com.jwipc.tender.logic.TenderTypeLogic;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;

import java.util.List;

/**
 * <p>招标类型接口</p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@RestController
@RequiredArgsConstructor
@Slf4j
@RequestMapping(ModuleConst.MODULE_ROOT + "/type/rest")
public class TenderTypeRestController {
    private final TenderTypeLogic tenderTypeLogic;

    /**
     * <p>查询所有招标类型</p>
     *
     * @return 招标类型列表
     */
    @GetMapping("listAll")
    public ResponseEntity listAll() {
        List<TenderTypeBaseDTO> types = tenderTypeLogic.getListAll();
        return ResponseEntity.ok(types);
    }
}
