Skip to content

Commit

Permalink
fix privet chat database read null value
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksgata committed Feb 1, 2024
1 parent 9fe6bed commit d31b5fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public String privateChatOn(DiceMessageDTO data) {
return CustomText.getText("dice.master.number.no.set");
}
if (data.getSanderId() == Long.parseLong(number)) {
diceConfigMapper.updateByPrivateChat(true);
diceConfigMapper.updateByPrivateChat(1);
return CustomText.getText("dice.private.chat.enable");
} else {
return CustomText.getText("dice.private.chat.no.permission");
Expand All @@ -40,7 +40,7 @@ public String privateChatOff(DiceMessageDTO data) {
return CustomText.getText("dice.master.number.no.set");
}
if (data.getSanderId() == Long.parseLong(number)) {
diceConfigMapper.updateByPrivateChat(false);
diceConfigMapper.updateByPrivateChat(0);
return CustomText.getText("dice.private.chat.disable");
} else {
return CustomText.getText("dice.private.chat.no.permission");
Expand All @@ -54,7 +54,7 @@ public String betaVersionOn(DiceMessageDTO data) {
return CustomText.getText("dice.master.number.no.set");
}
if (data.getSanderId() == Long.parseLong(number)) {
diceConfigMapper.updateByBetaVersion(true);
diceConfigMapper.updateByBetaVersion(1);
return CustomText.getText("dice.beta.enable");
} else {
return CustomText.getText("dice.beta.no.permission");
Expand All @@ -68,7 +68,7 @@ public String betaVersionOff(DiceMessageDTO data) {
return CustomText.getText("dice.master.number.no.set");
}
if (data.getSanderId() == Long.parseLong(number)) {
diceConfigMapper.updateByBetaVersion(false);
diceConfigMapper.updateByBetaVersion(0);
return CustomText.getText("dice.beta.disable");
} else {
return CustomText.getText("dice.beta.no.permission");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public interface DiceConfigMapper {
DiceConfigEntity selectById();

@Update("update dice_config set private_chat=#{privateChat} where id= 1")
void updateByPrivateChat(@Param("privateChat") Boolean privateChat);
void updateByPrivateChat(@Param("privateChat") Integer privateChat);

@Update("update dice_config set beta_version =#{betaVersion} where id = 1")
void updateByBetaVersion(@Param("betaVersion") Boolean betaVersion);
void updateByBetaVersion(@Param("betaVersion") Integer betaVersion);


}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
Expand Down

0 comments on commit d31b5fa

Please sign in to comment.