package service import ( "admin/apps/game/domain/entity" "admin/apps/game/model/dto" "admin/internal/errcode" ) func (svc *Service) GetCDKeyAllKeys(projectId int, id int) (*entity.CDKey, []string, error) { et, find, err := svc.cdkeySvc.Get(projectId, 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(projectId int, id int, deltaCount int) (int, error) { return svc.cdkeySvc.AddCount(projectId, id, deltaCount) } func (svc *Service) CDKeyUse(params *dto.CDKeyUseReq) (*entity.CDKey, error) { batchInfo, err := svc.cdkeySvc.CDKeyUse(params) if err != nil { return nil, err } return batchInfo, nil } func (svc *Service) CDKeyUsedHistoryList(projectId, id int) ([]*dto.CDKeyUsedInfo, error) { return svc.cdkeySvc.GetUsedHistoryList(projectId, id) }