/*
|
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
*
|
* https://www.mall4j.com/
|
*
|
* 未经允许,不可做商业用途!
|
*
|
* 版权所有,侵权必究!
|
*/
|
package com.yami.shop.api.controller.cdn;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.yami.shop.bean.model.*;
|
import com.yami.shop.common.response.ResponseEnum;
|
import com.yami.shop.common.response.ServerResponseEntity;
|
import com.yami.shop.common.util.PageParam;
|
import com.yami.shop.service.*;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import lombok.AllArgsConstructor;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.util.*;
|
|
/**
|
* @author LGH
|
*/
|
@RestController
|
@RequestMapping("/mars/flow")
|
@Tag(name = "寄售流水接口")
|
@AllArgsConstructor
|
public class CdnFlowController {
|
|
@Resource
|
private CdnFlowService cdnFlowService;
|
|
|
@GetMapping("/page")
|
@Operation(summary = "分页查询寄售流水列表信息")
|
public ServerResponseEntity<IPage<CdnFlow>> getCdnFlowPage(PageParam<CdnFlow> page,CdnFlow flow) {
|
IPage<CdnFlow> userInvoicePage = cdnFlowService.getCdnFlowPage(page,flow );
|
return ServerResponseEntity.success(userInvoicePage);
|
}
|
|
@GetMapping("/info/{id}")
|
@Operation(summary = "通过寄售流水id查询寄售流水信息")
|
@Parameter(name = "id", description = "寄售流水id" , required = true)
|
public ServerResponseEntity<CdnFlow> getCdnFlowById(@PathVariable("id") Long id) {
|
CdnFlow flow = cdnFlowService.getById(id);
|
return ServerResponseEntity.success(flow);
|
}
|
|
@PostMapping("/getCdnFlows")
|
@Operation(summary = "获取寄售流水信息")
|
public ServerResponseEntity<List<CdnFlow>> getCdnFlows(@RequestBody CdnFlow flow) {
|
List<CdnFlow> list = cdnFlowService.getCdnFlows(flow);
|
return ServerResponseEntity.success(list);
|
}
|
|
@PostMapping("/saveCdnFlow")
|
@Operation(summary = "新增寄售流水信息")
|
public ServerResponseEntity<String> saveCdnFlow(@RequestBody CdnFlow flow) {
|
Integer num = cdnFlowService.saveCdnFlow(flow);
|
if(num >0 ){
|
return ServerResponseEntity.success(ResponseEnum.OK.getMsg());
|
}else{
|
return ServerResponseEntity.showFailMsg(ResponseEnum.ERROR.getMsg());
|
}
|
}
|
|
@PostMapping("/updateCdnFlow")
|
@Operation(summary = "修改寄售流水信息")
|
public ServerResponseEntity<String> updateCdnFlow(@RequestBody CdnFlow flow) {
|
Integer num = cdnFlowService.updateCdnFlow(flow);
|
if(num >0 ){
|
return ServerResponseEntity.success(ResponseEnum.OK.getMsg());
|
}else{
|
return ServerResponseEntity.showFailMsg(ResponseEnum.ERROR.getMsg());
|
}
|
}
|
|
@GetMapping("/delete/{id}")
|
@Operation(summary = "通过寄售流水id查询寄售流水信息")
|
@Parameter(name = "id", description = "寄售流水id" , required = true)
|
public ServerResponseEntity<String> deleteCdnFlowById(@PathVariable("id") Long id) {
|
Integer num = cdnFlowService.deleteCdnFlow(id);
|
if(num >0 ){
|
return ServerResponseEntity.success(ResponseEnum.OK.getMsg());
|
}else{
|
return ServerResponseEntity.showFailMsg(ResponseEnum.ERROR.getMsg());
|
}
|
}
|
|
}
|