Skip to content

Commit

Permalink
Last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bardiademon committed Apr 25, 2021
1 parent 08a7eb8 commit 9ddfc50
Show file tree
Hide file tree
Showing 20 changed files with 513 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public enum CUV
sorry_for_this_error, id_invalid, not_found, user_not_found, invalid_width_or_height,
access_has_been_disabled, access_denied, found, error, not_found_id,
request_is_null, account_deactive, please_try_again, username_invalid,
removed, id, changed, added, ok, anonymous, mkdirs_error, not_logged_in, recorded
removed, id, changed, added, ok, anonymous, mkdirs_error, not_logged_in, recorded, online_code_invalid
}

@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@
import com.bardiademon.CyrusMessenger.Model.Database.Users.Users.SubmitRequest.SubmitRequestType;
import com.bardiademon.CyrusMessenger.Model.WorkingWithADatabase.IdUsernameMainAccount;
import com.bardiademon.CyrusMessenger.This;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.LocalDateTime;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand Down Expand Up @@ -226,7 +229,8 @@ public String textAnswerQuestionTextOptions ()
final List <AnswersCountOptions> objects = This.GetService (AnswerQuestionsTextService.class).countQuestionTextOptions (10760);

final StringBuilder result = new StringBuilder ();
if (objects != null) for (AnswersCountOptions answersCountOptions : objects) result.append (answersCountOptions.toString ());
if (objects != null)
for (AnswersCountOptions answersCountOptions : objects) result.append (answersCountOptions.toString ());

return result.toString ();
}
Expand All @@ -237,6 +241,59 @@ public Stickers getSticker (@PathVariable ("id-sticker") String strIdSticker)
return stickersService.Repository.getSticker (Long.parseLong (strIdSticker));
}

@RequestMapping (value = "/test-id")
public TestId testId (@RequestBody TestId testId)
{
return testId;
}

public static class TestId
{
private long id;

@JsonProperty("my_name")
private String name;

@JsonIgnore
private String family;

public TestId ()
{
}

public long getId ()
{
return id;
}

public void setId (long id)
{
this.id = id;
}

public String getName ()
{
return name;
}

public void setName (String name)
{
this.name = name;
}

public String getFamily ()
{
return family;
}

public void setFamily (String family)
{
this.family = family;
}
}



public enum TestEnum
{
test_enum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public boolean hasAccess (final MainAccount applicant , final Groups groups , fi
{
if (numberOfSubmissions > 1)
{
l.n (Thread.currentThread ().getStackTrace () , new Exception ("GapsFilesSecurity.isJustOnce () === true") , ToJson.CreateClass.nj ("gaps_files_security_id" , security.getId ()));
l.n (Thread.currentThread ().getStackTrace () , l.e ("GapsFilesSecurity.isJustOnce () === true") , ToJson.CreateClass.nj ("gaps_files_security_id" , security.getId ()));
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void check ()
{
valid = false;
answerToClient = AnswerToClient.NotLoggedIn ();
l.n (codeLogin , null , null , answerToClient , Thread.currentThread ().getStackTrace () , new Exception ("not login") , createClass.toJson ());
l.n (codeLogin , null , answerToClient , Thread.currentThread ().getStackTrace () , l.e("not login") , createClass.toJson ());
return;
}

Expand All @@ -49,9 +49,9 @@ private void check ()
if (!valid)
{
answerToClient = AnswerToClient.NotLoggedIn ();
l.n (codeLogin , null , null , answerToClient , Thread.currentThread ().getStackTrace () , new Exception ("invalid code login") , createClass.toJson ());
l.n (codeLogin , null , answerToClient , Thread.currentThread ().getStackTrace () , new Exception ("invalid code login") , createClass.toJson ());
}
else l.n (codeLogin , null , getVCodeLogin ().getMainAccount () , null , Thread.currentThread ().getStackTrace () , null , createClass.toJson ());
else l.n (codeLogin , getVCodeLogin ().getMainAccount () , null , Thread.currentThread ().getStackTrace () , null , createClass.toJson ());
}

public boolean isValid ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

@Entity
@Table (name = "gaps")

public final class Gaps
{
@Id
Expand Down Expand Up @@ -364,6 +363,16 @@ public void setGapsPostedAgain (List <GapsPostedAgain> gapsPostedAgain)
this.gapsPostedAgain = gapsPostedAgain;
}

public GapsPostedAgain getPostedAgain ()
{
return postedAgain;
}

public void setPostedAgain (GapsPostedAgain postedAgain)
{
this.postedAgain = postedAgain;
}

public GapsPostedAgain getForwarded ()
{
return forwarded;
Expand Down Expand Up @@ -404,16 +413,6 @@ public void setPersonalGaps (PersonalGaps personalGaps)
this.personalGaps = personalGaps;
}

public GapsPostedAgain getPostedAgain ()
{
return postedAgain;
}

public void setPostedAgain (GapsPostedAgain postedAgain)
{
this.postedAgain = postedAgain;
}

public GapTextType getTextType ()
{
return textType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public void suspend (GroupManagement groupManagement , MainAccount mainAccount ,
groupManagement.setSuspendedAt (LocalDateTime.now ());
groupManagement.setSuspendedBy (suspendedBy);
Repository.save (groupManagement);
l.n (null , null , mainAccount , null , Thread.currentThread ().getStackTrace () , null , requestFrom.toString ());
l.n (null , mainAccount , null , Thread.currentThread ().getStackTrace () , null , requestFrom.toString ());
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package com.bardiademon.CyrusMessenger.Model.Database.Groups.GroupSecurity.GroupSecurityGap;

import com.bardiademon.CyrusMessenger.Model.Database.Groups.GroupSecurity.GroupSecurityGap.ValidFilesGroups.ValidFilesGroups;
import com.bardiademon.CyrusMessenger.Model.Database.Groups.Groups.Groups.Groups;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Id;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.OneToOne;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table (name = "group_security_gap")
Expand Down Expand Up @@ -39,9 +41,15 @@ public class GroupSecurityGap
@Column (name = "send_voice", nullable = false)
private boolean sendVoice = true;

@Column (name = "send_file", nullable = false)
private boolean sendFile = true;

@Column (name = "send_link", nullable = false)
private boolean sendLink = true;

@OneToMany
private List <ValidFilesGroups> validFilesGroups;

public GroupSecurityGap ()
{
}
Expand Down Expand Up @@ -116,6 +124,16 @@ public void setSendVoice (boolean sendVoice)
this.sendVoice = sendVoice;
}

public boolean isSendFile ()
{
return sendFile;
}

public void setSendFile (boolean sendFile)
{
this.sendFile = sendFile;
}

public boolean isSendLink ()
{
return sendLink;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
package com.bardiademon.CyrusMessenger.Model.Database.Groups.GroupSecurity.GroupSecurityGap.ValidFilesGroups;

import com.bardiademon.CyrusMessenger.Model.Database.Groups.GroupSecurity.GroupSecurityGap.GroupSecurityGap;
import com.bardiademon.CyrusMessenger.Model.Database.Users.Users.MainAccount.MainAccount;
import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.CreationTimestamp;

/*
* in table types haye ke tavasot management group add mishe nega midam ke user ha faghat betonan in type ha ro toye group send konan
*/
@Entity
@Table (name = "valid_files_gaps")
public final class ValidFilesGroups
{
@Id
@GeneratedValue
private long id;

/*
* type => pasvand file ha {.exe,.txt,...}
*/
private String type;

/*
* in type ha baraye group ha hast va jozv security groupgap hesab mishe
*/
@ManyToOne
@JoinColumn (name = "group_security_id", referencedColumnName = "id")
private GroupSecurityGap groupSecurityGap;

/*
* che timei in type add shode
*/
@Column (name = "created_at", updatable = false)
@CreationTimestamp
private LocalDateTime createdAt;

/*
* baraye in ke sabt beshe ke che useri esafe karde ino
*/
@ManyToOne
@JoinColumn (name = "added_by", referencedColumnName = "id")
private MainAccount addedBy;

/*
* aya delete shode ya no
*
* insertable = false baraye ine ke time add kadrdan in meghdar dehi nashe
*/
@Column (insertable = false)
private boolean deleted;

/*
* agar delete shode che timei delete shode
*
* insertable = false baraye ine ke time add kadrdan in meghdar dehi nashe
*/
@Column (name = "deleted_at", insertable = false)
private LocalDateTime deletedAt;

public ValidFilesGroups ()
{
}

public long getId ()
{
return id;
}

public void setId (long id)
{
this.id = id;
}

public String getType ()
{
return type;
}

public void setType (String type)
{
this.type = type;
}

public GroupSecurityGap getGroupSecurityGap ()
{
return groupSecurityGap;
}

public void setGroupSecurityGap (GroupSecurityGap groupSecurityGap)
{
this.groupSecurityGap = groupSecurityGap;
}

public LocalDateTime getCreatedAt ()
{
return createdAt;
}

public void setCreatedAt (LocalDateTime createdAt)
{
this.createdAt = createdAt;
}

public MainAccount getAddedBy ()
{
return addedBy;
}

public void setAddedBy (MainAccount addedBy)
{
this.addedBy = addedBy;
}

public boolean isDeleted ()
{
return deleted;
}

public void setDeleted (boolean deleted)
{
this.deleted = deleted;
}

public LocalDateTime getDeletedAt ()
{
return deletedAt;
}

public void setDeletedAt (LocalDateTime deletedAt)
{
this.deletedAt = deletedAt;
}
}
Loading

0 comments on commit 9ddfc50

Please sign in to comment.