实现公告获取和输出
This commit is contained in:
@@ -48,6 +48,9 @@ public class DataController {
|
||||
@Autowired
|
||||
private VUserfileService vUserfileService;
|
||||
|
||||
@Autowired
|
||||
private NoticeService noticeService;
|
||||
|
||||
@Resource
|
||||
private HttpServletRequest httpServletRequest;
|
||||
|
||||
@@ -172,4 +175,9 @@ public class DataController {
|
||||
throw new UserException(ResultEnum.ILLEGAL_ACCESS);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/home/findAllNotice")
|
||||
public List<TbNotice> findAllNotice(){
|
||||
return noticeService.findAll();
|
||||
}
|
||||
}
|
||||
|
||||
25
src/main/java/com/fjy/spring/domain/TbNotice.java
Normal file
25
src/main/java/com/fjy/spring/domain/TbNotice.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.fjy.spring.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class TbNotice {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Integer noticeid;
|
||||
|
||||
private Integer adminid;
|
||||
|
||||
@Column(name = "noticecontent")
|
||||
private String noticeContent;
|
||||
|
||||
@Column(name = "issuetime")
|
||||
private String issueTime;
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
/*@Configuration*/
|
||||
public class WebAppConfig implements WebMvcConfigurer {
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.fjy.spring.repository;
|
||||
|
||||
import com.fjy.spring.domain.TbNotice;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TbNoticeRepository extends JpaRepository<TbNotice,Integer> {
|
||||
|
||||
}
|
||||
20
src/main/java/com/fjy/spring/service/NoticeService.java
Normal file
20
src/main/java/com/fjy/spring/service/NoticeService.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.fjy.spring.service;
|
||||
|
||||
import com.fjy.spring.domain.TbNotice;
|
||||
import com.fjy.spring.repository.TbNoticeRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class NoticeService {
|
||||
|
||||
@Autowired
|
||||
private TbNoticeRepository noticeRepository;
|
||||
|
||||
public List<TbNotice> findAll(){
|
||||
return noticeRepository.findAll();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -93,6 +93,20 @@ var Main = {
|
||||
activeName: 'login',
|
||||
fileList: [],
|
||||
DownloadList: [],
|
||||
NoticeList:[
|
||||
{
|
||||
noticeid: 1,
|
||||
adminid: 1,
|
||||
noticeContent: "系统正式上线,Alpha测试版",
|
||||
issueTime: "2018-2-26 11:00"
|
||||
},
|
||||
{
|
||||
noticeid: 2,
|
||||
adminid: 1,
|
||||
noticeContent: "系统,测试",
|
||||
issueTime: "2018-2-26 11:13"
|
||||
}
|
||||
],
|
||||
VersionList:[
|
||||
{
|
||||
date:'2018-02-24',
|
||||
@@ -371,6 +385,15 @@ var Main = {
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
axios.get(getRootPath_web()+'/home/findAllNotice')
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
that.NoticeList = response.data;
|
||||
//that.limitTime = response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -257,36 +257,12 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="grid-content">
|
||||
<el-card class="box-card hidden-xs-only">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>作业提交倒计时</span>
|
||||
<span style="color: red"> 功能未完成</span>
|
||||
</div>
|
||||
<div class="text item">
|
||||
<el-table :data="tableHomeworkData" style="width: 100%"
|
||||
:default-sort="{prop: 'coursename', order: 'descending'}">
|
||||
<el-table-column prop="coursename" label="科目" sortable width="180">
|
||||
</el-table-column>
|
||||
<el-table-column label="倒计时" sortable>
|
||||
<template slot-scope="scope">
|
||||
{{limitTime(scope.row)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card th:include="dist/thymeleaf/layout :: timelimit"></el-card>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-card class="box-card hidden-xs-only">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>公告</span>
|
||||
</div>
|
||||
<div v-for="o in 4" :key="o" class="text item">
|
||||
{{'公告内容 ' + o }}
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card th:include="dist/thymeleaf/layout :: notice"></el-card>
|
||||
<!--<template>
|
||||
<el-table :data="tableData3" style="width: 100%">
|
||||
<el-table-column label="公告">
|
||||
|
||||
Reference in New Issue
Block a user