11
This commit is contained in:
1 parent
cbfb174a12
commit
e962da405b
5 files changed
+33
-4
No files matched your search
+19
@@ -1,7 +1,26 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardAuthAppDto {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 智能柜设备id
|
||||
*/
|
||||
@NotEmpty(message = "智能柜设备id不能为空")
|
||||
private Long doorHardId;
|
||||
|
||||
/**
|
||||
* 是否授权
|
||||
*/
|
||||
@NotEmpty(message = "是否授权不能为空")
|
||||
private String authStatus;
|
||||
|
||||
}
|
||||
+6
-4
@@ -3,8 +3,7 @@ package com.bsd.pjcloud.hard.api.entity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -12,6 +11,9 @@ import java.time.LocalDateTime;
|
||||
/**
|
||||
* 硬件授权
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("hard_auth")
|
||||
@@ -40,9 +42,9 @@ public class HardAuthEntity extends Model<HardAuthEntity> {
|
||||
private Long hardId;
|
||||
|
||||
/**
|
||||
* 是否授权
|
||||
* 授权类型
|
||||
*/
|
||||
@Schema(description = "是否授权")
|
||||
@Schema(description = "授权类型")
|
||||
private String authType;
|
||||
|
||||
/**
|
||||
|
||||
+4
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardAuthAppDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardAuthDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardAuthEntity;
|
||||
@@ -42,6 +44,8 @@ public class HardAuthController {
|
||||
@PostMapping("/app/auth-hard-door")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAuth_view')")
|
||||
public R appAuthHardDoor(@RequestBody HardAuthAppDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setUserId(user.getId());
|
||||
return R.ok(hardAuthService.appAuthHardDoor(dto));
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -52,6 +52,9 @@ public class HardAuthServiceImpl extends ServiceImpl<HardAuthMapper, HardAuthEnt
|
||||
*/
|
||||
@Override
|
||||
public Long appAuthHardDoor(HardAuthAppDto dto) {
|
||||
HardAuthEntity insetObj = HardAuthEntity.builder()
|
||||
.userId(dto.getUserId())
|
||||
.build();
|
||||
return 0L;
|
||||
}
|
||||
|
||||
|
||||
@@ -231,6 +231,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
group by u.user_id
|
||||
<if test="_databaseId != 'mssql'">
|
||||
ORDER BY u.create_time DESC, u.user_id DESC
|
||||
</if>
|
||||
|
||||
Reference in new issue
Block a user