@@ -0,0 +1,2914 @@
+package asia.gkc.vneedu.controller.api.v1_0;%0A%0Aimport asia.gkc.vneedu.authorization.annotation.ActiveUser;%0Aimport asia.gkc.vneedu.authorization.annotation.RequireLogin;%0Aimport asia.gkc.vneedu.common.QueryCondition;%0Aimport asia.gkc.vneedu.common.ResultModel;%0Aimport asia.gkc.vneedu.common.ResultStatus;%0Aimport asia.gkc.vneedu.controller.core.BaseController;%0Aimport asia.gkc.vneedu.model.Order;%0Aimport asia.gkc.vneedu.model.User;%0Aimport com.github.pagehelper.PageInfo;%0Aimport com.qiniu.util.StringMap;%0Aimport org.springframework.web.bind.annotation.*;%0A%0Aimport java.util.List;%0A%0A/**%0A * File Name: OrderController.java%0A * Function:%0A *%0A * @author jakes.%0A * @version 1.0%0A * @since 5/10/16 7:50 PM%0A */%0A@RestController%0A@RequestMapping(value = %22/api/v1.0%22)%0Apublic class OrderController extends BaseController %7B%0A    @RequestMapping(value = %22/order%22, method = RequestMethod.POST)%0A    @RequireLogin%0A    public ResultModel addNewOrder(@RequestParam(value = %22rid%22) String reqId, @ActiveUser User user) %7B%0A        if (user == null)%0A            return ResultModel.ERROR(ResultStatus.AUTHORIZATION_TOKEN_ERROR);%0A%0A        if (!orderService.createOrderByReqId(reqId, user.getId()))%0A            return ResultModel.ERROR(ResultStatus.ERROR_IN_SAVING);%0A        return ResultModel.OK();%0A    %7D%0A%0A    @RequestMapping(value = %22/orders/%7Buid%7D%22, method = RequestMethod.GET)%0A    @RequireLogin%0A    public ResultModel getOrders(@PathVariable(%22uid%22) String uid,%0A                                 @RequestParam(value = %22page%22, defaultValue = %221%22) int page,%0A                                 @RequestParam(value = %22exclude%22, defaultValue = %22%22) String exclude,%0A                                 @RequestParam(value = %22expand%22, defaultValue = %22%22) String expand,%0A                                 @RequestParam(value = %22limit%22, defaultValue = %2210%22) int limit,%0A                                 @RequestParam(value = %22withremoved%22, defaultValue = %220%22) int withRemoved,%0A                                 @RequestParam(value = %22status%22, defaultValue = %22-2%22) int status,%0A                                 @ActiveUser User user) %7B%0A%0A        if (user == null)%0A            return ResultModel.ERROR(ResultStatus.AUTHORIZATION_TOKEN_ERROR);%0A%0A        if (!user.getId().equals(uid))%0A            return ResultModel.ERROR(ResultStatus.PERMISSION_DENIED);%0A%0A        List%3COrder%3E orderList = orderService.getOrdersByUserId(uid, page, limit, status, withRemoved);%0A%0A        PageInfo pageInfo = new PageInfo%3C%3E(orderList);%0A%0A        return ResultModel.SUCCESS(new StringMap()%0A                .put(%22requirements%22,%0A                        orderService.queryProcess(orderList, new QueryCondition(exclude, expand)))%0A                .put(%22page%22, new StringMap()%0A                        .put(%22page%22, page)%0A                        .put(%22limit%22, pageInfo.getSize())%0A                        .put(%22max_pages%22, pageInfo.getPages())%0A                        .map())%0A                .map());%0A    %7D%0A%7D%0A

add order creator and order list of user apis