chore: 并入 iotlcm-openapi 历史到 openapi/(原提交 3b05d5a)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-openapi/api/query/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Token(ctx context.Context, req *v1.TokenReq) (res *v1.TokenRes, err error) {
|
||||
out, err := service.QueryToken().Token(ctx, req.TokenInputApi)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res = &v1.TokenRes{TokenOutputApi: out}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) OperatorToken(ctx context.Context, req *v1.OperatorTokenReq) (res *v1.OperatorTokenRes, err error) {
|
||||
out, err := service.QueryToken().OperatorTokenWithAuth(ctx, req.OperatorTokenInput)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res = &v1.OperatorTokenRes{OperatorTokenOutput: out}
|
||||
return res, nil
|
||||
}
|
||||
Reference in New Issue
Block a user