mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +08:00
java-spring: added Anonymous(uid-4), set default person John, fix favorite
This commit is contained in:
@ -97,7 +97,7 @@ public class EditorController {
|
||||
dataMailMergeRecipients.put("url", documentManager.getServerUrl(true) + "/csv");
|
||||
|
||||
List<UserForMention> usersForMentions=new ArrayList<>();
|
||||
if(uid!=null && !uid.equals("0")) {
|
||||
if(uid!=null && !uid.equals("4")) {
|
||||
List<User> list = userService.findAll();
|
||||
for (User u : list) {
|
||||
if (u.getName()!=null &&u.getEmail()!=null && u.getId()!=Integer.parseInt(uid)) {
|
||||
|
||||
@ -62,6 +62,15 @@ public class IndexController {
|
||||
|
||||
@PostConstruct
|
||||
private void init(){
|
||||
List<String> description_user_0=List.of(
|
||||
"The name is requested when the editor is opened",
|
||||
"Doesn’t belong to any group",
|
||||
"Can review all the changes",
|
||||
"Can perform all actions with comments",
|
||||
"The file favorite state is undefined",
|
||||
"Can't mention others in comments",
|
||||
"Can't create new files from the editor"
|
||||
);
|
||||
List<String> description_user_1 = List.of(
|
||||
"File author by default",
|
||||
"He doesn’t belong to any of the groups",
|
||||
@ -98,6 +107,8 @@ public class IndexController {
|
||||
userService.createUser("Hamish Mitchell", "mitchell@mail.ru",
|
||||
description_user_3, "group-3", List.of("group-2"), List.of("group-2", "group-3"),
|
||||
List.of("group-2"), new ArrayList<>(),false);
|
||||
userService.createUser("Anonymous",null,description_user_0,null,
|
||||
null,null,null,null,null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class Info {
|
||||
private Boolean favorite;
|
||||
private Boolean favorite = null;
|
||||
|
||||
public Boolean getFavorite() {
|
||||
return favorite;
|
||||
|
||||
@ -64,17 +64,18 @@ public class Document {
|
||||
this.info = applicationContext.getBean(Info.class);
|
||||
this.permissions = permissions;
|
||||
switch (uid){
|
||||
case "uid-0":{
|
||||
this.info.setFavorite(null);
|
||||
}
|
||||
case "uid-1":{
|
||||
case "uid-4":
|
||||
case "uid-1": {
|
||||
this.info.setFavorite(null);
|
||||
break;
|
||||
}
|
||||
case "uid-2":{
|
||||
this.info.setFavorite(true);
|
||||
break;
|
||||
}
|
||||
case "uid-3":{
|
||||
this.info.setFavorite(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user