Skip to content

Commit f731a08

Browse files
committed
增加联系人框
1 parent 8f6b44b commit f731a08

File tree

11 files changed

+505
-29
lines changed

11 files changed

+505
-29
lines changed

profile/nbs.db

8 KB
Binary file not shown.

src/main/java/com/nbs/biz/dao/NBSTableDao.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public void createNbsContacts(){
2929
session.update("createNbsContacts");
3030
}
3131

32+
public void createNbsMessage(){
33+
session.update("createNbsMessage");
34+
}
35+
3236

3337
public List<NBSTest> findAll(){
3438
return session.selectList("findAll");

src/main/java/com/nbs/biz/service/TableService.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ public void initNbsContacts(){
2929
}
3030
}
3131

32+
public void initNBSMessage(Boolean clear){
33+
String tbNBSMessage = "nbs_message";
34+
boolean b = dao.tableExist(tbNBSMessage);
35+
if(b&&clear){
36+
//清空表数据
37+
}else {
38+
dao.createNbsMessage();
39+
}
40+
}
3241
public List<NBSTest> getAll(){
3342
return dao.findAll();
3443
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package com.nbs.entity;
2+
3+
/**
4+
* @Package : com.nbs.entity
5+
* @Description : <p></p>
6+
* @Author : lambor.c
7+
* @Date : 2018/6/23-22:44
8+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
9+
* All rights reserved.
10+
*/
11+
public class ContactsItem implements Comparable<ContactsItem>{
12+
private String hash;
13+
private String name;
14+
private String type;
15+
16+
private ContactsItem(String hash) {
17+
this.hash = hash;
18+
this.type = TYPE.p.toString();
19+
}
20+
21+
public ContactsItem(String hash, String name) {
22+
this.hash = hash;
23+
this.name = name;
24+
this.type = TYPE.p.toString();
25+
}
26+
27+
public ContactsItem(String hash, String name, String type) {
28+
this.hash = hash;
29+
this.name = name;
30+
this.type = type;
31+
}
32+
33+
public String getHash() {
34+
return hash;
35+
}
36+
37+
public void setHash(String hash) {
38+
this.hash = hash;
39+
}
40+
41+
public String getName() {
42+
return name;
43+
}
44+
45+
public void setName(String name) {
46+
this.name = name;
47+
}
48+
49+
public String getType() {
50+
return type;
51+
}
52+
53+
public void setType(String type) {
54+
this.type = type;
55+
}
56+
57+
@Override
58+
public int compareTo(ContactsItem o) {
59+
return 0;
60+
}
61+
62+
/**
63+
* 群、点
64+
*/
65+
public static enum TYPE{
66+
p,q;
67+
}
68+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.nbs.ui;
2+
3+
/**
4+
* @Package : com.nbs.ui
5+
* @Description :
6+
* <p>头像</p>
7+
* @Author : lambor.c
8+
* @Date : 2018/6/23-23:21
9+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
10+
* All rights reserved.
11+
*/
12+
public abstract class AvatarViewHolder extends ViewHolder {
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.nbs.ui;
2+
3+
import javax.swing.*;
4+
5+
/**
6+
* @Package : com.nbs.ui
7+
* @Description : <p></p>
8+
* @Author : lambor.c
9+
* @Date : 2018/6/23-23:18
10+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
11+
* All rights reserved.
12+
*/
13+
public abstract class ViewHolder extends JPanel {
14+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.nbs.ui.adapter;
2+
3+
import com.nbs.ui.AvatarViewHolder;
4+
import com.nbs.ui.ViewHolder;
5+
6+
/**
7+
* @Package : com.nbs.ui.adapter
8+
* @Description : <p></p>
9+
* @Author : lambor.c
10+
* @Date : 2018/6/23-23:17
11+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
12+
* All rights reserved.
13+
*/
14+
public abstract class BaseAdapter<T extends ViewHolder> {
15+
/**
16+
* 返回数量
17+
* @return
18+
*/
19+
public int getCount(){return 0;}
20+
21+
public abstract T onCreateViewHolder(int viewType);
22+
23+
24+
public AvatarViewHolder onCreateHeaderViewHolder(int viewType,int postion){
25+
return null;
26+
}
27+
28+
public int getItemViewType(int position){
29+
return 0;
30+
}
31+
32+
public abstract void onBindViewHolder(T viewHolder,int position);
33+
34+
public void onBindHeaderViewHolder(AvatarViewHolder viewHolder,int position){
35+
36+
}
37+
}

0 commit comments

Comments
 (0)