Request的不同請求方式處理


    @ApiOperation(value = "車輛型號派生條件查詢", notes = "車輛型號派生條件查詢")
    @RequestMapping(value = "/queryVehicleModel", method = RequestMethod.GET)
    public Response queryVehicleModel(VehicleModelParameter parameter) {
        return ResponseHelper.createSuccessResponse(basicVehicleInformationService.queryVehicleModel(parameter));
    }
    let vehicleModelParam = { brandId: this.formData.brandName, id: this.formData.derive, modelParentId: this.formData.carModel };

                this.$get(consts.VSP_API_CONTEXT + '/portal/basicVehicleInformation/queryVehicleModel', vehicleModelParam, data => {
                    this.deriveTableData = data.responseBody;
                    this.mainLoading = false;
                }, { isSuccessPrompt: false })
    
    
    
                

    @ApiOperation(value = "車型派生新增", notes = "車型派生新增")
    @RequestMapping(value = "/vehicleModel", method = RequestMethod.POST)
    public Response addVehicleModel(@RequestBody VehicleModelParameter parameter, HttpServletRequest request) {
        return ResponseHelper.createResponse(response.getCode(), response.getDescription());
    }
    let data = {};
                this.$post( consts.VSP_API_CONTEXT + '/portal/basicInformationEquipment/deviceType/list/', data, (d) => {
                    this.deviceTypes = d.responseBody;
                }, { isSuccessPrompt: false })

    @ApiOperation(value = "派生刪除", notes = "派生刪除")
    @RequestMapping(value = "/vehicleModel/{id}", method = RequestMethod.DELETE)
    public Response delVehicleModel(@PathVariable("id") Integer id, HttpServletRequest request) {
        return ResponseHelper.createResponse(response.getCode(), response.getDescription());
    }
    this.$confirm('刪除後將無法恢復,是否確認刪除?', '提示', {
                        confirmButtonText: '確定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        this.$delete( consts.VSP_API_CONTEXT + '/portal/basicVehicleInformation/vehicleModel/' + this.rowDeriveModel.id, {}, (d) => {
                            if(d.code != '000000'){
                                this.$message({ type: 'error', message: d.description, showClose: true });
                                return false;
                            }else{
                                // this.handleCurrentChange();
                                this.handleCurrentChange();
                                this.getDeviceTypes();
                                this.$message({ type: 'success', message: '刪除成功', showClose: true });
                            }
                        }, { isSuccessPrompt: false })
                    }).catch(() => {
                    })
    

    @ApiOperation(value = "派生修改", notes = "派生修改")
    @RequestMapping(value = "/vehicleModel", method = RequestMethod.PUT)
    public Response updateVehicleModel(@RequestBody VehicleModelParameter parameter, HttpServletRequest request) {
        return ResponseHelper.createResponse(response.getCode(), response.getDescription());
    }
    let data = { vehicleModel: remoteControl.name,
                            modelParentId: remoteControl.carModel,
                            modelCode: remoteControl.code,
                            id: remoteControl.id };
                        this.$put( consts.VSP_API_CONTEXT + '/portal/basicVehicleInformation/vehicleModel', data, (d) => {
                            if(d.code != '000000'){
                                this.$message({ type: 'error', message: d.description, showClose: true });
                                return false;
                            }else{
                                this.updateDeriveUpdateFormVisible = false;
                                this.handleCurrentChange();
                                // this.getDeviceTypes();
                                this.$message({ type: 'success', message: '修改成功', showClose: true });
                            }
                        }, { isLoading: true, isSuccessPrompt: false })


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章