前端添加目录和课程,编辑
@ -1,21 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client;
|
|
||||||
|
|
||||||
import com.zhiyun.zhiyun03.client.course.CourseLeftPanel;
|
|
||||||
import com.zhiyun.zhiyun03.client.course.CourseRightPanel;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
|
|
||||||
public class ClientBelowPanel extends JPanel {
|
|
||||||
|
|
||||||
|
|
||||||
public ClientBelowPanel(){
|
|
||||||
super();
|
|
||||||
setSize(1200,650);
|
|
||||||
|
|
||||||
}
|
|
||||||
public void paint(Graphics g){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 全局数据
|
|
||||||
*/
|
|
||||||
public class ClientData {
|
|
||||||
public static final int CLIENT_LEFT_PANEL_WIDTH=160;
|
|
||||||
public static final int CLIENT_LEFT_PANEL_HEIGHT=650;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client;
|
|
||||||
|
|
||||||
import com.zhiyun.zhiyun03.client.course.CourseLeftPanel;
|
|
||||||
import com.zhiyun.zhiyun03.client.course.CourseRightPanel;
|
|
||||||
import com.zhiyun.zhiyun03.course.entity.Course;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
public class ClientFrame extends JFrame {
|
|
||||||
//上半部分面板
|
|
||||||
ClientUpperPanel upperPanel=new ClientUpperPanel();
|
|
||||||
//下半部分面板
|
|
||||||
ClientBelowPanel belowPanel=new ClientBelowPanel();
|
|
||||||
//下半部分左边面板
|
|
||||||
ClientLeftPanel leftPanel=new ClientLeftPanel();
|
|
||||||
//下半部分右边面板
|
|
||||||
ClientRightPanel rightPanel=new ClientRightPanel();
|
|
||||||
|
|
||||||
//菜单
|
|
||||||
JMenuBar jMenuBar=new JMenuBar();
|
|
||||||
|
|
||||||
public ClientFrame(){
|
|
||||||
|
|
||||||
// JMenu jMenu1=new JMenu("首页");
|
|
||||||
// JMenu jMenu2=new JMenu("课程中心");
|
|
||||||
// JMenu jMenu3=new JMenu("应用中心");
|
|
||||||
// JMenu jMenu4=new JMenu("大赛中心");
|
|
||||||
// JMenu jMenu5=new JMenu("考证中心");
|
|
||||||
// JMenu jMenu6=new JMenu("学术中心");
|
|
||||||
// JMenu jMenu7=new JMenu("知识分享");
|
|
||||||
// JMenu jMenu8=new JMenu("下载中心");
|
|
||||||
// JMenu jMenu9=new JMenu("就业中心");
|
|
||||||
// JMenu jMenu10=new JMenu("服务相关");
|
|
||||||
//
|
|
||||||
// jMenuBar.add(jMenu1);
|
|
||||||
// jMenuBar.add(jMenu2);
|
|
||||||
// jMenuBar.add(jMenu3);
|
|
||||||
// jMenuBar.add(jMenu4);
|
|
||||||
// jMenuBar.add(jMenu5);
|
|
||||||
// jMenuBar.add(jMenu6);
|
|
||||||
// jMenuBar.add(jMenu7);
|
|
||||||
// jMenuBar.add(jMenu8);
|
|
||||||
// jMenuBar.add(jMenu9);
|
|
||||||
// jMenuBar.add(jMenu10);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
super.setTitle("天择教育科技");
|
|
||||||
URL resource = ClientFrame.class.getClassLoader().getResource("0.png");
|
|
||||||
Image image=new ImageIcon(resource).getImage();
|
|
||||||
super.setIconImage(image);
|
|
||||||
super.setSize(1200,800);
|
|
||||||
super.setResizable(false);
|
|
||||||
super.setLocationRelativeTo(null);
|
|
||||||
super.add(leftPanel);
|
|
||||||
super.add(upperPanel);
|
|
||||||
super.add(jMenuBar,BorderLayout.NORTH);
|
|
||||||
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
||||||
super.setVisible(true);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class ClientLeftPanel extends JPanel {
|
|
||||||
BufferedImage[] images=new BufferedImage[4];
|
|
||||||
public ClientLeftPanel(){
|
|
||||||
super.setSize(ClientData.CLIENT_LEFT_PANEL_WIDTH,ClientData.CLIENT_LEFT_PANEL_HEIGHT);
|
|
||||||
for (int i = 0; i <images.length; i++) {
|
|
||||||
try {
|
|
||||||
images[i]= ImageIO.read(new File("src/main/java/com/zhiyun/zhiyun03/client/images/directory/"+i+".jpg"));
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void paint(Graphics g){
|
|
||||||
for (int i = 0; i < images.length; i++) {
|
|
||||||
g.drawImage(images[i],43,80+i*35,images[i].getWidth(),images[i].getHeight(),null);
|
|
||||||
}
|
|
||||||
g.drawString("经济学",57,80);
|
|
||||||
g.drawString("理学",57,115);
|
|
||||||
g.drawString("工学",57,150);
|
|
||||||
g.drawString("管理学",57,185);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主面板
|
|
||||||
*/
|
|
||||||
public class ClientPanel extends JPanel {
|
|
||||||
|
|
||||||
|
|
||||||
public ClientPanel(){
|
|
||||||
super.setSize(1200,800);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
|
|
||||||
public class ClientRightPanel extends JPanel {
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class ClientUpperPanel extends JPanel {
|
|
||||||
|
|
||||||
BufferedImage[] images=new BufferedImage[10];
|
|
||||||
public ClientUpperPanel(){
|
|
||||||
super();
|
|
||||||
setSize(1200,110);
|
|
||||||
try {
|
|
||||||
for (int i = 0; i <images.length; i++) {
|
|
||||||
images[i] = ImageIO.read(new File("src/main/java/com/zhiyun/zhiyun03/client/images/navigation/"+i+".jpg"));
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void paint(Graphics g) {
|
|
||||||
for (int i = 0; i < images.length; i++) {
|
|
||||||
g.drawImage(images[i],30+i*116,0,images[i].getWidth(),images[i].getHeight(),null);
|
|
||||||
}
|
|
||||||
g.drawString("首页",60,87);
|
|
||||||
g.drawString("课程中心",163,87);
|
|
||||||
g.drawString("应用中心",280,87);
|
|
||||||
g.drawString("大赛中心",400,87);
|
|
||||||
g.drawString("考证中心",516,87);
|
|
||||||
g.drawString("学术中心",634,87);
|
|
||||||
g.drawString("知识共享",750,87);
|
|
||||||
g.drawString("下载中心",866,87);
|
|
||||||
g.drawString("就业中心",982,87);
|
|
||||||
g.drawString("服务相关",1098,87);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SwingUtilities.invokeLater(()->new ClientFrame());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client.course;
|
|
||||||
|
|
||||||
import com.zhiyun.zhiyun03.application.entity.Directory;
|
|
||||||
import com.zhiyun.zhiyun03.application.service.ApplicationService;
|
|
||||||
import com.zhiyun.zhiyun03.application.service.impl.ApplicationServiceImpl;
|
|
||||||
import com.zhiyun.zhiyun03.client.ClientData;
|
|
||||||
import com.zhiyun.zhiyun03.course.mapper.CourseMapper;
|
|
||||||
import com.zhiyun.zhiyun03.course.service.CourseService;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class CourseLeftPanel extends JPanel {
|
|
||||||
|
|
||||||
BufferedImage[] images=new BufferedImage[4];
|
|
||||||
public CourseLeftPanel(){
|
|
||||||
super.setSize(ClientData.CLIENT_LEFT_PANEL_WIDTH,ClientData.CLIENT_LEFT_PANEL_HEIGHT);
|
|
||||||
for (int i = 0; i < images.length; i++) {
|
|
||||||
try {
|
|
||||||
images[i]= ImageIO.read(new File("src/main/java/com/zhiyun/zhiyun03/client/course/images/directory/"+i+".jpg"));
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void paint(Graphics g){
|
|
||||||
for (int i = 0; i < images.length; i++) {
|
|
||||||
g.drawImage(images[i],43,80+i*35,images[i].getWidth(),images[i].getHeight(),null);
|
|
||||||
}
|
|
||||||
g.drawString("经济学",57,80);
|
|
||||||
g.drawString("理学",57,115);
|
|
||||||
g.drawString("工学",57,150);
|
|
||||||
g.drawString("管理学",57,165);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
package com.zhiyun.zhiyun03.client.course;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
|
|
||||||
public class CourseRightPanel extends JPanel {
|
|
||||||
}
|
|
Before Width: | Height: | Size: 447 B |
Before Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 459 B |
Before Width: | Height: | Size: 526 B |
Before Width: | Height: | Size: 542 B |
Before Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 447 B |
Before Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 459 B |
Before Width: | Height: | Size: 526 B |
Before Width: | Height: | Size: 542 B |
Before Width: | Height: | Size: 410 B |
@ -0,0 +1,22 @@
|
|||||||
|
package com.zhiyun.zhiyun03.course.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DirectoryVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value ="id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目录名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "dir_name")
|
||||||
|
private String dirName;
|
||||||
|
|
||||||
|
}
|
Before Width: | Height: | Size: 15 KiB |
@ -1,8 +1,36 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.zhiyun.zhiyun03.application.mapper.DirectoryMapper">
|
<mapper namespace="com.zhiyun.zhiyun03.application.mapper.DirectoryMapper">
|
||||||
|
<insert id="addCourseDirectory">
|
||||||
|
|
||||||
|
insert into directory (id,dir_name,dir_img,dir_iden,dir_addtime) values (#{id},#{dirName},#{dirImg},3,#{dirAddtime})
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
<insert id="addDownloadDirectory">
|
||||||
|
insert into directory (id,dir_name,dir_img,dir_iden,dir_addtime) values (#{id},#{dirName},#{dirImg},5,#{dirAddtime})
|
||||||
|
</insert>
|
||||||
|
<insert id="addInviteDirectory">
|
||||||
|
insert into directory (id,dir_name,dir_img,dir_iden,dir_addtime) values (#{id},#{dirName},#{dirImg},7,#{dirAddtime})
|
||||||
|
</insert>
|
||||||
|
<insert id="addServiceDirectory">
|
||||||
|
insert into directory (id,dir_name,dir_img,dir_iden,dir_addtime) values (#{id},#{dirName},#{dirImg},9,#{dirAddtime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
<select id="selectByName" resultType="java.lang.Integer">
|
<select id="selectByName" resultType="java.lang.Integer">
|
||||||
select id from directory where dir_name =#{dirName}
|
select id from directory where dir_name =#{dirName} and dir_iden = #{dirIden}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryCourseDirectory" resultType="com.zhiyun.zhiyun03.course.vo.DirectoryVo">
|
||||||
|
select dir_name from directory where dir_iden = 3
|
||||||
</select>
|
</select>
|
||||||
|
<select id="queryDownloadDirectory" resultType="com.zhiyun.zhiyun03.course.vo.DirectoryVo">
|
||||||
|
select dir_name from directory where dir_iden = 5
|
||||||
|
</select>
|
||||||
|
<select id="queryInviteDirectory" resultType="com.zhiyun.zhiyun03.course.vo.DirectoryVo">
|
||||||
|
select dir_name from directory where dir_iden = 7
|
||||||
|
</select>
|
||||||
|
<select id="queryServiceDirectory" resultType="com.zhiyun.zhiyun03.course.vo.DirectoryVo">
|
||||||
|
select dir_name from directory where dir_iden = 9
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|