增加mongodb配置及查询
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.onekeycall.videotablet.controller;
|
||||
|
||||
|
||||
import com.onekeycall.videotablet.entity.ApkInfo;
|
||||
import com.onekeycall.videotablet.service.ApkInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/apks")
|
||||
public class ApkInfoController {
|
||||
|
||||
@Autowired
|
||||
private ApkInfoService apkInfoService;
|
||||
|
||||
@GetMapping("/device/{deviceId}")
|
||||
public List<ApkInfo> getApksByDeviceId(@PathVariable String deviceId) {
|
||||
return apkInfoService.getApkInfosByDeviceId(deviceId);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ApkInfo saveApkInfo(@RequestBody ApkInfo apkInfo) {
|
||||
return apkInfoService.saveOrUpdateApkInfo(apkInfo);
|
||||
}
|
||||
|
||||
@PostMapping("/batch")
|
||||
public List<ApkInfo> saveApkInfos(@RequestBody List<ApkInfo> apkInfos) {
|
||||
return apkInfoService.saveAllApkInfos(apkInfos);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{packageName}")
|
||||
public void deleteApkInfo(@PathVariable String packageName) {
|
||||
apkInfoService.deleteApkInfoByPackageName(packageName);
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public class LoginController {
|
||||
return Result.ok().data(Collections.singletonMap("token", tokenPair.toMap()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error().message("登录失败");
|
||||
return Result.error().message("登录失败:密码错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user