基于mall4j产品的二开项目后端
lee
2024-12-18 efdb99f8cecc4afb592afad79c761081d5d5cf22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
 * 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());
        }
    }
 
}