package com.bonus.sharedstation.app.controller;


import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.sharedstation.app.dto.WashClothingOrderDTO;
import com.bonus.sharedstation.app.entity.WashClothingOrder;
import com.bonus.sharedstation.app.service.WashClothingOrderService;
import com.bonus.sharedstation.web.dto.WashClothingPriceDTO;
import com.bonus.sharedstation.web.service.IWashClothingPriceWebService;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Tag(name = "app-洗衣服务")
@RestController
@RequestMapping("/information/wash/app")
public class WashclothingController {

    @Resource
    private WashClothingOrderService service;

    @Resource
    private IWashClothingPriceWebService washClothingPriceWebService;


    @PostMapping(value = "/add", produces = "application/json; charset=utf-8")
    @ApiOperation("洗衣服务-新增")
    public AjaxResult add(@RequestBody WashClothingOrderDTO dto) {
        return service.add(dto);
    }


    /**
     * 分页查询
     *
     * @param dto
     * @return
     */
    @ApiOperation("洗衣服务-查询全部数据APP")
    @PostMapping("/getListApp")
    public AjaxResult getList(@RequestBody WashClothingOrderDTO dto) {
        return service.getListPageApp(dto);

    }
    /**
     * 分页查询
     *
     * @param dto
     * @return
     */
    @ApiOperation("洗衣服务-查询全部数据WEB")
    @PostMapping("/getListWeb")
    public AjaxResult getListWeb(@RequestBody WashClothingOrderDTO dto) {
        return service.getListWeb(dto);

    }


    /**
     * 详情
     *
     * @param
     * @return
     */
    @PostMapping(value = "selectById", produces = "application/json; charset=utf-8")
    @ApiOperation("洗衣服务-查询详情")
    public AjaxResult selectInfoById(@RequestBody WashClothingOrder dto) {
        return service.selectInfoById(dto);
    }

    /**
     * 分页查询
     *
     * @param dto
     * @return
     */
    @ApiOperation("洗衣服务-查询数据")
    @PostMapping("/getList")
    public AjaxResult getList(@RequestBody WashClothingPriceDTO dto) {
        return service.getListPage(dto);
    }


    /**
     * 分页查询订单
     *
     * @param dto
     * @return
     */
    @ApiOperation("洗衣服务-查询卖家")
    @PostMapping("/getListSeller")
    public AjaxResult getListSeller(@RequestBody WashClothingOrderDTO dto) {
        return washClothingPriceWebService.getListWeb(dto);
    }


}
