xuhy
2024-08-07 abcc4b90f2dfe74b668700631173a5b0b3e1496b
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
package com.ruoyi.order.controller;
 
 
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.order.api.query.TOrderAppealQuery;
import com.ruoyi.order.api.vo.TOrderAppealVO;
import com.ruoyi.order.service.TOrderAppealService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2024-08-07
 */
@RestController
@RequestMapping("/t-order-appeal")
public class TOrderAppealController {
 
    private final TOrderAppealService orderAppealService;
    private final TokenService tokenService;
 
    @Autowired
    public TOrderAppealController(TOrderAppealService orderAppealService, TokenService tokenService) {
        this.orderAppealService = orderAppealService;
        this.tokenService = tokenService;
    }
 
    /**
     * 查询订单申诉列表
     */
    @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉分页列表")
    @PostMapping(value = "/pageList")
    public AjaxResult<PageInfo<TOrderAppealVO>> pageList(@RequestBody TOrderAppealQuery query) {
        // TODO 用户id 获取小程序当前登录用户id
        Long userId = tokenService.getLoginUser().getUserid();
        query.setAppUserId(userId);
        return AjaxResult.ok(orderAppealService.pageList(query));
    }
 
    /**
     * 查询订单申诉详情
     */
    @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉详情")
    @GetMapping(value = "/getDetailById")
    public AjaxResult<TOrderAppealVO> getDetailById(@RequestParam Integer id) {
        return AjaxResult.ok(orderAppealService.getDetailById(id));
    }
 
 
 
}