|
|
@@ -11,6 +11,7 @@ import com.fdkankan.manage.service.IUserService;
|
|
|
import com.fdkankan.manage.vo.request.CameraParam;
|
|
|
import com.fdkankan.manage.vo.request.UserIncrementParam;
|
|
|
import com.fdkankan.manage.vo.request.UserParam;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -38,13 +39,19 @@ public class UserController {
|
|
|
return ResultData.ok(userService.pageList(param));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/getIncrementListByUserId")
|
|
|
- public ResultData getIncrementListByUserId(@RequestParam(required = false)Long userId,
|
|
|
- @RequestParam(required = false,defaultValue = "1") Integer pageNum,
|
|
|
- @RequestParam(required = false,defaultValue = "10") Integer pageSize){
|
|
|
- return ResultData.ok(userIncrementService.pageList(userId,pageNum,pageSize));
|
|
|
+ /**
|
|
|
+ * 权益详情
|
|
|
+ */
|
|
|
+ @PostMapping("/getIncrementListByUserId")
|
|
|
+ public ResultData getIncrementListByUserId(@RequestBody UserParam param){
|
|
|
+ return ResultData.ok(userIncrementService.pageList(param.getId(),param.getPageNum(),param.getPageSize()));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 权益延期
|
|
|
+ * id 权益id
|
|
|
+ * year 延期年限
|
|
|
+ */
|
|
|
@PostMapping("/IncrementDelay")
|
|
|
public ResultData IncrementDelay(@RequestBody UserIncrementParam param){
|
|
|
if(param.getId() == null){
|
|
|
@@ -54,24 +61,38 @@ public class UserController {
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 添加用户权益
|
|
|
+ * userId 用户id
|
|
|
+ * incrementEndTime 权益到期日期
|
|
|
+ */
|
|
|
@PostMapping("/addUserIncrement")
|
|
|
public ResultData addUserIncrement(@RequestBody UserIncrementParam param){
|
|
|
- if(param.getUserId() == null){
|
|
|
+ if(param.getUserId() == null || StringUtils.isEmpty(param.getIncrementEndTime())){
|
|
|
throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
userIncrementService.add(param);
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 添加下载次数
|
|
|
+ * userId 用户id
|
|
|
+ * count 下载次数
|
|
|
+ */
|
|
|
@PostMapping("/addDownNum")
|
|
|
public ResultData addDownNum(@RequestBody UserIncrementParam param){
|
|
|
- if(param.getUserId() == null){
|
|
|
+ if(param.getUserId() == null || param.getCount() == null){
|
|
|
throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
userService.addDownNum(param);
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取相机详情
|
|
|
+ * userId 用户id
|
|
|
+ */
|
|
|
@PostMapping("/getCameraDetail")
|
|
|
public ResultData getCameraDetail(@RequestBody CameraParam cameraParam){
|
|
|
if(cameraParam.getUserId() == null){
|
|
|
@@ -80,6 +101,11 @@ public class UserController {
|
|
|
return ResultData.ok(cameraService.pageList(cameraParam));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 解绑相机
|
|
|
+ * @param cameraId 相机id
|
|
|
+ * @param userId 用户id
|
|
|
+ */
|
|
|
@GetMapping("/unbindCamera")
|
|
|
public ResultData unbindCamera(@RequestParam(required = false)Long cameraId,
|
|
|
@RequestParam(required = false)Long userId){
|