package com.bonus.sharedstation.app.controller;


import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.sharedstation.app.dto.CleaningServicesDTO;
import com.bonus.sharedstation.app.entity.CleaningServicesEntity;
import com.bonus.sharedstation.web.service.ICleaningServiceWebService;
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;
import javax.validation.Valid;

@Tag(name = "app-清洗服务")
@RestController
@RequestMapping("/information/cleaningservicesapp")
public class CleaningServicesAppController {

    @Resource
    private ICleaningServiceWebService service;

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


    @PostMapping(value = "/delete", produces = "application/json; charset=utf-8")
    @ApiOperation("清洗服务-删除")
    public AjaxResult deleteById(@RequestBody CleaningServicesEntity dto) {
        return service.delete(dto);
    }

    @ApiOperation("清洗服务-修改")
    @PostMapping("/update")
    public AjaxResult update(@RequestBody @Valid CleaningServicesEntity dto) {
        return service.updateInfoById(dto);
    }

    @ApiOperation("清洗服务-查询")
    @PostMapping("/getList")
    public AjaxResult getList(@RequestBody CleaningServicesDTO dto) {
        return service.getListPage(dto);

    }

    @ApiOperation("清洗服务-查询")
    @PostMapping("/getListPageApp")
    public AjaxResult getListPage(@RequestBody CleaningServicesDTO dto) {
        return service.getListPageApp(dto);

    }

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


}
