22 lines
503 B
Go
22 lines
503 B
Go
package service
|
|
|
|
import (
|
|
"admin/apps/game/domain/entity"
|
|
"admin/internal/errcode"
|
|
)
|
|
|
|
func (svc *Service) GetCDKeyAllKeys(id int) (*entity.CDKey, []string, error) {
|
|
et, find, err := svc.cdkeySvc.Get(id)
|
|
if err != nil {
|
|
return nil, nil, err
|
|
}
|
|
if !find {
|
|
return nil, nil, errcode.New(errcode.ParamsInvalid, "not found cdkey:%v", id)
|
|
}
|
|
return et, et.GenerateKeys(), nil
|
|
}
|
|
|
|
func (svc *Service) CDKeyAddCount(id int, deltaCount int) (int, error) {
|
|
return svc.cdkeySvc.AddCount(id, deltaCount)
|
|
}
|