KKSU
2024-11-15 2147ca2f66dd5ff83db5080988f4832bd10ac213
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package cc.mrbird.febs.unisoftiot.api.service.impl;
 
import cc.mrbird.febs.unisoftiot.api.service.InitAccountService;
import cc.mrbird.febs.unisoftiot.api.entity.Account;
import cc.mrbird.febs.unisoftiot.api.mapper.AccountMapper;
import cc.mrbird.febs.unisoftiot.config.UniSoftAccount;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
 
@Slf4j
@Service
@RequiredArgsConstructor
public class InitAccountServiceImpl extends ServiceImpl<AccountMapper, Account> implements InitAccountService {
    @Override
    public UniSoftAccount initAccount(Account account) {
        return new UniSoftAccount(account.getAppId(),account.getAppSecret());
    }
 
    @Override
    public UniSoftAccount initAccountByAppInfo(String appId, String appSecret) {
        Account account = new Account();
        account.setAppId(appId);
        account.setAppSecret(appSecret);
        return this.initAccount(account);
    }
}