package com.inzy.wsmock

import com.alibaba.fastjson2.JSON
import com.inzy.wsmock.bean.LoginSuccBean
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RestController

@RestController
class LoginController {

    /**
     * 登录
     */
    @PostMapping("api/perm/admin/auth/passLogin")
    fun findDrFence(@RequestBody any: Any): LoginSuccBean {
        val json ="{\"code\":1,\"msg\":\"操作成功\",\"result\":{\"token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjNzNkNzA4M2I1YjU0OWI0OTBiZWZlMGEyMmVlM2I3OSIsImNyZWF0ZVRpbWUiOjE3NjkwNzA4OTQ1NDYsInVzZXJUeXBlIjoxLCJzb3VyY2UiOjAsInB3ZEV4cGlyZWQiOmZhbHNlLCJ1c2VybmFtZSI6ImhtaSJ9.F5Vfef1DX_H2JoNo-5zUPzIP5geXzpnj6TYOCjpSunA\",\"username\":\"HMI\",\"loginTime\":1769070894547,\"expire\":1440,\"returnUri\":null,\"pwdExpiredFlag\":false,\"tenantId\":1000000001},\"success\":true}"
        val loginSuccBean = JSON.parseObject(json, LoginSuccBean::class.java)
        return loginSuccBean
    }

}