riku
2021-09-26 7919d4bab9e4d787b5a8d5dd6c9d99d22e394ca7
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
package cn.flightfeather.supervision.lightshare.web
 
import cn.flightfeather.supervision.lightshare.service.CommitmentService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.*
import org.springframework.web.multipart.MultipartFile
import javax.servlet.http.HttpServletResponse
 
/**
 * @author riku
 * Date: 2020/9/27
 */
@Api(tags = ["环境信用承诺API接口"])
@RestController
@RequestMapping("/commitment")
class CommitmentController(val commitmentService: CommitmentService) {
 
    @ApiOperation(value = "获取用户承诺书")
    @GetMapping("/letter")
    fun getLetterOfCommitment(
            @RequestParam("userId") userId: String,
            @RequestParam("page") page: Int,
            @RequestParam("per_page") perPage: Int,
            response: HttpServletResponse
    ) = commitmentService.getLetterOfCommitment(userId, page, perPage, response)
 
    @PostMapping("/letter/upload")
    fun uploadLetterOfCommitment(
            @RequestParam userId: String,
            @RequestParam("params") commitmentVoList: String,
            @RequestPart("images") files: Array<MultipartFile>
    ) = commitmentService.uploadLetterOfCommitment(userId, commitmentVoList, files)
}