44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
package model
|
|
|
|
import (
|
|
"context"
|
|
"git.5iot.com/iotlcm-public/iotlcm-upstream-proxy/internal/model/entity"
|
|
|
|
"github.com/gogf/gf/v2/os/gtime"
|
|
)
|
|
|
|
type SimChannelConfigItemCache struct {
|
|
Template *entity.TSimChannelTemplate
|
|
Channel *entity.TSimChannels
|
|
IsNormal *int // global_yes_or_no: 0=yes, 1=no; NULL is not eligible.
|
|
Version string
|
|
}
|
|
|
|
// CanCreateInstance determines whether a channel may have a runtime instance.
|
|
func (c *SimChannelConfigItemCache) CanCreateInstance() bool {
|
|
return c != nil && c.Channel != nil && c.IsNormal != nil && *c.IsNormal == 0
|
|
}
|
|
|
|
type SimCardTempI interface {
|
|
NewTemp(ctx context.Context, channelConfig *SimChannelConfigItemCache) SimCardChannelI
|
|
}
|
|
|
|
// 接口定义
|
|
type SimCardChannelI interface {
|
|
SimBase(ctx context.Context, input *SimBaseReqJson) (SimBaseResJson, error)
|
|
}
|
|
|
|
type SimCardChannelCache struct {
|
|
Instance SimCardChannelI
|
|
Version string
|
|
}
|
|
|
|
type UpdateAccessTokenInput struct {
|
|
ChanKey string
|
|
AccessToken string
|
|
AccessTokenCreated *gtime.Time
|
|
AccessTokenExpire *gtime.Time
|
|
RefreshToken string
|
|
RefreshTokenExpire *gtime.Time
|
|
}
|