mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 10:00:30 +08:00
feat(m11): add password reset, owner fields, system params
This commit is contained in:
+20
@@ -128,6 +128,26 @@ public class AuthController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("/admin/reset-password")
|
||||
public ResponseEntity<Void> resetPassword(@RequestBody Map<String, String> body) {
|
||||
String username = body.get("username");
|
||||
String newPassword = body.get("newPassword");
|
||||
if (username == null || newPassword == null || newPassword.length() < 6) {
|
||||
throw new ResponseStatusException(org.springframework.http.HttpStatus.BAD_REQUEST,
|
||||
newPassword == null || newPassword.length() < 6 ? "新密码至少6位" : "参数不完整");
|
||||
}
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping("/admin/force-logout")
|
||||
public ResponseEntity<Void> forceLogout(@RequestBody Map<String, String> body) {
|
||||
String username = body.get("username");
|
||||
if (username == null) {
|
||||
throw new ResponseStatusException(org.springframework.http.HttpStatus.BAD_REQUEST, "username required");
|
||||
}
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping("/change-password")
|
||||
public ResponseEntity<Void> changePassword(@RequestBody Map<String, String> body) {
|
||||
String oldPassword = body.get("oldPassword");
|
||||
|
||||
+11
@@ -30,6 +30,9 @@ public class PlatformCustomer {
|
||||
@TableField("customer_code")
|
||||
private String customerCode;
|
||||
|
||||
@TableField("owner_user_id")
|
||||
private String ownerUserId;
|
||||
|
||||
@TableField("created_at")
|
||||
private OffsetDateTime createdAt;
|
||||
|
||||
@@ -100,6 +103,14 @@ public class PlatformCustomer {
|
||||
this.customerCode = customerCode;
|
||||
}
|
||||
|
||||
public String getOwnerUserId() {
|
||||
return ownerUserId;
|
||||
}
|
||||
|
||||
public void setOwnerUserId(String ownerUserId) {
|
||||
this.ownerUserId = ownerUserId;
|
||||
}
|
||||
|
||||
public OffsetDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
+11
@@ -36,6 +36,9 @@ public class PlatformProject {
|
||||
@TableField("project_manager")
|
||||
private String projectManager;
|
||||
|
||||
@TableField("owner_user_id")
|
||||
private String ownerUserId;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -107,4 +110,12 @@ public class PlatformProject {
|
||||
public void setProjectManager(String projectManager) {
|
||||
this.projectManager = projectManager;
|
||||
}
|
||||
|
||||
public String getOwnerUserId() {
|
||||
return ownerUserId;
|
||||
}
|
||||
|
||||
public void setOwnerUserId(String ownerUserId) {
|
||||
this.ownerUserId = ownerUserId;
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -27,6 +27,9 @@ public class CustomerRequest {
|
||||
@Size(max = 64)
|
||||
private String customerCode;
|
||||
|
||||
@Size(max = 256)
|
||||
private String ownerUserId;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -82,4 +85,12 @@ public class CustomerRequest {
|
||||
public void setCustomerCode(String customerCode) {
|
||||
this.customerCode = customerCode;
|
||||
}
|
||||
|
||||
public String getOwnerUserId() {
|
||||
return ownerUserId;
|
||||
}
|
||||
|
||||
public void setOwnerUserId(String ownerUserId) {
|
||||
this.ownerUserId = ownerUserId;
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -12,6 +12,7 @@ public class CustomerResponse {
|
||||
private String address;
|
||||
private String billingInfo;
|
||||
private String customerCode;
|
||||
private String ownerUserId;
|
||||
private OffsetDateTime createdAt;
|
||||
private OffsetDateTime updatedAt;
|
||||
|
||||
@@ -79,6 +80,14 @@ public class CustomerResponse {
|
||||
this.customerCode = customerCode;
|
||||
}
|
||||
|
||||
public String getOwnerUserId() {
|
||||
return ownerUserId;
|
||||
}
|
||||
|
||||
public void setOwnerUserId(String ownerUserId) {
|
||||
this.ownerUserId = ownerUserId;
|
||||
}
|
||||
|
||||
public OffsetDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
+11
@@ -23,6 +23,9 @@ public class ProjectRequest {
|
||||
|
||||
private String plannedEndDate;
|
||||
|
||||
@Size(max = 256)
|
||||
private String ownerUserId;
|
||||
|
||||
public Long getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
@@ -70,4 +73,12 @@ public class ProjectRequest {
|
||||
public void setPlannedEndDate(String plannedEndDate) {
|
||||
this.plannedEndDate = plannedEndDate;
|
||||
}
|
||||
|
||||
public String getOwnerUserId() {
|
||||
return ownerUserId;
|
||||
}
|
||||
|
||||
public void setOwnerUserId(String ownerUserId) {
|
||||
this.ownerUserId = ownerUserId;
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -11,6 +11,7 @@ public class ProjectResponse {
|
||||
private String plannedStartDate;
|
||||
private String plannedEndDate;
|
||||
private String projectManager;
|
||||
private String ownerUserId;
|
||||
private OffsetDateTime createdAt;
|
||||
private OffsetDateTime updatedAt;
|
||||
|
||||
@@ -70,6 +71,14 @@ public class ProjectResponse {
|
||||
this.projectManager = projectManager;
|
||||
}
|
||||
|
||||
public String getOwnerUserId() {
|
||||
return ownerUserId;
|
||||
}
|
||||
|
||||
public void setOwnerUserId(String ownerUserId) {
|
||||
this.ownerUserId = ownerUserId;
|
||||
}
|
||||
|
||||
public OffsetDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE platform_customer ADD COLUMN owner_user_id VARCHAR(256);
|
||||
ALTER TABLE platform_project ADD COLUMN owner_user_id VARCHAR(256);
|
||||
Reference in New Issue
Block a user