ReportController.java 2.04 KB
package com.xkl.controller.uploadsoft;

import com.wordnik.swagger.annotations.ApiImplicitParam;
import com.wordnik.swagger.annotations.ApiImplicitParams;
import com.wordnik.swagger.annotations.ApiOperation;
import com.xkl.authorization.annotation.Authorization;
import com.xkl.authorization.annotation.CurrentAdmin;
import com.xkl.domain.Admin;
import com.xkl.model.ResultModel;
import com.xkl.repository.UpSoftVersionRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.*;
import java.util.List;

/**
 * 上传报告及删除报告接口。
 */
@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private UpSoftVersionRepository upSoftVersionRepository;

    @RequestMapping(method = RequestMethod.POST)
    @Authorization
    @ApiOperation(value = "上传报告")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
    })
    public ResponseEntity<ResultModel> save(@CurrentAdmin Admin admin, @RequestParam String json_report) {

         return new ResponseEntity<>(ResultModel.ok(), HttpStatus.OK);
    }

    @RequestMapping(method = RequestMethod.DELETE)
    @Authorization
    @ApiOperation(value = "删除报告")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
    })
    public ResponseEntity<ResultModel> delete(@CurrentAdmin Admin admin, @RequestParam int report_id) {

        return new ResponseEntity<>(ResultModel.ok(), HttpStatus.OK);
    }

}