Vue3 系统入门与项目实战
V : ititit111222333
`package com.imooc.controller.center;
import com.imooc.controller.base.BaseController; import com.imooc.service.CenterOrderService; import com.imooc.utils.IMOOCJSONResult; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController;
/**
-
@author mark
-
@date 2021/4/16 0016 22:33 */ @Api(value = "用户中心订单接口", tags = {"用户中心订单相关接口"}) @RestController @RequestMapping({"/center"}) public class CenterOrderController extends BaseController {
@Autowired private CenterOrderService centerOrderService;
@ApiOperation(value = "根据用户id获取用户数据", notes = "根据用户id获取用户数据", httpMethod = "GET") @GetMapping("/order/get-my-orders") public IMOOCJSONResult getMyOrders(@ApiParam(value = "用户id", name = "userId", required = true) @RequestParam(value = "userId") String userId, @ApiParam(value = "订单状态", name = "status", required = true) @RequestParam(value = "status") Integer status, @ApiParam(name = "page", value = "第几页") @RequestParam Integer page, @ApiParam(name = "pageSize", value = "该页多少页数") @RequestParam Integer pageSize) { if (null == userId) { return IMOOCJSONResult.errorMsg("用户id不能为空"); } if (null == page) { page = PAGE; }
if (null == pageSize) { pageSize = COMMON_PAGE_SIZE; } return IMOOCJSONResult.ok(centerOrderService.getMyOrders(userId, status, page, pageSize));}
} `