package com.weather.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.weather.entity.WeatherProductType;
import com.weather.service.IWeatherProductTypeService;
import com.weather.vo.ApiResult;
import io.swagger.annotations.ApiOperation;
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;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author : fengyuhao
 * @since 2021-02-02
 */
@RestController
@RequestMapping("/product/type")
public class WeatherProductTypeController {

    @Autowired

    IWeatherProductTypeService typeService;

    @GetMapping("list")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "农气服务类型", response = WeatherProductType.class)

    public ApiResult list() {
        QueryWrapper<WeatherProductType>wrapper=new QueryWrapper<>();

        wrapper.lambda().orderByAsc(WeatherProductType::getProductTypeId);
        List<WeatherProductType> list = typeService.list();
        return ApiResult.successList(list, WeatherProductType.class);
    }


}
