package vip.xiaonuo.write.controller;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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 vip.xiaonuo.common.pojo.CommonResult;
import vip.xiaonuo.warehouse.entity.WarehouseAge;
import vip.xiaonuo.warehouse.param.WarehouseAgeParam;
import vip.xiaonuo.warehouse.service.IWarehouseAgeService;
import vip.xiaonuo.write.entity.vo.WriteTravelPageVo;
import vip.xiaonuo.write.param.WriteTravelAddParam;
import vip.xiaonuo.write.param.WriteTravelPageParam;
import vip.xiaonuo.write.service.IWriteTravelLogService;

import java.util.List;

/**
 * <p>
 * 出差日志 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-12-25
 */
@RestController
@Api(tags = "出差日志")
@ApiSupport(author = "wang", order = 1)
@Validated
public class WriteTravelLogController {

    @Autowired
    private IWriteTravelLogService logService;

    @ApiOperationSupport(order = 1)
    @ApiOperation("出差日志添加")
    @PostMapping("/write-travel-log/add")
    public CommonResult listAge(@RequestBody WriteTravelAddParam addParam) {
        return logService.add(addParam);
    }

    @ApiOperationSupport(order = 2)
    @ApiOperation("出差日志列表")
    @PostMapping("/write-travel-log/list")
    public CommonResult<List<WriteTravelPageVo>> list(@RequestBody WriteTravelPageParam pageParam) {
        return CommonResult.data(logService.list(pageParam));
    }
}
