道路线索应急巡查系统服务后台
feiyu02
2025-04-25 79bd8ea222cc3518ec91dce3dfb30fcf387cf96d
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
package com.flightfeather.grid.web
 
import com.flightfeather.grid.service.ClueQuestionService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
import org.springframework.web.multipart.MultipartFile
 
@Api(tags = ["ClueQuestionController"], description = "线索问题API接口")
@RestController
@RequestMapping("/clue/question")
class ClueQuestionController(val clueQuestionService: ClueQuestionService) {
 
    @ApiOperation("上报线索问题及图片")
    @PostMapping("/upload")
    fun uploadQuestion(
        @ApiParam("线索问题json") @RequestParam("question") question: String,
        @ApiParam("线索图片") @RequestPart("images", required = false) files: Array<MultipartFile>?,
    ) = resPack { clueQuestionService.uploadQuestionAndImage(question, files) }
 
    @ApiOperation("更新线索问题及图片")
    @PostMapping("/update")
    fun updateQuestion(
        @ApiParam("线索问题json") @RequestParam("question") question: String,
        @ApiParam("删除的图片路径数组") @RequestParam("deleteImg") deleteImg: String,
        @ApiParam("新增的线索图片") @RequestPart("images") files: Array<MultipartFile>,
    ) = resPack { clueQuestionService.updateQuestionAndImage(question, deleteImg, files) }
 
    @ApiOperation("删除线索问题及图片")
    @DeleteMapping("")
    fun deleteQuestion(
        @ApiParam("线索问题Id") @RequestParam questionId: String,
    ) = resPack { clueQuestionService.deleteQuestion(questionId) }
 
    @ApiOperation("获取线索问题")
    @GetMapping("/fetch")
    fun getClueQuestion(
        @ApiParam("线索id") @RequestParam clueId: String,
        @ApiParam("是否为线索") @RequestParam(required = false) internal: Boolean?,
    ) = resPack { clueQuestionService.getClueQuestion(clueId, internal) }
 
    @ApiOperation("推送线索问题及图片至第三方")
    @PostMapping("/push")
    fun pushQuestion(
        @ApiParam("问题id列表") @RequestBody(required = false) questionIdList: List<String>?,
    ) = resPack { clueQuestionService.pushQuestion(questionIdList) }
}