javadoc 보완 수정

master
mjkhan21 2 years ago
parent 714a954137
commit 5f0c9994a4

@ -16,15 +16,21 @@ import cokr.xit.foundation.data.DataObject;
@Mapper("userMapper")
public interface UserMapper extends AbstractMapper {
/** .<br />
* {@link cokr.xit.base.user.service.UserService#getUserList(UserQuery)}
* @param req
* <p>by
* <ul><li>'userName' - ()</li>
* <li>'userID' - </li>
* </ul>
* @return
*/
List<DataObject> getUserList(UserQuery req);
/** .
* @param userID
* @return
*/
default DataObject getUserInfo(String userID) {
List<DataObject> userList = getUserList(new UserQuery().setBy("userID").setTerm(userID));
return !userList.isEmpty() ? userList.get(0) : null;
}
/** .
* @param <T>
* @param req
@ -34,7 +40,7 @@ public interface UserMapper extends AbstractMapper {
/** .
* @param <T>
* @param userID
* @param userIDs
* @return
*/
default <T extends User> List<T> getUsers(String... userIDs) {
@ -92,11 +98,6 @@ public interface UserMapper extends AbstractMapper {
/** .
* @param params
* <pre><code>{
* "userIDs": ,
* "lock": (true || false)
* }</code></pre>
* @param userIDs
* @return
*/
int lockUsers(Map<String, ?> params);
@ -119,10 +120,6 @@ public interface UserMapper extends AbstractMapper {
/** .
* @param params
* <pre><code>{
* "userIDs": ,
* "status": (A, P, D)
* }</code></pre>
* @return
*/
int setStatus(Map<String, ?> params);

@ -1,5 +1,5 @@
/** .
* <p><ul><li> ManagedUser .</li>
* <ul><li> ManagedUser .</li>
* <li> <a href="{@docRoot}/doc-files/xit-base-mysql.sql" target="_blank">TBL_USER </a> </li>
* <li>
* <ul><li> .</li>

@ -12,7 +12,7 @@ public class UserQuery extends QueryRequest {
private String[] userIDs;
private String status;
/** .
/** .
* @return
* <ul><li> true</li>
* <li> false</li>
@ -22,14 +22,16 @@ public class UserQuery extends QueryRequest {
return password;
}
/** .
/** .
* @param password
* <ul><li> true</li>
* <li> false</li>
* </ul>
* @return UserQuery
*/
public void setPassword(boolean password) {
public <T extends UserQuery> T setPassword(boolean password) {
this.password = password;
return self();
}
/** .
@ -41,7 +43,7 @@ public class UserQuery extends QueryRequest {
/** .
* @param userIDs
* @returns UserQuery
* @return UserQuery
*/
public <T extends UserQuery> T setUserIDs(String... userIDs) {
this.userIDs = userIDs;
@ -67,8 +69,10 @@ public class UserQuery extends QueryRequest {
* <li>'D' - </li>
* <li> </li>
* </ul>
* @return UserQuery
*/
public void setStatus(String status) {
public <T extends UserQuery> T setStatus(String status) {
this.status = status;
return self();
}
}

@ -18,12 +18,33 @@ import cokr.xit.foundation.data.DataObject;
* @author mjkhan
*/
public interface UserService {
/** .<br />
* @param req
/** .
* @param req
* <ul><li>by:
* <ul><li>userID - </li>
* <li> </li>
* </ul>
* </li>
* <li>term: </li>
* <li>status: .
* <ul><li>A - </li>
* <li>P - </li>
* <li>D - </li>
* </ul>
* </li>
* <li>pageNum: </li>
* <li>fetchSize: </li>
* </ul>
* @return
*/
List<DataObject> getUserList(UserQuery req);
/** .<br />
* @param userID
* @return
*/
DataObject getUserInfo(String userID);
/** .
* @param <T>
* @param userIDs

@ -24,11 +24,8 @@ public class UserBean extends AbstractComponent {
protected CharsEncoder passwordEncoder;
/** .<br />
* @param req
* <p>by
* <ul><li>'userName' - ()</li>
* <li>'userID' - </li>
* </ul>
* {@link cokr.xit.base.user.service.UserService#getUserList(UserQuery)}
* @param req
* @return
*/
public List<DataObject> getUserList(UserQuery req) {
@ -40,6 +37,14 @@ public class UserBean extends AbstractComponent {
return userMapper.getUserList(req);
}
/** .<br />
* @param userID
* @return
*/
public DataObject getUserInfo(String userID) {
return userMapper.getUserInfo(userID);
}
/** .
* @param <T>
* @param userIDs
@ -87,7 +92,7 @@ public class UserBean extends AbstractComponent {
* </ul>
*/
public boolean update(User user) {
return user!= null ? userMapper.updateUser(user) > 0 : false;
return user!= null && userMapper.updateUser(user) > 0;
}
/** . {@link cokr.xit.foundation.util.CharsEncoder } .

@ -27,6 +27,11 @@ public class UserServiceBean extends AbstractServiceBean implements UserService
return userBean.getUserList(req);
}
@Override
public DataObject getUserInfo(String userID) {
return userBean.getUserInfo(userID);
}
@Override
public <T extends User> List<T> getUsers(String... userIDs) {
return userBean.getUsers(userIDs);

@ -27,8 +27,7 @@ public class UserController<U extends User> extends AbstractController {
/** (user/user-main) .
* {@link #getUserList(UserQuery) } .
* @return ModelAndView
*
* @return base/user/user-main
*/
@RequestMapping(name="사용자 메인", value="/main.do")
public ModelAndView main() {
@ -37,14 +36,15 @@ public class UserController<U extends User> extends AbstractController {
return mav.addObject("userList", toJson(mav.getModel().get("userList")));
}
/**{@link UserService#getUserList(UserQuery)} .
* @param req
/** .<br />
* {@link UserService#getUserList(UserQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "userList": [...], // 사용자 목록
* "userStart": 0, // 사용자 목록 시작 인덱스
* "userFetch": 10, // 한 번에 가져오는 사용자 목록 수
* "userTotal": // 조회 결과 찾은 전체 사용자 수
* "userList": [ ]
* "userStart":
* "userFetch":
* "userTotal":
* }</code></pre>
*/
@RequestMapping(name="사용자 조회", value="/list.do")
@ -54,7 +54,11 @@ public class UserController<U extends User> extends AbstractController {
}
/** .
* @return "base/user/select-user"
* @param multiple
* <ul><li> true</li>
* <li> false</li>
* </ul>
* @return base/user/select-user
*/
@RequestMapping(name="사용자 선택", value="/select.do")
public ModelAndView select(boolean multiple) {
@ -66,9 +70,9 @@ public class UserController<U extends User> extends AbstractController {
/** .
* @param userID
* @return
* @return jsonView
* <pre><code> {
* "duplicate": true || false // 사용 중이면 true, 그렇지 않으면 false
* "duplicate": true, false
* }</code></pre>
*/
@RequestMapping(name="중복 확인", value="/duplicate.do")
@ -80,19 +84,15 @@ public class UserController<U extends User> extends AbstractController {
/** .
* @param userID
* @return jsonView
* @return base/user/user-info jsonView
* <pre>{
* "userInfo": (map)
* "userInfo":
* }</pre>
*/
@RequestMapping(name="사용자 정보 조회", value="/info.do")
public ModelAndView getInfo(String userID) {
if (!isEmpty(userID)) {
UserQuery req = new UserQuery()
.setBy("userID")
.setTerm(userID);
List<DataObject> userList = userService.getUserList(req);
DataObject userInfo = !userList.isEmpty() ? userList.get(0) : null;
DataObject userInfo = userService.getUserInfo(userID);
boolean json = jsonResponse();
return new ModelAndView(json ? "jsonView" : "base/user/user-info")
.addObject("userInfo", json ? userInfo : toJson(userInfo));
@ -103,9 +103,9 @@ public class UserController<U extends User> extends AbstractController {
/** .
* @param user
* @return
* @return jsonView
* <pre><code> {
* "saved": true || false // 저장되었으면 true, 그렇지 않으면 false
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="사용자 등록", value="/create.do")
@ -117,9 +117,9 @@ public class UserController<U extends User> extends AbstractController {
/** .
* @param user
* @return
* @return jsonView
* <pre><code> {
* "saved": true || false // 저장되었으면 true, 그렇지 않으면 false
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="사용자 수정", value="/update.do")
@ -132,10 +132,10 @@ public class UserController<U extends User> extends AbstractController {
/** .
* @param userID
* @param password
* @return
* @return jsonView
* <pre><code> {
* "affected": 1, // 저장된 정보수
* "saved": true || false // 저장되었으면 true, 그렇지 않으면 false
* "affected": ,
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="비밀번호 변경", value="/changePassword.do")
@ -148,10 +148,10 @@ public class UserController<U extends User> extends AbstractController {
/** .
* @param userIDs
* @return
* @return jsonView
* <pre><code> {
* "affected": 1, // 저장된 정보수
* "saved": true || false // 저장되었으면 true, 그렇지 않으면 false
* "affected":
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="사용자 가입 승인", value="/approve.do")
@ -163,12 +163,15 @@ public class UserController<U extends User> extends AbstractController {
}
/** .
* @param lock ( true, false)
* @param lock
* <ul><li> true</li>
* <li> false</li>
* </ul>
* @param userIDs
* @return
* @return jsonView
* <pre><code> {
* "affected": 1, // 저장된 정보수
* "saved": true || false // 저장되었으면 true, 그렇지 않으면 false
* "affected":
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="사용자 잠김/잠김해제", value="/unlock.do")
@ -181,10 +184,10 @@ public class UserController<U extends User> extends AbstractController {
/** .
* @param userIDs
* @return
* @return jsonView
* <pre><code> {
* "affected": 1, // 저장된 정보수
* "saved": true || false // 저장되었으면 true, 그렇지 않으면 false
* "affected":
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="사용자 제거", value="/remove.do")

Loading…
Cancel
Save