javadoc 보완 수정

master
mjkhan21 2 years ago
parent c545a3c2bd
commit 09785d5e6c

@ -18,15 +18,24 @@ import cokr.xit.foundation.data.DataObject;
*/
@Mapper("codeMapper")
public interface CodeMapper extends AbstractMapper {
/** .
* @param pageNum
* @param fetchSize
/** .<br />
* {@link cokr.xit.base.code.service.CodeService#getCategoryList(CodeQuery)}
* @param req
* @return
*/
List<DataObject> getCategoryList(CodeQuery req);
/** .
* @param categoryID
* @return
*/
default DataObject getCategoryInfo(String categoryID) {
List<DataObject> list = getCategoryList(new CodeQuery().setCategoryIDs(categoryID));
return !list.isEmpty() ? list.get(0) : null;
}
/** .
* @param categoryIDs
* @param req
* @return
*/
List<CodeCategory> getCategories(CodeQuery req);
@ -44,7 +53,7 @@ public interface CodeMapper extends AbstractMapper {
return !categories.isEmpty() ? categories.get(0) : null;
}
/** .
* @param category
* @param params
* @return
* <ul><li> true</li>
* <li> false</li>
@ -67,14 +76,15 @@ public interface CodeMapper extends AbstractMapper {
return insertCategory(params);
}
/** .
* @param params
* @return
*/
int updateCategory(Map<String, ?> params);
/** .
* @param category
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
* @return
*/
default int update(CodeCategory category) {
DataObject params = params()
@ -84,6 +94,11 @@ public interface CodeMapper extends AbstractMapper {
return updateCategory(params);
}
/** .<br />
* , .
* @param params
* @return
*/
int removeCategories(Map<String, ?> params);
/** .<br />
@ -98,16 +113,30 @@ public interface CodeMapper extends AbstractMapper {
return removeCategories(params().set("categoryIDs", categoryIDs));
}
/** .
* @param pageNum
* @param fetchSize
* @return
/** .<br />
* {@link cokr.xit.base.code.service.CodeService#getGroupList(CodeQuery)}
* @param req
* @return
*/
List<DataObject> getGroupList(CodeQuery req);
/** .
* @param groupIDs
* @return
/** .
* @param categoryID
* @param groupID
* @return
*/
default DataObject getGroupInfo(String categoryID, String groupID) {
CodeQuery req = new CodeQuery();
if (!isEmpty(categoryID))
req.setCategoryIDs(categoryID);
List<DataObject> list = getGroupList(req.setGroupIDs(groupID));
return !list.isEmpty() ? list.get(0) : null;
}
/** .
* @param req
* @return
*/
List<CodeGroup> getGroups(CodeQuery req);
@ -179,18 +208,27 @@ public interface CodeMapper extends AbstractMapper {
return removeGroups(null, groupIDs);
}
/** .
* @param groupID
* @param pageNum
* @param fetchSize
/** .<br />
* {@link cokr.xit.base.code.service.CodeService#getCodeList(CodeQuery)}
* @param req
* @return
*/
List<DataObject> getCodeList(CodeQuery req);
/** .
* @param groupID
* @param code
* @return
*/
default DataObject getCodeInfo(String groupID, String code) {
CodeQuery req = new CodeQuery().setGroupIDs(groupID).setCodes(code);
List<DataObject> list = getCodeList(req);
return !list.isEmpty() ? list.get(0) : null;
}
/** , .<br />
* .
* @param groupID
* @param codes
* @param req
* @return
*/
List<CommonCode> getCodes(CodeQuery req);
@ -215,6 +253,10 @@ public interface CodeMapper extends AbstractMapper {
return !codes.isEmpty() ? codes.get(0) : null;
}
/** .
* @param params
* @return
*/
int insertCode(Map<String, ?> params);
/** .
@ -231,6 +273,10 @@ public interface CodeMapper extends AbstractMapper {
return insertCode(params);
}
/** .
* @param params
* @return
*/
int updateCode(Map<String, ?> params);
/** .
@ -248,6 +294,10 @@ public interface CodeMapper extends AbstractMapper {
return updateCode(params);
}
/** .
* @param params
* @return
*/
int reorderCodes(Map<String, ?> params);
/** .
@ -260,8 +310,19 @@ public interface CodeMapper extends AbstractMapper {
return reorderCodes(params().set("groupID", groupID).set("codes", codes));
}
/** .<br />
* .
* @param params
* @return
*/
int removeCodes(Map<String, ?> params);
/** .<br />
* .
* @param groupIDs
* @param codes
* @return
*/
default int removeCodes(String[] groupIDs, String[] codes) {
DataObject params = params()
.set("groupIDs", ifEmpty(groupIDs, () -> null))

@ -9,15 +9,15 @@ import cokr.xit.base.code.CommonCode;
import cokr.xit.foundation.data.DataObject;
/** .
* <ul><li>{@link #getCategoryList(int, int) }</li>
* <ul><li>{@link #getCategoryList(CodeQuery) }</li>
* <li>{@link #create(CodeCategory) }</li>
* <li>{@link #update(CodeCategory) }</li>
* <li>{@link #removeCategories(String...) }</li>
* <li>{@link #getGroupList(int, int) }</li>
* <li>{@link #getGroupList(CodeQuery) }</li>
* <li>{@link #create(CodeGroup) }</li>
* <li>{@link #update(CodeGroup) }</li>
* <li>{@link #removeGroups(String...) }</li>
* <li>{@link #getCodeList(String, int, int) }</li>
* <li>{@link #getCodeList(CodeQuery) }</li>
* <li>{@link #getCodesOf(String...) }</li>
* <li>{@link #create(CommonCode) }</li>
* <li>{@link #update(CommonCode) }</li>
@ -27,12 +27,20 @@ import cokr.xit.foundation.data.DataObject;
*/
public interface CodeService {
/** .
* @param pageNum
* @param fetchSize
* @param req
* <ul><li>pageNum: </li>
* <li>fetchSize: </li>
* </ul>
* @return
*/
List<DataObject> getCategoryList(CodeQuery req);
/** .
* @param categoryID
* @return
*/
DataObject getCategoryInfo(String categoryID);
/** .
* @param categoryIDs
* @return
@ -71,12 +79,22 @@ public interface CodeService {
int removeCategories(String... categoryIDs);
/** .
* @param pageNum
* @param fetchSize
* @param req
* <ul><li>categoryIDs: </li>
* <li>pageNum: </li>
* <li>fetchSize: </li>
* </ul>
* @return
*/
List<DataObject> getGroupList(CodeQuery req);
/** .
* @param categoryID
* @param groupID
* @return
*/
DataObject getGroupInfo(String categoryID, String groupID);
/** .
* @param groupIDs
* @return
@ -115,13 +133,22 @@ public interface CodeService {
int removeGroups(String... groupIDs);
/** .
* @param groupID
* @param pageNum
* @param fetchSize
* @param req
* <ul><li>groupIDs: </li>
* <li>pageNum: </li>
* <li>fetchSize: </li>
* </ul>
* @return
*/
List<DataObject> getCodeList(CodeQuery req);
/** .
* @param groupID
* @param code
* @return
*/
DataObject getCodeInfo(String groupID, String code);
/** , .<br />
* .
* @param groupID

@ -23,15 +23,23 @@ public class CodeBean extends AbstractComponent {
@Resource(name = "codeMapper")
private CodeMapper codeMapper;
/** .
* @param pageNum
* @param fetchSize
/** .<br />
* {@link cokr.xit.base.code.service.CodeService#getCategoryList(CodeQuery)}
* @param req
* @return
*/
public List<DataObject> getCategoryList(CodeQuery req) {
return codeMapper.getCategoryList(req.setOrderBy("CTGR_ID"));
}
/** .
* @param categoryID
* @return
*/
public DataObject getCategoryInfo(String categoryID) {
return codeMapper.getCategoryInfo(categoryID);
}
/** .
* @param categoryIDs
* @return
@ -84,15 +92,24 @@ public class CodeBean extends AbstractComponent {
return codeMapper.removeCategories(categoryIDs);
}
/** .
* @param pageNum
* @param fetchSize
* @return
/** .<br />
* {@link cokr.xit.base.code.service.CodeService#getGroupList(CodeQuery)}
* @param req
* @return
*/
public List<DataObject> getGroupList(CodeQuery req) {
return codeMapper.getGroupList(req.setOrderBy("GRP_ID"));
}
/** .
* @param categoryID
* @param groupID
* @return
*/
public DataObject getGroupInfo(String categoryID, String groupID) {
return codeMapper.getGroupInfo(categoryID, groupID);
}
/** .
* @param groupIDs
* @return
@ -145,16 +162,24 @@ public class CodeBean extends AbstractComponent {
return codeMapper.removeGroups(groupIDs);
}
/** .
* @param groupID
* @param pageNum
* @param fetchSize
/** .<br />
* {@link cokr.xit.base.code.service.CodeService#getCodeList(CodeQuery)}
* @param req
* @return
*/
public List<DataObject> getCodeList(CodeQuery req) {
return codeMapper.getCodeList(req.setOrderBy("GRP_ID, SRT_ORD, CODE"));
}
/** .
* @param groupID
* @param code
* @return
*/
public DataObject getCodeInfo(String groupID, String code) {
return codeMapper.getCodeInfo(groupID, code);
}
/** , .<br />
* .
* @param groupID

@ -29,6 +29,11 @@ public class CodeServiceBean extends AbstractServiceBean implements CodeService
return codeBean.getCategoryList(req);
}
@Override
public DataObject getCategoryInfo(String categoryID) {
return codeBean.getCategoryInfo(categoryID);
}
@Override
public List<CodeCategory> getCategories(String... categoryIDs) {
return codeBean.getCategories(categoryIDs);
@ -59,6 +64,11 @@ public class CodeServiceBean extends AbstractServiceBean implements CodeService
return codeBean.getGroupList(req);
}
@Override
public DataObject getGroupInfo(String categoryID, String groupID) {
return codeBean.getGroupInfo(categoryID, groupID);
}
@Override
public List<CodeGroup> getGroups(String... groupIDs) {
return codeBean.getGroups(groupIDs);
@ -89,6 +99,11 @@ public class CodeServiceBean extends AbstractServiceBean implements CodeService
return codeBean.getCodeList(req);
}
@Override
public DataObject getCodeInfo(String groupID, String code) {
return codeBean.getCodeInfo(groupID, code);
}
@Override
public List<CommonCode> getCodes(String groupID, String... codes) {
return codeBean.getCodes(groupID, codes);

@ -1,7 +1,5 @@
package cokr.xit.base.code.web;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
@ -13,7 +11,6 @@ import cokr.xit.base.code.CodeGroup;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.code.service.CodeQuery;
import cokr.xit.base.code.service.CodeService;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.web.AbstractController;
/** .<br />
@ -25,15 +22,8 @@ public class CodeController extends AbstractController {
@Resource(name="codeService")
private CodeService codeService;
/** .
* @return
*/
protected CodeService codeService() {
return codeService;
}
/** (code/code-main) .
* @return ModelAndView
/** .
* @return base/code/code-main
*/
@RequestMapping(name="공통코드 메인", value="/main.do")
public ModelAndView main() {
@ -42,12 +32,15 @@ public class CodeController extends AbstractController {
return mav.addObject("groupList", toJson(mav.getModel().remove("groupList")));
}
/** .
* @param pageNum
* @param fetchSize
* @return
* <pre><code>{
* "categoryList": [...]
/** .<br />
* {@link CodeService#getCategoryList(CodeQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "categoryList": [ ]
* "categoryStart":
* "categoryFetch":
* "categoryTotal":
* }</code></pre>
*/
@RequestMapping(name="코드 분류 목록", value="/category/list.do")
@ -62,8 +55,8 @@ public class CodeController extends AbstractController {
/** .
* @param categoryID
* @return
* <pre><code>{
* @return base/code/category-info
* <pre><code> {
* "categoryInfo": [...]
* }</code></pre>
*/
@ -71,18 +64,16 @@ public class CodeController extends AbstractController {
public ModelAndView getCategoryInfo(String categoryID) {
ModelAndView mav = new ModelAndView("base/code/category-info");
if (!isEmpty(categoryID)) {
List<DataObject> list = codeService.getCategoryList(new CodeQuery().setCategoryIDs(categoryID));
if (!list.isEmpty())
mav.addObject("categoryInfo", list.get(0));
mav.addObject("categoryInfo", codeService.getCategoryInfo(categoryID));
}
return mav;
}
/** .
* @param category
* @return
* <pre><code>{
* "saved": true || false
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 분류 등록", value="/category/create.do")
@ -93,9 +84,9 @@ public class CodeController extends AbstractController {
/** .
* @param category
* @return
* <pre><code>{
* "saved": true || false
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 분류 수정", value="/category/update.do")
@ -107,10 +98,10 @@ public class CodeController extends AbstractController {
/** .<br />
* , .
* @param categoryIDs
* @return
* <pre><code>{
* "affected": 1,
* "saved": true || false
* @return jsonView
* <pre><code> {
* "affected": ,
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 분류 삭제", value="/category/remove.do")
@ -121,12 +112,15 @@ public class CodeController extends AbstractController {
.addObject("saved", affected > 0);
}
/** .
* @param pageNum
* @param fetchSize
* @return
* <pre><code>{
* "groupList": [...]
/** .<br />
* {@link CodeService#getGroupList(CodeQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "groupList": [ ],
* "groupStart": ,
* "groupFetchTotal": ,
* "groupTotal":
* }</code></pre>
*/
@RequestMapping(name="코드 그룹 목록", value="/group/list.do")
@ -141,27 +135,25 @@ public class CodeController extends AbstractController {
/** .
* @param groupID
* @return
* <pre><code>{
* @return base/code/group-info
* <pre><code> {
* "groupInfo": {...}
* }</code></pre>
*/
@RequestMapping(name="코드 그룹 목록", value="/group/info.do")
@RequestMapping(name="코드 그룹 정보", value="/group/info.do")
public ModelAndView getGroupInfo(String groupID) {
ModelAndView mav = new ModelAndView("base/code/group-info");
if (!isEmpty(groupID)) {
List<DataObject> list = codeService.getCodeList(new CodeQuery().setGroupIDs(groupID));
if (!list.isEmpty())
mav.addObject("groupInfo", list.get(0));
mav.addObject("groupInfo", codeService.getGroupInfo(null, groupID));
}
return mav;
}
/** .
* @param group
* @return
* <pre><code>{
* "saved": true || false
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 그룹 등록", value="/group/create.do")
@ -172,9 +164,9 @@ public class CodeController extends AbstractController {
/** .
* @param group
* @return
* <pre><code>{
* "saved": true || false
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 그룹 수정", value="/group/update.do")
@ -186,10 +178,10 @@ public class CodeController extends AbstractController {
/** .<br />
* .
* @param groupIDs
* @return
* <pre><code>{
* "affected": 1,
* "saved": true || false
* @return jsonView
* <pre><code> {
* "affected": ,
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 그룹 제거", value="/group/remove.do")
@ -203,10 +195,10 @@ public class CodeController extends AbstractController {
/** .<br />
* .
* @param groupIDs
* @return
* <pre><code>{
* "코드그룹0": [...], // 그룹0의 공통코드 목록
* "코드그룹1": [...], // 그룹1의 공통코드 목록
* @return jsonView
* <pre><code> {
* "코드그룹0": [0 ],
* "코드그룹1": [1 ],
* ...
* }</code></pre>
*/
@ -216,17 +208,16 @@ public class CodeController extends AbstractController {
.addAllObjects(codeService.getCodesOf(groupIDs));
}
/** .
* @param groupID
* @param pageNum
* @param fetchSize
* @return
* <pre><code>{
/** .<br />
* {@link CodeService#getCodeList(CodeQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "groupID": "코드그룹0",
* "codeList": [...], // 그룹0의 공통코드 목록
* "codeStart": 0, // 공통코드 시작 위치
* "codeFetch": 10, // 한 번에 반환하는 공통코드 갯수
* "codeTotal": 50, // 조회 결과 공통코드 전체 갯수
* "codeList": [0 ],
* "codeStart": ,
* "codeFetch": ,
* "codeTotal":
* }</code></pre>
*/
@RequestMapping(name="그룹별 코드 목록", value="/list.do")
@ -242,8 +233,8 @@ public class CodeController extends AbstractController {
/** .
* @param groupID
* @param code
* @return
* <pre><code>{
* @return base/code/code-info
* <pre><code> {
* "codeInfo": {...}
* }</code></pre>
*/
@ -251,18 +242,16 @@ public class CodeController extends AbstractController {
public ModelAndView getCodeInfo(String groupID, String code) {
ModelAndView mav = new ModelAndView("base/code/code-info");
if (!isEmpty(groupID) && !isEmpty(code)) {
List<DataObject> list = codeService.getCodeList(new CodeQuery().setGroupIDs(groupID).setCodes(code));
if (!list.isEmpty())
mav.addObject("codeInfo", list.get(0));
mav.addObject("codeInfo", codeService.getCodeInfo(groupID, code));
}
return mav;
}
/** .
* @param commonCode
* @return
* <pre><code>{
* "saved": true || false
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 등록", value="/create.do")
@ -273,9 +262,9 @@ public class CodeController extends AbstractController {
/** .
* @param commonCode
* @return
* <pre><code>{
* "saved": true || false
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 수정", value="/update.do")
@ -287,10 +276,10 @@ public class CodeController extends AbstractController {
/** .
* @param groupID
* @param codes
* @return
* <pre><code>{
* "affected": ,
* "saved": true || false
* @return jsonView
* <pre><code> {
* "affected": ,
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 순서", value="/reorder.do")
@ -305,10 +294,10 @@ public class CodeController extends AbstractController {
* .
* @param groupID
* @param codes
* @return
* <pre><code>{
* "affected": ,
* "saved": true || false
* @return jsonView
* <pre><code> {
* "affected": ,
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name="코드 제거", value="/remove.do")

Loading…
Cancel
Save