feiyu02
2025-09-30 6904763f0e74d9a9fa4dbc39f635d2aee39416c6
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
package cn.flightfeather.supervision.lightshare.web
 
import cn.flightfeather.supervision.domain.entity.Company
import cn.flightfeather.supervision.domain.entity.PersonalInfo
import cn.flightfeather.supervision.lightshare.service.AuthService
import cn.flightfeather.supervision.lightshare.vo.AuthSceneVo
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("/auth")
class AuthController(val authService: AuthService) {
 
    @ApiOperation(value = "企业信息认证")
    @PostMapping("/company")
    fun authCompany(
        @ApiParam("用户微信id") @RequestParam("wxUserId") wxUserId: String,
        @ApiParam("企业信息") @RequestBody company: Company,
    ) = authService.authCompany(wxUserId, company)
 
    @ApiOperation(value = "场景信息认证")
    @PostMapping("/scene")
    fun authScene(
        @ApiParam("用户微信id") @RequestParam("wxUserId") wxUserId: String,
        @ApiParam("用户场景类型编号") @RequestParam("sceneType") sceneType: Int,
        @ApiParam("场景信息") @RequestBody sceneInfo: String,
    ) = authService.authScene(wxUserId, sceneType, sceneInfo)
 
    @ApiOperation(value = "个人信息认证")
    @PostMapping("/personal")
    fun authPersonal(
        @ApiParam("用户微信id") @RequestParam("wxUserId") wxUserId: String,
        @ApiParam("个人信息") @RequestBody personalInfo: PersonalInfo
    ) = authService.authPersonal(wxUserId, personalInfo)
 
    @ApiOperation(value = "获取用户相关认证状态")
    @GetMapping("/status")
    fun authStatus(
        @ApiParam("用户微信id") @RequestParam(value = "wxUserId", required = false) wxUserId: String?,
        @ApiParam("用户场景id") @RequestParam(value = "userId", required = false) userId: String?,
    ) = authService.authStatus(wxUserId, userId)
 
    @ApiOperation(value = "获取企业相关认证状态")
    @GetMapping("/status/scene")
    fun sceneAuthStatus(
        @ApiParam("用户场景id") @RequestParam(value = "userId", required = false) userId: String?,
    ) = authService.sceneAuthStatus(userId)
}