MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / GetTokenByIds

Function GetTokenByIds

model/token.go:141–149  ·  view source on GitHub ↗
(id int, userId int)

Source from the content-addressed store, hash-verified

139}
140
141func GetTokenByIds(id int, userId int) (*Token, error) {
142 if id == 0 || userId == 0 {
143 return nil, errors.New("id 或 userId 为空!")
144 }
145 token := Token{Id: id, UserId: userId}
146 var err error = nil
147 err = DB.First(&token, "id = ? and user_id = ?", id, userId).Error
148 return &token, err
149}
150
151func GetTokenById(id int) (*Token, error) {
152 if id == 0 {

Callers 5

GetUserUsageStatisticsFunction · 0.92
GetTokenFunction · 0.92
GetTokenStatusFunction · 0.92
UpdateTokenFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected