创建 AdminLendItemController
@Api(tags = "标的的投资")
@RestController
@RequestMapping("/admin/core/lendItem")
@Slf4j
public class AdminLendItemController {
@Resource
private LendItemService lendItemService;
@ApiOperation("获取列表")
@GetMapping("/list/{lendId}")
public R list(
@ApiParam(value = "标的id", required = true)
@PathVariable Long lendId) {
List list = lendItemService.selectByLendId(lendId);
return R.ok().data("list", list);
}
}
接口:LendItemService
List
selectByLendId(Long lendId);
实现:LendItemServiceImpl
@Override
public List selectByLendId(Long lendId) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("lend_id", lendId);
List lendItemList = baseMapper.selectList(queryWrapper);
return lendItemList;
}
api/core/lend-item.js
import request from '@/utils/request'
export default {
getList(lendId) {
return request({
url: `/admin/core/lendItem/list/` + lendId,
method: 'get'
})
}
}
views/core/lend/detail.vue
import lendItemApi from '@/api/core/lend-item'
data() {
return {
......,
lendItemList: [] //投资列表
}
},
created() {
if (this.$route.params.id) {
......
// 投资记录
this.fetchLendItemList()
}
},
methods
fetchLendItemList() {
lendItemApi.getList(this.$route.params.id).then(response => {
this.lendItemList = response.data.list
})
}
views/core/lend/detail.vue
将投资记录放在借款人信息后面
投资记录
{{ scope.row.lendYearRate * 100 }}%
LendItemController
@ApiOperation("获取列表")
@GetMapping("/list/{lendId}")
public R list(
@ApiParam(value = "标的id", required = true)
@PathVariable Long lendId) {
List list = lendItemService.selectByLendId(lendId);
return R.ok().data("list", list);
}
pages/lend/_id.vue
async asyncData({ $axios, params }) {
......
//投资记录
let responseLendItemList = await $axios.$get(
'/api/core/lendItem/list/' + lendId
)
return {
......,
lendItemList: responseLendItemList.data.list, //投资记录
}
},
多线程(multithreading),是指从软件或者硬件上实现多个线程并发执行的技术。具有多线程能力的计算机因有硬件支持而能够在同一时间执行多于一个线程,进而提升整体处理性能。具有这种能力的系统包括对称多处理机https://baike.baidu.com/item/%E5%AF%B9%E7%A7%B0%E5%A4%9A%E5%A4%84%E7%90%86%E6%9C%BA/10375153?fromModule=lemma_inlink、多核心处理器以及芯片级多处理或同时多线程处理器。在一个程序https://baike.baidu.com/item/%E7%A8%8B%E5%BA%8F/71525?fromModule=lemma_inlink中,这些独立运行的程序片段叫作“线程https://baike.baidu.com/item/%E7%BA%BF%E7%A8%8B/103101?fromModule=lemma_inlink”(Thread),利用它编程的概念就叫作“多线程处理” [1] 。