parent
a024c69641
commit
80f7b5dde6
@ -0,0 +1,80 @@ |
||||
package db.model.bilibili; |
||||
|
||||
import db.annotation.Aliyun; |
||||
import db.model.AbstractModel; |
||||
|
||||
import javax.persistence.*; |
||||
import java.io.Serializable; |
||||
import java.util.Objects; |
||||
|
||||
@Aliyun |
||||
@Entity |
||||
@Table(name = "word") |
||||
public class WordModel extends AbstractModel { |
||||
private int id; |
||||
private String courseName; |
||||
private String kana; |
||||
private String chinese; |
||||
|
||||
@Id |
||||
@Column(name = "id", nullable = false) |
||||
public int getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
@Basic |
||||
@Column(name = "course_name", nullable = false, length = 32) |
||||
public String getCourseName() { |
||||
return courseName; |
||||
} |
||||
|
||||
public void setCourseName(String courseName) { |
||||
this.courseName = courseName; |
||||
} |
||||
|
||||
@Basic |
||||
@Column(name = "kana", nullable = false, length = 32) |
||||
public String getKana() { |
||||
return kana; |
||||
} |
||||
|
||||
public void setKana(String kana) { |
||||
this.kana = kana; |
||||
} |
||||
|
||||
@Basic |
||||
@Column(name = "chinese", nullable = true, length = 32) |
||||
public String getChinese() { |
||||
return chinese; |
||||
} |
||||
|
||||
public void setChinese(String chinese) { |
||||
this.chinese = chinese; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object o) { |
||||
if (this == o) return true; |
||||
if (o == null || getClass() != o.getClass()) return false; |
||||
WordModel wordModel = (WordModel) o; |
||||
return id == wordModel.id && |
||||
Objects.equals(courseName, wordModel.courseName) && |
||||
Objects.equals(kana, wordModel.kana) && |
||||
Objects.equals(chinese, wordModel.chinese); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
|
||||
return Objects.hash(id, courseName, kana, chinese); |
||||
} |
||||
|
||||
@Override |
||||
public Serializable primaryKey() { |
||||
return getId(); |
||||
} |
||||
} |
@ -1,20 +1,36 @@ |
||||
--菜单表 |
||||
#菜单表 |
||||
create table menu |
||||
( |
||||
id int auto_increment--自增主键 |
||||
primary key, |
||||
href varchar(32) not null,--菜单超链接 |
||||
menu_name varchar(10) not null,--菜单名 |
||||
icon varchar(20) null,--菜单图标 |
||||
parent_id int not null,--父菜单id |
||||
menu_level int not null,--菜单树深度 |
||||
sort int not null,--排序 |
||||
constraint menu_href_uindex |
||||
unique (href) |
||||
id int auto_increment,#自增主键 |
||||
href varchar(32) not null,#菜单超链接 |
||||
menu_name varchar(10) not null,#菜单名 |
||||
icon varchar(20) null,#菜单图标 |
||||
parent_id int not null,#父菜单id |
||||
menu_level int not null,#菜单树深度 |
||||
sort int not null,#排序 |
||||
constraint menu_href_uindex unique (href) |
||||
) |
||||
engine=InnoDB |
||||
; |
||||
--thrift服务器表 |
||||
create |
||||
|
||||
|
||||
alter table menu add primary key(id); |
||||
#thrift服务器表 |
||||
create table thrift |
||||
( |
||||
ip varchar(15), |
||||
port int not null, |
||||
timeout int default 3000 |
||||
); |
||||
ALTER TABLE thrift ADD PRIMARY KEY (ip, port ); |
||||
#数据源表 |
||||
create table datasource |
||||
( |
||||
db_id varchar(32) not null, |
||||
hostname varchar(32) not null, |
||||
db_port int(5) not null, |
||||
username varchar(10) not null, |
||||
db_password varchar(10) not null, |
||||
db_name varchar(10) not null, |
||||
annotation varchar(32) not null, |
||||
db_desc varchar(20) null |
||||
) |
||||
; |
||||
ALTER TABLE datasource ADD PRIMARY KEY (db_id); |
@ -1,13 +1,8 @@ |
||||
package web.controller; |
||||
|
||||
import db.form.DBAction; |
||||
import db.model.AbstractModel; |
||||
import web.service.BiliService; |
||||
|
||||
public abstract class BiliController<T extends AbstractModel> extends BaseController<T,T,BiliService>{ |
||||
|
||||
@Override |
||||
protected boolean checkAction(DBAction action) { |
||||
return false; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,11 @@ |
||||
package web.controller; |
||||
|
||||
import db.model.bilibili.WordModel; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
||||
@Controller |
||||
@RequestMapping("/word") |
||||
public class WordController extends BiliController<WordModel> { |
||||
|
||||
} |
Loading…
Reference in new issue