package com.tourism.webadmin.app.website.controller;

import com.tourism.common.additional.utils.UrlConvertUtils;
import com.tourism.common.core.object.ResponseResult;
import com.tourism.common.core.util.MyModelUtil;
import com.tourism.webadmin.app.website.service.TourComplaintTypeService;
import com.tourism.webadmin.back.model.TourImComplaintType;
import com.tourism.webadmin.back.model.constant.IsTrue;
import com.tourism.webadmin.back.vo.TourImComplaintTypeVo;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
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;

@Tag(name = "投诉类型管理")
@RestController
@RequestMapping("/website/tourComplaintType")
public class TourComplaintTypeController {
    @Autowired
    private TourComplaintTypeService tourComplaintTypeService;

    /**
     * 获取投诉类型列表
     * @return {@link ResponseResult }<{@link List }<{@link TourImComplaintType }>>
     */
    @GetMapping("/getTypeList")
    public ResponseResult<List<TourImComplaintTypeVo>> getTypeList() {
        List<TourImComplaintType> list = tourComplaintTypeService.lambdaQuery().eq(TourImComplaintType::getEnable, IsTrue.TRUE)
                .eq(TourImComplaintType::getDataState, 1).list();
        List<TourImComplaintTypeVo> tourImComplaintTypeVoList = MyModelUtil.copyCollectionTo(list, TourImComplaintTypeVo.class);
        return ResponseResult.success(tourImComplaintTypeVoList);
    }


}
