ReportController.java
3.03 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.xkl.controller;
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.CurrentUser;
import com.xkl.config.Constants;
import com.xkl.domain.*;
import com.xkl.model.ResultModel;
import com.xkl.repository.XklAmpReportDetailRespository;
import com.xkl.repository.XklAmpReportHealthScoreRespository;
import com.xkl.repository.XklAmpReportRespository;
import com.xkl.service.IScoreService;
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 javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.function.DoubleToIntFunction;
/**
* Created by win7 on 2016/11/20.
*/
@RestController
@RequestMapping("/report")
public class ReportController {
@Autowired
private XklAmpReportRespository xklAmpReportRespository;
@Autowired
private XklAmpReportDetailRespository xklAmpReportDetailRespository;
private XklAmpReportHealthScoreRespository xklAmpReportHealthScoreRespository;
@Autowired
private IScoreService scoreService;
@RequestMapping(value="/list",method = RequestMethod.GET)
//@Authorization
//@Sign
@ApiOperation(value = "体检报告列表查询接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
})
public ResponseEntity<ResultModel> getReportList(HttpServletRequest request, @CurrentUser User user,
@RequestParam String sign, @RequestParam long t, @RequestParam int type) {
long member_id=user.getMemberId();
List<XklAmpReportEntity> xklAmpReportEntity=xklAmpReportRespository.findByMemberId(member_id);
return new ResponseEntity<>(ResultModel.ok(xklAmpReportEntity), HttpStatus.OK);
}
@RequestMapping(value="/score",method = RequestMethod.GET)
@Authorization
//@Sign
@ApiOperation(value = "健康评分接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
})
public ResponseEntity<ResultModel> getReportScore(HttpServletRequest request, @CurrentUser User user,@RequestParam long report_id,
@RequestParam String sign, @RequestParam long t, @RequestParam int type) {
scoreService.getScore(report_id);
return new ResponseEntity<>(ResultModel.ok(), HttpStatus.OK);
}
}