package cn.flightfeather.supervision.lightshare.web
|
|
import cn.flightfeather.supervision.domain.entity.OnLineQuestion
|
import cn.flightfeather.supervision.lightshare.service.OnLineQuestionService
|
import io.swagger.annotations.Api
|
import io.swagger.annotations.ApiOperation
|
import io.swagger.annotations.ApiParam
|
import org.springframework.web.bind.annotation.*
|
|
@Api(tags = ["在线咨询API接口"])
|
@RestController
|
@RequestMapping("/consultation")
|
class ConsultationController(val onLineQuestionService: OnLineQuestionService) {
|
|
@ApiOperation(value = "提出咨询问题")
|
@PostMapping("/add/{userId}")
|
fun add(
|
@ApiParam(value = "用户id") @PathVariable userId: String,
|
@ApiParam(value = "咨询问题") @RequestBody questions: List<OnLineQuestion>
|
) = onLineQuestionService.addQuestions(userId, questions)
|
|
@ApiOperation(value = "根据关键字搜索法律法规")
|
@GetMapping("/search/law")
|
fun searchLaw(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
@ApiParam(value = "关键字") @RequestParam keyword: String,
|
@ApiParam(value = "搜索结果的类型", required = false) @RequestParam type: Byte?,
|
@ApiParam(value = "页码") @RequestParam page: Int,
|
@ApiParam(value = "单页数据量") @RequestParam perPage: Int,
|
) = onLineQuestionService.searchLaw(userId, keyword, type, page, perPage)
|
|
@ApiOperation(value = "获取热门法律法规")
|
@GetMapping("/topic/law")
|
fun getTopicLaw(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
) = onLineQuestionService.getTopicLaw(userId)
|
|
@ApiOperation(value = "获取热门法律法规条目")
|
@GetMapping("/topic/item")
|
fun getTopicMgtItems(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
) = onLineQuestionService.getTopicMgtItems(userId)
|
|
@ApiOperation(value = "获取热门问答")
|
@GetMapping("/topic/qa")
|
fun getTopicQA(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
) = onLineQuestionService.getTopicQA(userId)
|
|
@ApiOperation(value = "获取热门案例")
|
@GetMapping("/topic/case")
|
fun getTopicCase(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
) = onLineQuestionService.getTopicCase(userId)
|
|
@ApiOperation(value = "获取法律法规文件")
|
@GetMapping("/law/file")
|
fun getMgtFile(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
@ApiParam(value = "文件id") @RequestParam fileId: String,
|
) = onLineQuestionService.getMgtFile(userId, fileId)
|
|
@ApiOperation(value = "获取法律法规条目")
|
@GetMapping("/law/item")
|
fun getMgtItem(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
@ApiParam(value = "条目id") @RequestParam itemId: String,
|
) = onLineQuestionService.getMgtItem(userId, itemId)
|
|
@ApiOperation(value = "获取问题")
|
@GetMapping("/law/question")
|
fun getQuestion(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
@ApiParam(value = "问题id") @RequestParam qId: String,
|
) = onLineQuestionService.getQuestion(userId, qId)
|
|
@ApiOperation(value = "获取答案")
|
@GetMapping("/law/answer")
|
fun getAnswers(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
@ApiParam(value = "问题id") @RequestParam qId: String,
|
) = onLineQuestionService.getAnswers(userId, qId)
|
|
@ApiOperation(value = "获取案例")
|
@GetMapping("/law/case")
|
fun getCase(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
@ApiParam(value = "案例id") @RequestParam caseId: String,
|
) = onLineQuestionService.getCase(userId, caseId)
|
|
@ApiOperation(value = "获取问题")
|
@GetMapping("/question/type")
|
fun getQuestionsByType(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
@ApiParam(value = "要素大类", required = false) @RequestParam kind: Byte?,
|
@ApiParam(value = "要素小类", required = false) @RequestParam subKind: Byte?,
|
@ApiParam(value = "页码") @RequestParam page: Int,
|
@ApiParam(value = "单页数据量") @RequestParam perPage: Int,
|
) = onLineQuestionService.getQuestionsByType(userId, kind, subKind, page, perPage)
|
|
@ApiOperation(value = "获取环保要素大类")
|
@GetMapping("/elementtype")
|
fun getEnElementTypes(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
) = onLineQuestionService.getEnElementTypes(userId)
|
|
@ApiOperation(value = "获取环保要素小类")
|
@GetMapping("/elementsubtype")
|
fun getEnElementSubTypes(
|
@ApiParam(value = "用户id") @RequestParam userId: String,
|
) = onLineQuestionService.getEnElementSubTypes(userId)
|
}
|