Skip to content

Commit

Permalink
Merge pull request #376 from oblivion14/develop
Browse files Browse the repository at this point in the history
ContextModel 조회시 정렬방식 적용
  • Loading branch information
oblivion14 authored Feb 10, 2017
2 parents e1f8bdb + 04a74fe commit ee1afc1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class ContextModel {
private List<String> domainIdList;
private List<String> contextInformationIdList;
private String contextType;
private String createTime;
private String modifiedTime;
private long createTime;
private long modifiedTime;
private String occTime;

public ContextModel() {
Expand All @@ -35,7 +35,7 @@ public ContextModel(String id, String name, List<String> domainIdList, List<Stri
this.contextType = contextType;
}

public ContextModel(String id, String name, List<String> domainIdList, List<String> contextInformationIdList, String contextType, String createTime, String modifiedTime) {
public ContextModel(String id, String name, List<String> domainIdList, List<String> contextInformationIdList, String contextType, long createTime, long modifiedTime) {
this.id = id;
this.name = name;
this.domainIdList = domainIdList;
Expand Down Expand Up @@ -85,19 +85,19 @@ public void setContextType(String contextType) {
this.contextType = contextType;
}

public String getCreateTime() {
public long getCreateTime() {
return createTime;
}

public void setCreateTime(String createTime) {
public void setCreateTime(long createTime) {
this.createTime = createTime;
}

public String getModifiedTime() {
public long getModifiedTime() {
return modifiedTime;
}

public void setModifiedTime(String modifiedTime) {
public void setModifiedTime(long modifiedTime) {
this.modifiedTime = modifiedTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public String registerContextModel(ContextModel contextModel){
// ContextModelStore contextModelStore = ContextModelMapStore.getInstance();
//ContextModelExProxy contextModelExProxy = ContextModelSDAProxy.newContextModelProxy();


long time = System.currentTimeMillis();
contextModel.setCreateTime(time);
contextModel.setModifiedTime(time);

contextModelStore.createContextModel(contextModel);
//contextModelExProxy.registerContextModel(contextModel);
String contextModelResultMessage = responseMessage.contextModelResultMessage(contextModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
Expand Down Expand Up @@ -34,7 +35,7 @@ public void createContextModel(ContextModel contextModel) {
//NOTE: CM 리스트 조회
@Override
public List<ContextModel> retrieveContextModelList() {
List<ContextModelDataObject> contextModelDataObjectList = contextModelRepository.findAll();
List<ContextModelDataObject> contextModelDataObjectList = contextModelRepository.findAll(new Sort(Sort.Direction.DESC,"createTime"));
List<ContextModel> contextModelList = new ArrayList<>();
for(ContextModelDataObject contextModelDataObject : contextModelDataObjectList){
logger.debug("ContextModel = " + dataObjectToContextModel(contextModelDataObject));
Expand Down

0 comments on commit ee1afc1

Please sign in to comment.