|
@@ -98,20 +98,20 @@ public class LiveDataAccountsController {
|
|
|
public Result<Object> add(@RequestBody LiveDataAccounts liveDataAccounts) {
|
|
|
try {
|
|
|
if (Check.isNull(liveDataAccounts.getLiveAccountId())) {
|
|
|
- return Result.ok("缺少数据,请输入账户ID");
|
|
|
+ return Result.error("缺少数据,请输入账户ID");
|
|
|
} else if (Check.isNull(liveDataAccounts.getLiveAccountName())) {
|
|
|
- return Result.ok("缺少数据,请输入账户名称");
|
|
|
+ return Result.error("缺少数据,请输入账户名称");
|
|
|
}
|
|
|
LiveDataAccounts accounts = liveDataAccountsService.getById(liveDataAccounts.getLiveAccountId());
|
|
|
if (!Check.isNull(accounts)) {
|
|
|
- return Result.ok("该账户ID已注册,账户名:" + accounts.getLiveAccountName());
|
|
|
+ return Result.error("该账户ID已注册,账户名:" + accounts.getLiveAccountName());
|
|
|
}
|
|
|
QueryWrapper<LiveDataAccounts> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("live_account_name", liveDataAccounts.getLiveAccountName());
|
|
|
queryWrapper.eq("state", "1").last("limit 1");
|
|
|
LiveDataAccounts one = liveDataAccountsService.getOne(queryWrapper);
|
|
|
if (!Check.isNull(one)) {
|
|
|
- return Result.ok("该账户名称已存在,请重新命名");
|
|
|
+ return Result.error("该账户名称已存在,请重新命名");
|
|
|
}
|
|
|
liveDataAccounts.setStatDate(DateUtils.date2Str());
|
|
|
liveDataAccountsService.save(liveDataAccounts);
|