use of com.akaxin.site.storage.bean.UicBean in project openzaly by akaxincom.
the class HttpUICService method list.
/**
* 分页获取UIC
*
* @param command
* @return
*/
public CommandResponse list(Command command) {
CommandResponse commandResponse = new CommandResponse();
ErrorCode2 errCode = ErrorCode2.ERROR;
try {
HaiUicListProto.HaiUicListRequest request = HaiUicListProto.HaiUicListRequest.parseFrom(command.getParams());
int pageNum = request.getPageNumber();
int pageSize = request.getPageSize();
int status = request.getStatusValue();
LogUtils.requestDebugLog(logger, command, request.toString());
List<UicBean> uicList = SiteUicDao.getInstance().getUicList(pageNum, pageSize, status);
if (uicList != null) {
HaiUicListProto.HaiUicListResponse.Builder responseBuilder = HaiUicListProto.HaiUicListResponse.newBuilder();
for (UicBean bean : uicList) {
responseBuilder.addUicInfo(getUicInfo(bean));
}
commandResponse.setParams(responseBuilder.build().toByteArray());
errCode = ErrorCode2.SUCCESS;
}
} catch (Exception e) {
errCode = ErrorCode2.ERROR_SYSTEMERROR;
LogUtils.requestErrorLog(logger, command, e);
}
return commandResponse.setErrCode2(errCode);
}
use of com.akaxin.site.storage.bean.UicBean in project openzaly by akaxincom.
the class UserUic method updateUicUsed.
public boolean updateUicUsed(String uic, String siteUserId) {
UicBean bean = new UicBean();
bean.setUic(uic);
bean.setSiteUserId(siteUserId);
bean.setStatus(UicProto.UicStatus.USED_VALUE);
bean.setUseTime(System.currentTimeMillis());
return SiteUicDao.getInstance().updateUic(bean);
}
use of com.akaxin.site.storage.bean.UicBean in project openzaly by akaxincom.
the class SQLiteJDBCManager method initAdminUic.
private static void initAdminUic(String uic) {
boolean result = false;
try {
UicBean bean = new UicBean();
bean.setUic(uic);
bean.setStatus(UicProto.UicStatus.UNUSED_VALUE);
bean.setCreateTime(System.currentTimeMillis());
result = SQLiteUICDao.getInstance().addUIC(bean);
} catch (SQLException e) {
logger.warn("add new uic to db error,you can ignore it");
}
if (result) {
logger.info("init addmin uic success");
} else {
logger.warn("init admin uic fail");
}
}
Aggregations