javadoc 보완 수정

master
mjkhan21 2 years ago
parent 714a954137
commit 5f0c9994a4

@ -16,15 +16,21 @@ import cokr.xit.foundation.data.DataObject;
@Mapper("userMapper") @Mapper("userMapper")
public interface UserMapper extends AbstractMapper { public interface UserMapper extends AbstractMapper {
/** .<br /> /** .<br />
* {@link cokr.xit.base.user.service.UserService#getUserList(UserQuery)}
* @param req * @param req
* <p>by
* <ul><li>'userName' - ()</li>
* <li>'userID' - </li>
* </ul>
* @return * @return
*/ */
List<DataObject> getUserList(UserQuery req); 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 <T>
* @param req * @param req
@ -34,7 +40,7 @@ public interface UserMapper extends AbstractMapper {
/** . /** .
* @param <T> * @param <T>
* @param userID * @param userIDs
* @return * @return
*/ */
default <T extends User> List<T> getUsers(String... userIDs) { default <T extends User> List<T> getUsers(String... userIDs) {
@ -92,11 +98,6 @@ public interface UserMapper extends AbstractMapper {
/** . /** .
* @param params * @param params
* <pre><code>{
* "userIDs": ,
* "lock": (true || false)
* }</code></pre>
* @param userIDs
* @return * @return
*/ */
int lockUsers(Map<String, ?> params); int lockUsers(Map<String, ?> params);
@ -119,10 +120,6 @@ public interface UserMapper extends AbstractMapper {
/** . /** .
* @param params * @param params
* <pre><code>{
* "userIDs": ,
* "status": (A, P, D)
* }</code></pre>
* @return * @return
*/ */
int setStatus(Map<String, ?> params); 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> <a href="{@docRoot}/doc-files/xit-base-mysql.sql" target="_blank">TBL_USER </a> </li>
* <li> * <li>
* <ul><li> .</li> * <ul><li> .</li>

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

@ -18,12 +18,33 @@ import cokr.xit.foundation.data.DataObject;
* @author mjkhan * @author mjkhan
*/ */
public interface UserService { 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 * @return
*/ */
List<DataObject> getUserList(UserQuery req); List<DataObject> getUserList(UserQuery req);
/** .<br />
* @param userID
* @return
*/
DataObject getUserInfo(String userID);
/** . /** .
* @param <T> * @param <T>
* @param userIDs * @param userIDs

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

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

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

Loading…
Cancel
Save