package com.fjhx.controller.logistics;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springblade.core.tool.api.R;
import com.fjhx.entity.logistics.LogisticsDetails;
import com.fjhx.params.logistics.LogisticsDetailsVo;
import com.fjhx.service.logistics.LogisticsDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.Map;

/**
 * <p>
 * 物流明细 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2022-11-30
 */
@RestController
@RequestMapping("/logisticsDetails")
public class LogisticsDetailsController {

    @Autowired
    private LogisticsDetailsService logisticsDetailsService;

    @PostMapping("/page")
    public R page(@RequestBody Map<String, Object> condition){
        Page<LogisticsDetails> result = logisticsDetailsService.getPage(condition);
        return R.success(result);
    }

    @PostMapping("/add")
    public R add(@RequestBody LogisticsDetailsVo logisticsDetailsVo){
        logisticsDetailsService.add(logisticsDetailsVo);
        return R.success();
    }

    @PostMapping("/edit")
    public R edit(@RequestBody LogisticsDetailsVo logisticsDetailsVo){
        logisticsDetailsService.edit(logisticsDetailsVo);
        return R.success();
    }

    @PostMapping("/delete")
    public R delete(@RequestBody LogisticsDetailsVo logisticsDetailsVo){
        logisticsDetailsService.delete(logisticsDetailsVo);
        return R.success();
    }

}

