Package com.lgx8.util

Examples of com.lgx8.util.IdGenerator


  /**
   * @param args
   */
  public static void main(String[] args) {
    User user = new User();
    user.setUsername("czt");
    user.setPassword("czt");
    user.setEmail("www15119258@qq.com");
    user.setRegistertime(new Date());
    user.setLastlogin(new Date());
    user.setNickname("苍之涛");
    user.setTruename("李晖");
    user.setSex(User.SEX_NULL);
    user.setIp("127.0.0.1");
    user.setMobile("15015531354");
   
   
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
   
    IUserCardService userCardService = (IUserCardService) ac.getBean("userCardService");
//    userCardService.createUser(user);
//   
    user = userCardService.findUser("username", "czt");
   
    System.out.println(user.getCard().getScore());
   
//    IConfigDao dao = (IConfigDao) ac.getBean("configDao");
//    System.out.println(dao.findGatewayConfig());
   
  }
View Full Code Here


    this.xfhy = xfhy;
  }
  public String toJSON() {
    JSONObject jObj = new JSONObject();
    Merchant _mr = getMerchant();
    User _u = getXfhy();
    try {
      jObj.put("id", getID());
      jObj.put("xfsjmc", _mr==null?"":_mr.getSJMC());
      jObj.put("hyxm", _u==null?"":_u.getUsername());
      jObj.put("hynickName", _u==null?"":_u.getTruename());
      jObj.put("hych", _u==null?"":(_u.getCard()==null?"":_u.getCard().getId()));
      jObj.put("xfje", getXFJE());
      jObj.put("zsjf", getHDJFS());
      jObj.put("xfsj", getXFSJ());
      //jObj.put("", arg1)
    } catch (JSONException e) {
View Full Code Here

  }
 
  public String toJSON(){
    JSONObject jObj = new JSONObject();
    Merchant _m = getMerchant();
    User _czyh = getCZYHBH();
    User _u = getCZQDR();
    try {
      jObj.put("id", getID());
      jObj.put("user_id", _czyh!=null?"":_czyh.getId());
      jObj.put("user_name", _czyh==null?"":_czyh.getUsername());
      jObj.put("merchat_id", _m==null?"":_m.getID());
      jObj.put("m_name", _m==null?"":_m.getSJMC());
      jObj.put("czlx", changetoCN(getRESERVATION01()));
      jObj.put("czje", getCZJE());
      jObj.put("dhjf", getCZDHJFS());
      jObj.put("czsj", getCZSJ());
      jObj.put("czzt", changeToCN(getCzzt()));
      jObj.put("czqdr", _u==null?"":_u.getUsername());
      jObj.put("czqrrq", getCzqdrq());
    } catch (JSONException e) {
      e.printStackTrace();
    }
    return jObj.toString();
View Full Code Here

    car.setScore(score);
    car.setPassword(password);
    this.getHibernateTemplate().persist(car);
   
    String md5Passwd = EncryptUtil.toMD5(password);
    User user = new User();
    user.setPassword(md5Passwd);
    user.setLocked(false);
    user.setEnabled(true);
    user.setOpener(opener);
    user.setParent(parent);
    user.setUsertype(usertype);
    user.setParenttype(parenttype);
    user.setOrganizationid(organizationid);
    user.setRegistertime(new Date());
    user.setCard(car);
    user.setUsername(card);
    user.setLastlogin(new Date());
    if(mobile != null && !"".equals(mobile))
      user.setMobile(mobile);
    if(email != null && !"".equals(email))
      user.setEmail(email);
    this.getHibernateTemplate().persist(user);

    return car;
  }
View Full Code Here

    String name = request.getParameter("name");
    String st_time = request.getParameter("st_time");
    String ed_time = request.getParameter("ed_time");
    String str_curPage = request.getParameter("curPage");
    int curPage = Integer.parseInt(str_curPage==null?"1":str_curPage);
    User user = RunTimeUser.getRunTimeUser(request);
    if(user.getUsertype()==User.USER_TYPE_MERCHANT){
      long m_id = user.getOrganizationid();
      if(m_id!=0){
        Merchant m = merchantDao.getMerchantById(m_id);
        name = m.getSJMC();
      }
    }
View Full Code Here

    user.setMobile("15015531354");
   
   
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
   
    IUserCardService userCardService = (IUserCardService) ac.getBean("userCardService");
//    userCardService.createUser(user);
//   
    user = userCardService.findUser("username", "czt");
   
    System.out.println(user.getCard().getScore());
   
//    IConfigDao dao = (IConfigDao) ac.getBean("configDao");
//    System.out.println(dao.findGatewayConfig());
View Full Code Here

import util.IDGenerator.IDStrategy;

public class IDGeneratorTest {

  public static void Test1() throws DecoderException, NoSuchAlgorithmException, UnsupportedEncodingException{
    IDGenerator generator = new IDGenerator();
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
  }
View Full Code Here

    System.out.println(generator.getNextID(null, IDStrategy.SEQUENTIAL));
  }
 
 
  public static void Test2() throws DecoderException, NoSuchAlgorithmException, UnsupportedEncodingException{
    IDGenerator generator = new IDGenerator();
    System.out.println(generator.getNextID("ben", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("alice", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("bob", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("dirk", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("george", IDStrategy.RANDOM));
    System.out.println(generator.getNextID("jimmy", IDStrategy.RANDOM));
  }
View Full Code Here

    // publish the root scope where all videos will be published
    String rootScopeStr = "1111111111111111";
        ByteIdentifier rootId = new ByteIdentifier(Hex.decodeHex(rootScopeStr.toCharArray()));
        rootScope = new ScopeID(rootId);
        client.publishRootScope(rootId, strategy, null);
        rootGenerator = new IDGenerator();
        videoPublisher = new VideoPublisher(client, rootScope, strategy);
        // publish the catalog.
    videoPublisher.publishCatalog();
    ridMappings = new HashMap<String, String>();
View Full Code Here

    // publish the root scope where all videos will be published
    String rootScopeStr = "1111111111111111";
    ByteIdentifier rootId = new ByteIdentifier(Hex.decodeHex(rootScopeStr.toCharArray()));
    rootScope = new ScopeID(rootId);
    client.publishRootScope(rootId, strategy, null);
    rootGenerator = new IDGenerator();
    videoPublisher = new VideoPublisher(client, rootScope, strategy);
    // publish the catalog.
    videoPublisher.publishCatalog();
    ridMappings = new HashMap<String, String>();
    listMappings = new HashMap<Integer, String>();
View Full Code Here

TOP

Related Classes of com.lgx8.util.IdGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.