-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from support-project/feature/issue356_default…
…_notify_config #356 Set the notification flag when user registration.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/main/java/org/support/project/knowledge/logic/AddUserProcessLogic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.support.project.knowledge.logic; | ||
|
||
import org.support.project.common.config.INT_FLAG; | ||
import org.support.project.common.log.Log; | ||
import org.support.project.common.log.LogFactory; | ||
import org.support.project.knowledge.dao.ExUsersDao; | ||
import org.support.project.knowledge.dao.NotifyConfigsDao; | ||
import org.support.project.knowledge.entity.NotifyConfigsEntity; | ||
import org.support.project.web.entity.UsersEntity; | ||
import org.support.project.web.logic.AddUserProcess; | ||
|
||
public class AddUserProcessLogic implements AddUserProcess { | ||
/** ログ */ | ||
private static final Log LOG = LogFactory.getLog(AddUserProcessLogic.class); | ||
|
||
@Override | ||
public void addUserProcess(String userKey) { | ||
LOG.debug("addUserProcess"); | ||
|
||
UsersEntity user = ExUsersDao.get().selectOnUserKey(userKey); | ||
if (user == null) { | ||
LOG.debug("user: " + userKey + " is not exists."); | ||
return; | ||
} | ||
|
||
// 追加されたユーザの、通知設定をデフォルトONにする | ||
NotifyConfigsDao notifyConfigsDao = NotifyConfigsDao.get(); | ||
NotifyConfigsEntity entity = new NotifyConfigsEntity(); | ||
entity.setNotifyMail(INT_FLAG.ON.getValue()); | ||
entity.setMyItemComment(INT_FLAG.ON.getValue()); | ||
entity.setMyItemLike(INT_FLAG.ON.getValue()); | ||
entity.setMyItemStock(INT_FLAG.ON.getValue()); | ||
entity.setToItemComment(INT_FLAG.ON.getValue()); | ||
entity.setToItemSave(INT_FLAG.ON.getValue()); | ||
entity.setUserId(user.getUserId()); | ||
notifyConfigsDao.save(entity); | ||
|
||
LOG.debug("set notify config to user: " + userKey + ""); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters