初始
This commit is contained in:
39
api/pilot/manage/login.go
Normal file
39
api/pilot/manage/login.go
Normal file
@ -0,0 +1,39 @@
|
||||
package manage
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type LOGIN struct {
|
||||
}
|
||||
type LoginReq struct {
|
||||
g.Meta `path:"login" summary:"pilot登录" method:"post" tags:"无人机遥控器"`
|
||||
|
||||
Username string `json:"username" v:"required"`
|
||||
Password string `json:"password" v:"required"`
|
||||
//Flag int `json:"flag" v:"required"`
|
||||
}
|
||||
type LoginRes struct {
|
||||
Username string `json:"username"`
|
||||
UserId string `json:"user_id"`
|
||||
WorkspaceId string `json:"workspace_id"`
|
||||
UserType int `json:"user_type"`
|
||||
MqttUsername string `json:"mqtt_username"`
|
||||
MqttPassword string `json:"mqtt_password"`
|
||||
AccessToken string `json:"access_token"`
|
||||
MqttAddr string `json:"mqtt_addr"`
|
||||
}
|
||||
|
||||
func (receiver *LOGIN) Login(ctx context.Context, req *LoginReq) (res *LoginRes, err error) {
|
||||
res = &LoginRes{}
|
||||
res.Username = "pilot"
|
||||
res.UserId = "be7c6c3d-afe9-4be4-b9eb-c55066c0914e"
|
||||
res.WorkspaceId = "e3dea0f5-37f2-4d79-ae58-490af3228069"
|
||||
res.UserType = 2
|
||||
res.MqttUsername = "pilot"
|
||||
res.MqttPassword = "pilot123"
|
||||
res.AccessToken = "abc"
|
||||
res.MqttAddr = "tcp://jl.yj-3d.com:1883"
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user